1 Replies - 619 Views - Last Post: 12 March 2011 - 06:27 PM

#1 regieBoy  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 11-March 11

This code does not work..how to pull this thing?

Posted 11 March 2011 - 07:10 PM

<?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>



Is This A Good Question/Topic? 0
  • +

Replies To: This code does not work..how to pull this thing?

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 5949
  • View blog
  • Posts: 23,206
  • Joined: 23-August 08

Re: This code does not work..how to pull this thing?

Posted 12 March 2011 - 06:27 PM

You might get an answer if you provided something resembling a question that's answerable. "This code does not work...how to pull this thing?" makes absolutely no sense whatsoever.

Read this.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1