Jump to content

[SOLVED] update set query help


dannyone

Recommended Posts

hello everyone, im having trouble with this query, the query works just fine when updating a record that already exists in the database, however i would like it, if the user doesnt exist to create the user, i believe i need to do a insert into on duplicate key update query??..i have read the mysql site but just cant do it. can some1 help me please, many thanks

 

heres my query

@$todo=$_POST['do']; // take care of register global if off
if(isset($do) and $do=="submit_form"){
$d_array=$_POST['d_array'];
$tag_string="";
while (list ($key,$val) = @each ($d_array)) {
//echo "$val,";
$tag_string.=$val.",";
}
$tag_string=substr($tag_string,0,(strLen($tag_string)-1));
if(mysql_query("update Marker set time='$tag_string' where Marker_ID= '" .$_SESSION['id'] . "'")){
echo "Data Updated<br>"; 
}else{echo mysql_error();}

}

 

thanks

Link to comment
https://forums.phpfreaks.com/topic/147472-solved-update-set-query-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.