View Full Version : Resolved update mysql database depending on number typed in a form
Hi, I am wanting to update mysql database using a form i.e. someone types in unique id i.e. 1234. This then brings up the details for this person from the database etc. But how do I process the form, not sure how to hold the value to search against.. I will be using update and where commands in mysql to search through the database. Any ideas?
Thanks is advance
12-26-2010, 04:46 PM
Why would you use update to search a database?
Update is the command to edit a table / table row not for searching.
Select is for selecting rows which *IS* the right way for searching a database.
I would also suggest using mysql_real_escape_string(); on the return values from the form, for example $type = mysql_real_escape_string($_POST['type']); to stop SQL Injections.
I managed to get it working, I will add the string thanks for your assistance:thumbsup:
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.