I would use only a single query:
$sql = "UPDATE gallery SET order = (order+1) WHERE id_categ = ".$id;
$res = mysql_query($sql);
...
Is it possible?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
mysql_affected_rows()Example:
Note that the
mysql_affected_rows()return you the affected rows whether updated/deleted of your last run query. For example:Now if you do:
It will return the affected rows for the last query that is
gallery2table’s query.More Info: