<?php
//edit subjects.
$server ="localhost";
$user = "root";
$pass = "";
$dbase = "dummy";
$db_conn = mysql_connect($server,$user,$pass);
if(!$db_conn)
die("Error".mysql_error());
mysql_select_db($dbase,$db_conn);
$fetch = "select * from tbl_subjects";
?>
<html>
<head>
<script type="text/javascript">
function doThisonload(num)
{
document.getElementById(num).readOnly = true;
}
</script>
</head>
<body onload="doThisonload();">
<form name="edit">
<?php
$id = 0;
$fetch_query = mysql_query($fetch);
while($row = mysql_fetch_array($fetch_query))
{
$id++;
?>
<input type="text" name="cfn" id="<?php echo $id;?>" value= "<?php echo $row['id']?>" disabled="disabled" />
<input type="text" name="subjCode" id="<?php echo $id;?>" value="<?php echo $row['subject']?>" />
<input type="text" name="subjDesc" id="<?php echo $id;?>" value="<?php echo $row['subjDesc']?>" />
<input type="text" name="units" id="<?php echo $id;?>" value="<?php echo $row['units']?>" />
<br />
<?php
}
?>
<script type="text/javascript">
doThisonload('<?php echo $id;?>');
</script>
</form>
</body>
</html>
This code does not work..how to pull this thing?
Page 1 of 11 Replies - 541 Views - Last Post: 12 March 2011 - 06:27 PM
#1
This code does not work..how to pull this thing?
Posted 11 March 2011 - 07:10 PM
Replies To: This code does not work..how to pull this thing?
Page 1 of 1
|
|

New Topic/Question
Reply


MultiQuote




|