Note that there are some explanatory texts on larger screens.

plurals
  1. POMySQL/PHP update query error
    primarykey
    data
    text
    <p>I'm running a query to update a small group of 'items' in a table, from PHP. Running the code with "Sequel Pro" executes it perfectly, while running it on PHP using mysql("query here"); fails miserably.</p> <p>Is there anything wrong with my query?</p> <pre><code>UPDATE `service_joblocation` SET `in_use` = '1', `in_use_since` = '1283488686', `in_use_currentcount` = `in_use_currentcount`+1, `in_use_historicalcount`= `in_use_historicalcount`+1 WHERE `id` = 5 LIMIT 1; UPDATE `service_joblocation` SET `in_use` = '1', `in_use_since` = '1283488686', `in_use_currentcount` = `in_use_currentcount`+1, `in_use_historicalcount` = `in_use_historicalcount`+1 WHERE `id`=16 LIMIT 1; UPDATE `service_joblocation` SET `in_use` = '1', `in_use_since` = '1283488686', `in_use_currentcount` = `in_use_currentcount`+1, `in_use_historicalcount` = `in_use_historicalcount`+1 WHERE `id`=18 LIMIT 1; UPDATE `service_items` SET `checkin_user`='9', `checkin_date`='1283488686', `location`='5' WHERE `id`=576; UPDATE `service_items` SET `checkin_user`='9', `checkin_date`='1283488686', `location`='16' WHERE `id`=577; UPDATE `service_items` SET `checkin_user`='9', `checkin_date`='1283488686', `location`='18' WHERE `id`=578; UPDATE `service_jobs` SET `checkin_date`='1283488686', `checkin_user`='9',`checkin_department`='1',`checkin_client_person`='0', `items_x`=`items_x`+1 WHERE `id`='518' LIMIT 1; UPDATE `service_jobs` SET `checkin_date`='1283488686', `checkin_user`='9',`checkin_department`='1',`checkin_client_person`='0', `items_x`=`items_x`+1 WHERE `id`='518' LIMIT 1; UPDATE `service_jobs` SET `checkin_date`='1283488686', `checkin_user`='9',`checkin_department`='1',`checkin_client_person`='0', `items_x`=`items_x`+1 WHERE `id`='518' LIMIT 1; </code></pre> <p>This is the output message...</p> <blockquote> <p>You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UPDATE <code>service_joblocation</code> SET <code>in_use</code> = '1', <code>in_use_since</code> = '1283488686' at line 2</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload