frisiandi Posted March 24, 2009 Share Posted March 24, 2009 Pls help,I want to retrive data from MySQL to be shown in text field, how can i do that ?thanx Link to comment Share on other sites More sharing options...
Synook Posted March 24, 2009 Share Posted March 24, 2009 http://www.w3schools.com/php/php_mysql_select.asp Link to comment Share on other sites More sharing options...
frisiandi Posted March 25, 2009 Author Share Posted March 25, 2009 http://www.w3schools.com/php/php_mysql_select.aspThanks, but that link display data in table . What i want is to display data in text box Link to comment Share on other sites More sharing options...
TKW22 Posted March 25, 2009 Share Posted March 25, 2009 single text box <?php $result = mysql_query("SELECT column_name(s) FROM table_name WHERE column_name operator value"); $row = mysql_fetch_array($result);?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title></title> </head> <body> <form action="" method="post"><input type="text" value="<?php echo $row['column_name'] ?>"/></form> </body></html> more then one text box <?php require_once 'db.php'; $result = mysql_query("SELECT column_name(s) FROM table_name"); ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title></title> </head> <body> <?php while($row = mysql_fetch_array($result)){ echo '<form action="" method="post"><input type="text" value="' . $row['column_name'] . '"/></form>';}?> </body></html> <- this one is like the one in that link.Try that it should work.edit- sorry forgot the other codeedit2 - you don't need the form around it Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.