php - Update nth cell of row MySql -


i need cell based on number...

when use query or fetch can use column name or number, didn't find way how make in reverse.

something like:

"update shops set column1 = '$value'" => "update shops set id = '$value'" "update shops set column2 = '$value'" => "update shops set adress = '$value'" etc... 

this db structure:

+----+---------+--------------+ | id | address | phone number | +----+---------+--------------+ 

why bother concatenation @ all?

"update shops set cell$cellnumber = $value id = $id" 

however, right way change database structure , use prepared statements
so, proper code be

"update shop_cells set cell = ? id = ? , cellnumber = ?" 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -