Update to DB

From: Date: Wed, 28 May 2003 12:27:00 +0000
Subject: Update to DB
Groups: php.general 
Request: Send a blank email to php-general+get-149232@lists.php.net to get a copy of this message
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

« previous php.general (#149232) next »