Page 1 of 1
question about modifying something
Posted: Sat Dec 30, 2006 11:14 pm
by Nicole
Hi, I need to modify something that is pulled from a database. I know how to pull the item out of the database with php and then have the field all set and ready to go in a form field.
Can I use the same exact php with additions added to it send the item back to the database again, after it is modified?
In other words can you use a select query and an insert query with the same php code?
Thank you very much.
Posted: Sat Dec 30, 2006 11:21 pm
by feyd
I believe you're more referring to an UPDATE query, but the principle is the same. So the answer to your question is yes.
Re: question about modifying something
Posted: Sat Dec 30, 2006 11:44 pm
by richmix
Nicole wrote:Hi, I need to modify something that is pulled from a database. I know how to pull the item out of the database with php and then have the field all set and ready to go in a form field.
Can I use the same exact php with additions added to it send the item back to the database again, after it is modified?
In other words can you use a select query and an insert query with the same php code?
Thank you very much.
If I understand what you're trying to do correctly, you can just pull the info from your database with the SELECT query, and use the information from the SELECT query to populate the form fields. Then just make the action of the form point to a PHP file with an UPDATE query that simply utilizes the variables from the form. After the UPDATE query, just return the user to the form, and the fields should update to reflect the new information automatically, if you set it up right.
Posted: Sun Dec 31, 2006 1:10 am
by Nicole
You are soooo right!!!! I didn't even need an update command, I just sent it to
a separate modify field for the database. Every thing has been such a struggle that I tried, didn't think it would be that easy. Thanks!!