
October 30th, 2003, 10:19 AM
|
|
|
|
Join Date: Apr 2007
Posts: 4
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Problem With Mysql UPDATE Scripts!
Dear all,
I Have the little probleme with the following scripts. I Can't see adn can't edit the data from mysql server. How can i solve this probleme???
Please help me...
Best regards,
MMlug
php Code:
Original
- php Code |
|
|
|
<HTML> <?php if($submit) { $sql = "INSERT INTO personnel (firstname, lastname, nick, email, salary) VALUES ('$first','$last','$nickname','$email','$salary')"; echo "Thank you! Information entered.n"; } else if($update) { $sql = "UPDATE personnel SET firstname='$first', lastname='$last', nick='$nickname', email='$email', salary='$salary' WHERE id=$id"; echo "Thank you! Information updated.n"; } else if($id) { $result = mysql_query("SELECT * FROM personnel WHERE id=$id", $db); ?> <form method="post"action="<?php echo $PHP_SELF?>"> <input type="hidden"name="id"value="<?php echo $myrow["id"]?>"> First name:<input type="Text"name="first"value="<?php echo $myrow["firstname"]?>"><br> Last name:<input type="Text" name="last" value="<?php echo $myrow["lastname"]?>"><br> Nick Name:<input type="Text" name="nickname" value="<?php echo $myrow["nick"]?>"><br> E- mail:<input type= "Text" name= "email" value= "<?php echo $myrow["email "]?>"><br> Salary:<input type="Text" name="salary" value="<?php echo $myrow["salary"]?>"><br> <input type="Submit" name="update" value="Update information"></form> <? } else { ?> <form method="post" action="<?php echo $PHP_SELF?>"> First name:<input type="Text" name="first"><br> Last name:<input type="Text" name="last"><br> Nick Name:<input type="Text" name="nickname"><br> E- mail:<input type= "Text" name= "email"><br> Salary:<input type="Text" name="salary"><br> <input type="Submit" name="submit" value="Enter information"></form> <? } ?> </HTML>
|