nascar Posted August 20, 2011 Report Share Posted August 20, 2011 Sveiki, tātad piemērs ID Name Name2 Played 1 Janis Peteris 0 ID Name Name2 Played 2 Janis Peteris 0 mysql_query("UPDATE wtf SET played = '1' WHERE name ='$n1' AND name2 ='$n2'") or die(mysql_error()); un šini bridi viņš update ID 1 un 2, bet vajag lai pirmaja reizē tikai ID 1 update, bet otraja reize ID 2 :) kā to izdarīt? Kaspars... Quote Link to comment Share on other sites More sharing options...
viena tante Posted August 20, 2011 Report Share Posted August 20, 2011 (edited) UPDATE wtf SET played = 1 WHERE name='Janis'; visiem Jāņiem, bet pa vienam UPDATE wtf SET played = 1 WHERE id=1; Edited August 20, 2011 by viena tante Quote Link to comment Share on other sites More sharing options...
xPtv45z Posted August 20, 2011 Report Share Posted August 20, 2011 UPDATE wtf SET played = '1' WHERE name ='$n1' AND name2 ='$n2' AND played = 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.