jerry03 Posted November 20, 2009 Share Posted November 20, 2009 Hey, My name is Luis and im from dominican republic , i code Html,Xhtml and css but im just starting to learn PHP so yeah :S well the problem is i installed a CMS but i get these error when i go to page all comes out but in top of all comes out these error: Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\config\properties.php on line 42 if you need to see the error by your self you can go on my CMS page hosted by me http://godly.zapto.org:8080. ok After i read wat error sayd i tried to go to file and try to fix but nothing =[ could you guys help me fix these please!!? here is my File PHp content: <?php /*¯¯¯¯|¯¯¯¯¯|¯¯¯¯¯¯¯¯|¯¯¯|¯¯¯||¯¯¯|¯¯¯|¯¯¯¯¯¯¯¯|¯¯¯¯¯¯|¯¯¯¯*\ |###########################################| |#_____________________..ButsagsCMS.._____________________#| |#______.Copyright ©2000-2009 Chris Ingis. All Rights Reserved._____#| |###########################################| \*____|_____|________|___|___||___|___|________|______|____*/ if(basename($_SERVER["PHP_SELF"]) == "properties.php"){ die("403 - Access Forbidden"); } /* Site Controls */ $properties = mysql_query("SELECT * FROM butsags_properties"); $prop = mysql_fetch_array($properties); $ipaddress = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; if(isset($_SESSION['id'])){ $getsty = mysql_query("SELECT * FROM accounts WHERE id=".$_SESSION['id'].""); $showsty = mysql_fetch_array($getsty); if($showsty['style'] == NULL){ $style = "1"; }else{ $style = $showsty['style']; } $getstyle = mysql_query("SELECT * FROM butsags_styles WHERE id=".$style.""); $showstyle = mysql_fetch_array($getstyle); } if(isset($_SESSION['id'])){ $getcur = mysql_query("SELECT * FROM accounts WHERE id=".$_SESSION['id'].""); $showcur = mysql_fetch_array($getcur); if($showcur['cursor'] == NULL){ $cursor = "1"; }else{ $cursor = $showcur['cursor']; } $getcursor = mysql_query("SELECT * FROM butsags_cursors WHERE id=".$cursor.""); $showcursor = mysql_fetch_array($getcursor); } /* Name of server */ $servername = $prop['name']; /* Site title */ $sitetitle = $prop['title']; $pb = " (Powered by GodlyMs!)"; /* Download link for client */ $client = $prop['client']; /* Server Version */ $version = $prop['version']; /* Forum url*/ $forumurl = $prop['forumurl']; /* Site url */ $siteurl = $prop['siteurl']; /* butsags Dir */ $butsagsdir = $prop['butsagsdir']; /* Email */ $adminemail = $prop['email']; /* Vote Link */ $vote = $prop['vote']; /* Vote Enabled */ $vcheck = $prop['vcheck']; /* Vote Banner Link */ $vbanner = $prop['vbanner']; /* Server Rates */ $exprate = $prop['exprate']; $mesorate = $prop['mesorate']; $droprate = $prop['droprate']; /* Middle Banner Link */ $mbanner = $prop['mbanner']; /* Middle Link */ $mblink = $prop['mblink']; /* Menu Message */ $message = $prop['message']; /* Flood Prevention */ $butsagsflood = $prop['flood']; /* Flood Interval */ $butsagsfloodint = $prop['floodint']; /* Scrolling Message */ $scroller = $prop['scroller']; /* Level for GMs and up */ $gmlevel = $prop['gmlevel']; /* Player Cap */ $pcap = $prop['pcap']; /* Accounts Per IP */ $MaxAcc = $prop['maxaccounts']; /* Public Key For Recaptcha*/ $pubkey = $prop['pubkey']; /* Private Key For Recaptcha*/ $privkey = $prop['privkey']; /*Chatbox HTML*/ $chatbox = $prop['chatbox']; /* Where is the style located? */ if(isset($_SESSION['id'])){ $styledir = $showstyle['dir']; }else{ $styledir = $prop['styledir']; } if(isset($_SESSION['id'])){ $cursordir = $showcursor['dir']; }else{ $cursordir = $prop['cursordir']; } ?> if you guys can help me i would i apreciate it very much!! thank you Quote Link to comment https://forums.phpfreaks.com/topic/182333-guys-i-need-help-please/ Share on other sites More sharing options...
mrMarcus Posted November 20, 2009 Share Posted November 20, 2009 well, i'm thinking your $getcursor query is returning a boolean false, perhaps, instead of a Resource ID. add: or trigger_error (mysql_error()); to the end of the query. Quote Link to comment https://forums.phpfreaks.com/topic/182333-guys-i-need-help-please/#findComment-962180 Share on other sites More sharing options...
Mchl Posted November 20, 2009 Share Posted November 20, 2009 Arrrggghh... You owe ma a pair of good 20/20 eyes! Please do not use that much color in your posts. Quote Link to comment https://forums.phpfreaks.com/topic/182333-guys-i-need-help-please/#findComment-962183 Share on other sites More sharing options...
jerry03 Posted November 20, 2009 Author Share Posted November 20, 2009 can u like pet walk me trought the fix? im kinda nub on these php codes T>T :-\ Quote Link to comment https://forums.phpfreaks.com/topic/182333-guys-i-need-help-please/#findComment-962187 Share on other sites More sharing options...
mrMarcus Posted November 20, 2009 Share Posted November 20, 2009 what is: $showcur['cursor'];? is it a string or integer? you might need to wrap $cursor with single-quotes. Quote Link to comment https://forums.phpfreaks.com/topic/182333-guys-i-need-help-please/#findComment-962190 Share on other sites More sharing options...
Zane Posted November 20, 2009 Share Posted November 20, 2009 On SELECT statements the only reason mysql_query would return FALSE is if you didn't have permission on the table mysql_query() will also fail and return FALSE if the user does not have permission to access the table(s) referenced by the query. EDIT: not having permission on a table can also be the same as a table not existing at all. (This may mean you have mispelled a tablename) This is why you should use the mysql debugging function provided to you to catch such things. Example $getcursor = mysql_query("SELECT * FROM butsags_cursors WHERE id=".$cursor."") or die(mysql_error()); // $showcursor = mysql_fetch_array($getcursor); Quote Link to comment https://forums.phpfreaks.com/topic/182333-guys-i-need-help-please/#findComment-962192 Share on other sites More sharing options...
jerry03 Posted November 20, 2009 Author Share Posted November 20, 2009 lol im so seriously like lost T>T can someone like logmein whit me or teamviewer? t.t sorry for nub questions T>T Quote Link to comment https://forums.phpfreaks.com/topic/182333-guys-i-need-help-please/#findComment-962201 Share on other sites More sharing options...
Zane Posted November 20, 2009 Share Posted November 20, 2009 lol im so seriously like lost T>T can someone like logmein whit me or teamviewer? t.t sorry for nub questions T>T lol im so seriously like what can somebody so like translate that? O Quote Link to comment https://forums.phpfreaks.com/topic/182333-guys-i-need-help-please/#findComment-962209 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.