Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I have a program who list out the data from MySql database using a do command, below is the example:Code: Select all
<?
require_once('connect.php'); // this file store the password
$db = mysql_pconnect($hostname, $username, $password) or trigger_error(mysql_error(),E_USER_ERROR);
mysql_select_db($database, $db);
$query_Recordset1 = "SELECT * FROM customer ORDER BY name";
$Recordset1 = mysql_query($query_Recordset1, $db) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
do {
?>
<html>
<table border="1" width="100%">
<tr>
<td width="50%">Customer Name:</td>
<td width="50%"><input name="name" type="text" id="name" value="<? echo $row_Recordset1['name']; ?>" size="30" maxlength="30">td>
</tr>
</table>
<?
} while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)) ;
?>let say my database contains about 50 records and all 50 records will be output on the screen. The input program will allow user to key-in the new value on all the 50 records. How do I update the value into MySql database ?
Pimptastic | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]