Jump to content
GIGN Forum

Mysql Update


Soprano
 Share

Recommended Posts

Kapēc scripts nestrādā,nelabo mysql laukus?

<?php
mysql_connect("localhost", "root", "pw") or die(mysql_error());
mysql_select_db("ads") or die(mysql_error());
if($_POST['add'>){
if($_POST['age'>){
// get variables from previous form
$id = ($_POST['id'>);
$age = mysql_real_escape_string($_POST['age'>);
mysql_query("UPDATE `users`(`age`) VALUES('$age') WHERE ID='$id'");
echo'
<font color=green>labots</font>
<a href="index.php"><font color=red>Atpakaļ</font></a>
';
}
}
?>
<table width="100%">
<form method="post">
<tr>
<td>Vecums</td>
<td><input type="text" name="age" /></td>
</tr>
<tr>
<td colspan="3"><input type="submit" name="add" value="Pievienot" /></td>
</tr>
</form>
</table>

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...