Soprano Posted December 17, 2011 Report Share Posted December 17, 2011 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 More sharing options...
sLIDe Posted December 18, 2011 Report Share Posted December 18, 2011 Netiek padots ID Link to comment Share on other sites More sharing options...
Soprano Posted December 18, 2011 Author Report Share Posted December 18, 2011 Problēma risināta! $sql="UPDATE users SET age='$age' WHERE id='$id'"; $result=mysql_query($sql); mysql_query($query); Link to comment Share on other sites More sharing options...
w4p1337 Posted December 18, 2011 Report Share Posted December 18, 2011 $id = ($_POST['id'>); a kur aizsardzība? Link to comment Share on other sites More sharing options...
DoubleT Posted December 20, 2011 Report Share Posted December 20, 2011 htmlspecialchars mysql_real_escape_string Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now