Two MySQL queries into one.
Posted: Sat Jan 09, 2010 2:48 pm
Hi, I have two queries for changing the items position. Move one up and other down.
The problem is that any user who clicks on the arrow fast enough can break the script when it hasn't yet moved the second item.
It works fine, when I use it normally.
Can I somehow put these queries together?
Thank you for your time.
The problem is that any user who clicks on the arrow fast enough can break the script when it hasn't yet moved the second item.
It works fine, when I use it normally.
Can I somehow put these queries together?
Thank you for your time.
Code: Select all
<?php
mysql_query("UPDATE bookmarks SET position='$position'
WHERE position='$higherposition' AND ename='$ename' AND parent='$parent'") or die(mysql_error());
mysql_query("UPDATE bookmarks SET position='$higherposition'
WHERE ID='$id' AND ename='$ename' AND parent='$parent'") or die(mysql_error());
?>