Update more tables

Discussion in 'PHP' started by tasos55, Apr 17, 2013.

  1. #1
    Hello there, i need to count when they click on the picture it works, but now i want to update more tables how to do that ? here below is the script.

    mysql_query("UPDATE pictures SET count_pic = count_pic + 1 WHERE id = " .$file_id);
    PHP:
    Thanks.
     
    tasos55, Apr 17, 2013 IP
  2. Dangy

    Dangy Well-Known Member

    Messages:
    841
    Likes Received:
    25
    Best Answers:
    2
    Trophy Points:
    155
    #2
    mysql_query("UPDATE table,table,table SET count_pic = count_pic + 1 WHERE id = ".$file_id);
    PHP:
    or


    mysql_query("UPDATE pictures SET count_pic = count_pic + 1 WHERE id = " .$file_id);
    mysql_query("UPDATE pictures SET count_pic = count_pic + 1 WHERE id = " .$file_id);
    mysql_query("UPDATE pictures SET count_pic = count_pic + 1 WHERE id = " .$file_id);
    PHP:
     
    Dangy, Apr 17, 2013 IP