MasterACE14 Posted September 30, 2007 Author Share Posted September 30, 2007 I keep looking through my files over and over again, But I just cant figure out where player_session() has been called already, it just doesnt seem to be previously called at all :-\ is their a way I can make a debugging script to check for all player_sessions() called for say all the files in the folder or something? ??? Quote Link to comment https://forums.phpfreaks.com/topic/71149-solved-ive-stuffed-up-big/page/2/#findComment-358213 Share on other sites More sharing options...
MasterACE14 Posted September 30, 2007 Author Share Posted September 30, 2007 removing player_session() from the top of base.php still gives me the redeclare error :-\ : <?php // players base /* includes */ include '/home/ace/public_html/conflictingforces/functions.php'; //player_session(); Fatal error: Cannot redeclare player_session() (previously declared in /home/ace/public_html/conflictingforces/functions.php:7) in /home/ace/public_html/conflictingforces/functions.php on line 4 and player_session() isnt called in functions.php as that is where the function has been created. So this is really weird ??? EDIT: I commented out the entire player_session() function, and then when I went to base.php it gave the exact same error message for player_table() somethings stuffing up with the functions altogether. Cannot redeclare when it hasnt even been declared once? very bizarre Quote Link to comment https://forums.phpfreaks.com/topic/71149-solved-ive-stuffed-up-big/page/2/#findComment-358277 Share on other sites More sharing options...
MasterACE14 Posted September 30, 2007 Author Share Posted September 30, 2007 I've finnaly fixed the bug. My final working code is this(on base.php): <?php // players base /* includes */ include_once '/home/ace/public_html/conflictingforces/functions.php'; player_session(); I have used include_once() instead of include() and that has fixed some wacky behavior. Now I got 1 more bug left, this one is also weird. My player_table() function works fine on base.php, but while it is working fine on pages I need it, I am getting mysql errors on pages where I dont, what i mean by dont is, I dont even include() functions.php(has player_table() function) and I dont even call the function. But yet, this fully working code is displaying error messages on my other pages. here's the error message: Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 7 in /home/ace/public_html/conflictingforces/functions.php on line 40 Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 8 in /home/ace/public_html/conflictingforces/functions.php on line 40 Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 9 in /home/ace/public_html/conflictingforces/functions.php on line 40 Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 10 in /home/ace/public_html/conflictingforces/functions.php on line 40 Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 11 in /home/ace/public_html/conflictingforces/functions.php on line 40 Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 12 in /home/ace/public_html/conflictingforces/functions.php on line 40 Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 13 in /home/ace/public_html/conflictingforces/functions.php on line 40 line 40 of functions.php is: <?php $query = mysql_result($rs,0,0); (without the php tags right before it of course) Quote Link to comment https://forums.phpfreaks.com/topic/71149-solved-ive-stuffed-up-big/page/2/#findComment-358355 Share on other sites More sharing options...
LemonInflux Posted September 30, 2007 Share Posted September 30, 2007 And uuh...What's the query, again? Quote Link to comment https://forums.phpfreaks.com/topic/71149-solved-ive-stuffed-up-big/page/2/#findComment-358371 Share on other sites More sharing options...
MasterACE14 Posted September 30, 2007 Author Share Posted September 30, 2007 I got it working now the final code was: <?php // Select fields from the user table function player_table($select){ $where = $_SESSION['playerid']; $rs = mysql_connect("localhost", "ace_ACE", "*****"); mysql_select_db("ace_cf", $rs); $sql = "SELECT `" . $select . "` FROM `cf_users` WHERE `id`='" . $where . "' LIMIT 1"; $rs = mysql_query($sql) or die('Query:<br />' . $sql . '<br /><br />Error:<br />' . mysql_error()); while($row = mysql_fetch_assoc($rs)){ if(isset($row[$select])){return $row[$select];} } } Thanks for all your help guys, much appreciated Regards ACE Quote Link to comment https://forums.phpfreaks.com/topic/71149-solved-ive-stuffed-up-big/page/2/#findComment-358376 Share on other sites More sharing options...
Ninjakreborn Posted September 30, 2007 Share Posted September 30, 2007 use require_once not include once. Especially if it's a file that is needed for the page to run. Quote Link to comment https://forums.phpfreaks.com/topic/71149-solved-ive-stuffed-up-big/page/2/#findComment-358378 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.