|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
update sql help please
hi all. need help manulipilating this script to produce a update sql query
PHP Code:
currently that builds the insert query (that works well) now i want to do the same thing but build a update query. cheers aron. |
|
#2
|
|||
|
|||
|
trailing , comma help
ok got it pretty much there.
PHP Code:
produces UPDATE listings SET property_id=236846, category='commercial', office_area='22', vparks='covered', type='All', additional_areas='loft', hot_water='solar_electric', tiled_roof='1', building_style='other', WHERE id=23 but how do i get rid of the trailing , comma |
|
#3
|
||||
|
||||
|
Instead of:
$sql_2 .= ($key.'='.$value.', '); I would recommend something like this: if(!empty($where)) $where.=','; $where .= ($key.'='.$value); Then outside to loop do this: $sql_2.=$where; |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > update sql help please |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|