stencilz Posted January 22, 2007 Report Share Posted January 22, 2007 function add($user) { $x = mysql_query("SELECT user1,user2 FROM single WHERE user1='".$user."'"); $q = mysql_fetch_array($x); $z = mysql_query("SELECT COUNT(*) FROM single WHERE user1='".$user."'"); $a = mysql_fetch_row($z); if($a[0] == "0") { echo '1'; mysql_query("INSERT INTO single (user1) VALUES ('".$user."')"); echo 'please be patient <a href="s_f.php?page=add">refresh page</a>'; } if($a[0] == "1") { if($q['user1'] == $user && $q['user2'] == "") { echo '2'; echo 'please be patient <a href="s_f.php?page=add">refresh page</a>'; } if($q['user1'] == $user && $q['user2'] != "") { echo ''.$q['user1'].' accepted <a href="s_f.php?page=1">start play</a>'; } } } kad pirmo reizi ieiet lapā un izpildās insert kverijs viss ir ok, bet ja mēģina refreshot tad lapa neveras vaļā, kas varētu būt par probēmu? Link to comment Share on other sites More sharing options...
Delfins Posted January 22, 2007 Report Share Posted January 22, 2007 a moš tev ir loops kaut kāds ārā... neesam gaišreģi. f-ja arī nav no tā saprotajām. Link to comment Share on other sites More sharing options...
bubu Posted January 22, 2007 Report Share Posted January 22, 2007 Jāatkārtojas: Identācija, identācija un vēlreiz identācija. Tā gan neatrisinās tavu problēmu, bet ĻOTI palīdzēs citiem saprast tavu kodu. Iespējams, ka pat pašam palīdzēs. Link to comment Share on other sites More sharing options...
Recommended Posts