php/sql record update

Associate
Joined
18 Oct 2002
Posts
858
Location
Cheshire
ok, I'm trying to write a piece of code, it needs to take an ID from table 1 (passed via urlencode) and place it a column called table1_ID from a SELECT queery on table 2.
Also once this is completed the column in table2 called STATUS needs to be changed to "2"
The only problem is the SELECT queery on table 2 can return multiple rows but it's only the top row that we want to work with.

Whats the best way of doing this?

Code examples would be appreciated coz I'm chasing my own tail at the moment.

Thanks
 
It does and doesn't.... lol
My main concern is getting the info back into the database.... it doesn't want to change the data befor it even tries to put it into the database.
 
it's ok, I got it.... lol

$row_get_order['orders_status'] = "2"

that works now... must have had syntax wrong....

Now I build the SQL statement to shove the alterd aray back into mysql...


One thing though.....

on the preceding PHP file, it's a form for users to enter requested info.... which then shoves it into table1. The table1_id is auto generated by mysql.
how do i get it to give me the autogenerated table1_id without having to do another queery?
 
Back
Top Bottom