Hello,
I'm trying to write a sql statement that would update a record only if a particular row column is empty; else, insert a new record.
Is this doable?
Currently, I have this update statement:
//query for additional cars 1
$mysql_query=("UPDATE additional_cars SET clientID='$edit_clientID', registeredstate='$edit_registeredstate',
dhtmlgoodies_category='$dhtmlgoodies_categoryupdate', dhtmlgoodies_subcategory='$dhtmlgoodies_subcategoryupdate',caryear='$edit_caryear', servicearea='$lastservice',
currentmileage='$edit_currentmileage', todays_date='$date2', time='$time2', servicedescription='$inputbox2', service='$edit_servicearea_str', servicedesc =CONCAT('$inputbox', servicedesc) WHERE id='$edit_sel_id'");
$result=mysql_query($mysql_query);
if(!$result){die("Error: ".mysql_error());
$id=LAST_INSERT_ID();
How can I modify the above to achieve the outcome mentioned.