Hello,

I was just wondering how to update data to database from html text field.

I have a form that retrieves data from dbase and put's values into text
field in a web page. I want to be able to modify data and then save it dbase
by hitting save button (also form object).

ie.

$sql="SELECT col1 FROM table WHERE id = 1";
$result=mysql_query($sql);
$num = mysql_num_rows($result);
$row = mysql_fetch_array($result);
$var = $row["col1"];
echo "<form name=\"form1\" method=\"post\" action=\"\">";

echo "<input name=\"name\" type=\"text\" id=\"name\" value=\"$var1\"
size=\"30\" maxlength=\"30\">";

echo "<input name=\"save\" type=\"submit\" id=\"save\" value=\"save\">";


Anyone know what is the proper way to do this?

-Kalle


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to