How to update sql like this

bcwscamrleu

New Member
Hey,i've got a problem, i want to execute this sql update, but it doesn't work. Could anyone help me? Thanks!The code:\[code\]$temp = $_GET['ul'];foreach ($temp as $key=> $value){ $str=array(); $arr=explode(',',$value); $str =array($key=>$arr); for($i=0;$i<count($str[$key]);$i++) { $tripID='2'; $sql = "UPDATE places_trips SET orderNo='$i', ColumnNo='$key' WHERE place_id=" . $str[$key][$i] . " AND trip_id=" . $tripID; mysql_query($sql); } } }\[/code\]I want to set the $tripID = 2, but actually, $tripID=2222. So how to make the $tripID=2 all the time?
 
Back
Top