Join 136,930 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,836 people online right now. Registration is fast and FREE... Join Now!
okay...so i know how it is about mafia games and all but i have one...and im new to this php thing...by the way sorry if this isnt the right place for this and since the problem has to do with php i put here...but any way when i go to the login page for the new round and start playing it just shows a blank white page and it says kick...anyone have any guess why...???
if(fetch("SELECT round FROM $tab[games] WHERE round='$tru' AND starts<$time AND ends>$time;")) { $pimp =mysql_fetch_array(mysql_query("SELECT id,code,status,user FROM $tab[pimp] WHERE code='$code';"));
if ($pimp[2] == banned){ header("Location: ../play.php?msg=disabled"); } elseif ($pimp[0]) { mysql_query("UPDATE $tab[pimp] SET online='$time', ip='$REMOTE_ADDR' WHERE id='$pimp[0]'");
thats where the problem is...first it gave the error ... Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/username/public_html/tru/dologin.php on line 8... but then i changed the $tab[game] to $tab[games] and thats when it said kick if i take the $tab[games] and just make it $tab[game] it shows the error again but i guess that $tab[game] wasnt the problem but i dont see whats wrong with line 8 either...
This post has been edited by B-Boy209: 19 Mar, 2008 - 10:40 AM
Then make sure you have $tab[games] because that is working, your warning is coming on the following line there where you go to set $pimp.
You execute the statement SELECT id,code,status,user FROM $tab[pimp] WHERE code='$code'; so you need to check this out if it is correct. First of all, what will $tab[pimp] return? Is that a valid table? Then make sure that the table returned has the fields id, code, status and user. If it doesn't have all those fields, it will fail. Lastly, make sure that $code is coming out to be a value. By correcting this query you should get much much closer to it working for you.
well i tried what you said checked the tables and they were there...only thing i dont get is what do you mean that make sure that $code is coming out to be a value...is there anyway that the problem could be elsewhere...???
yeah i hope its not as well because im already stressed as it is...but i like it kind of because its helping me learn...but im also trying to get the game up so thats the reason for the frustration...
Thats good, Games are good way to learn (programming wise). If you were to write algorithms and complex functions, it would be pretty stressful and boring if you are new, but the game gives some sort of motivation lol. It did to me, I was just excited to get it up and running so I fought the frustration
So anyways, what is this script called, I might take a look inside or find some other reviews of it.