bladewolf2010 Posted June 3, 2010 Share Posted June 3, 2010 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/rainofhe/public_html/mainmenu.php on line 68 64-75 print " <tr><td>[url='newspaper.php']Newspaper[/url]</td></tr> <tr><td>[url='search.php']Search[/url]</td></tr>"; $qq=mysql_query("SELECT * FROM cities1 WHERE cityowner1=$ir[userid1]"); if(mysql_num_rows($qq) > 0) { print "[url='cityadmin.php']City Admin Panel[/url] "; } if(!$ir['jail'] && $ir['gang']) { print "<tr><td>[url='yourgang.php']Your Gang[/url]</td></tr>"; } Quote Link to comment Share on other sites More sharing options...
Zero-Affect Posted June 3, 2010 Share Posted June 3, 2010 $qq=mysql_query("SELECT * FROM cities1 WHERE cityowner1={$ir[userid1]}"); Quote Link to comment Share on other sites More sharing options...
bladewolf2010 Posted June 3, 2010 Author Share Posted June 3, 2010 same error Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/rainofhe/public_html/mainmenu.php on line 68 Quote Link to comment Share on other sites More sharing options...
Zero-Affect Posted June 3, 2010 Share Posted June 3, 2010 print " <tr> <td>[url='newspaper.php']Newspaper[/url]</td> </tr> <tr> <td>[url='search.php']Search[/url]</td> </tr> "; $qq = mysql_query("SELECT * FROM cities1 WHERE cityowner1={$ir['userid1']}"); // curious is it supposed to be userid1? if ( mysql_num_rows($qq) > 0) { print "[url='cityadmin.php']City Admin Panel[/url] "; } if(!$ir['jail'] && $ir['gang']) { print "<tr><td>[url='yourgang.php']Your Gang[/url]</td></tr>"; } Quote Link to comment Share on other sites More sharing options...
MDK666 Posted June 3, 2010 Share Posted June 3, 2010 crimegame has it right but as the topic title says its for mc2 print "<tr><td>[url='newspaper.php']Newspaper[/url]</td></tr> <tr><td>[url='search.php']Search[/url]</td></tr>"; $qq=$db->query("SELECT * FROM cities1 WHERE cityowner1={$ir['userid1']}"); //userid1 might be a seperate table to test the mod. if($db->num_rows($qq) >0) { print "[url='cityadmin.php']City Admin Panel[/url] "; } if(!$ir['jail'] && $ir['gang']) { print "<tr><td>[url='yourgang.php']Your Gang[/url]</td></tr>"; that might work well it should as its converted to mc2 so if theres any errors let us know and well go over it. Quote Link to comment Share on other sites More sharing options...
bladewolf2010 Posted June 3, 2010 Author Share Posted June 3, 2010 Parse error: syntax error, unexpected $end in /home/rainofhe/public_html/mainmenu.php on line 87 line 87 ?> Quote Link to comment Share on other sites More sharing options...
MDK666 Posted June 3, 2010 Share Posted June 3, 2010 yea it should work as a unexpected end means you dont have ?> in it, if it still gives you errors post the full script and ill go over it for u Quote Link to comment Share on other sites More sharing options...
bladewolf2010 Posted June 3, 2010 Author Share Posted June 3, 2010 <?php /** * Layout made by: Shaved92bravada Idea came from another post on CE * Rest of code is just standard V2 MCcodes * Made as a free mod so it is not to be sold. */ global $db,$c,$ir, $set; $hc=$set['hospital_count']; $jc=$set['jail_count']; $ec=$ir['new_events']; $mc=$ir['new_mail']; if($ir['hospital']) { print "<table width=145 class=menu><th>Main</th><tr><td> [url='hospital.php']Hospital ($hc)[/url]</td></tr> <tr><td>[url='inventory.php']Inventory[/url]</td></tr>"; } elseif($ir['jail']) { print "<table width=145 class=menu><th>Main</th><tr><td> [url='jail.php']Jail ($jc)[/url]</td></tr> <tr><td>[url='inventory.php']Inventory[/url]</td></tr>"; } else { print "<table width=145 class=menu><th>Main</th><tr><td> [url='index.php']Home[/url]</td></tr> <tr><td>[url='streets.php']Explore Streets<font color='red'><blink>(new)</blink></font>[/url]</td></tr> <tr><td>[url='inventory.php']Inventory[/url]</td></tr>"; } if($ec > 0) { print "<tr><td>[url='events.php']Events ($ec)[/url]</td></tr>"; } else { print "<tr><td>[url='events.php']Events (0)[/url]</td></tr>"; } if($mc > 0) { print "<tr><td>[url='mailbox.php']Mailbox ($mc)<image src='mail.jpg'>[/url]</td></tr>"; } else { print "<tr><td>[url='mailbox.php']Mailbox (0)[/url]</td></tr>"; } if($ir['jail'] and !$ir['hospital']) { print "<tr><td>[url='gym.php']Jail Gym[/url]</td></tr> <tr><td>[url='hospital.php']Hospital ($hc)[/url]</td></tr>"; } else if (!$ir['hospital']) { print "<tr><td>[url='explore.php']Explore[/url]</td></tr> <tr><td>[url='gym.php']Gym[/url]</td></tr> <tr><td>[url='criminal.php']Crimes[/url]</td></tr> <tr><td>[url='job.php']Your Job[/url]</td></tr> <tr><td>[url='education.php']Local School[/url]</td></tr> <tr><td>[url='hospital.php']Hospital ($hc)[/url]</td></tr> <tr><td>[url='jail.php']Jail ($jc)[/url]</td></tr>"; } else { print "<tr><td>[url='jail.php']Jail ($jc)[/url]</td></tr>"; } print "<tr><td>[url='/forums']Forums[/url]</td></tr>"; if($ir['new_announcements']) { print "<tr><td>[url='announcements.php']Announcements ({$ir['new_announcements']})[/url]</td></tr>"; } else { print "<tr><td>[url='announcements.php']Announcements (0)[/url]</td></tr>"; } print "<tr><td>[url='newspaper.php']Newspaper[/url]</td></tr> <tr><td>[url='search.php']Search[/url]</td></tr>"; $qq=$db->query("SELECT * FROM cities1 WHERE cityowner1={$ir['userid1']}"); //userid1 might be a seperate table to test the mod. if($db->num_rows($qq) >0) { print "[url='cityadmin.php']City Admin Panel[/url] "; } if(!$ir['jail'] && $ir['gang']) { print "<tr><td>[url='yourgang.php']Your Gang[/url]</td></tr>"; if(!$ir['jail'] && $ir['gang']) { print "<tr><td>[url='yourgang.php']Your Gang[/url]</td></tr>"; } print "<th>[b]Personal:[/b]</th> <tr><td>[url='preferences.php']Preferences[/url]</td></tr> <tr><td>[url='preport.php']Player Report[/url]</td></tr> <tr><td>[url='breport.php']Bug Report<font color='red'><blink>(new)</blink>[/url]</td></tr> <tr><td>[url='helptutorial.php']Help Tutorial[/url]</td></tr> <tr><td>[url='gamerules.php']Game Rules[/url]</td></tr> <tr><td>[url='viewuser.php?u={$ir[']My Profile[/url]</td></tr> <tr><td>[url='logout.php']Logout[/url]</td></tr> </table>"; ?> Quote Link to comment Share on other sites More sharing options...
Zero-Affect Posted June 3, 2010 Share Posted June 3, 2010 <?php /** * Layout made by: Shaved92bravada Idea came from another post on CE * Rest of code is just standard V2 MCcodes * Made as a free mod so it is not to be sold. */ global $db,$c,$ir, $set; $hc=$set['hospital_count']; $jc=$set['jail_count']; $ec=$ir['new_events']; $mc=$ir['new_mail']; if($ir['hospital']) { print "<table width=145 class=menu><th>Main</th><tr><td> [url='hospital.php']Hospital ($hc)[/url]</td></tr> <tr><td>[url='inventory.php']Inventory[/url]</td></tr>"; } elseif($ir['jail']) { print "<table width=145 class=menu><th>Main</th><tr><td> [url='jail.php']Jail ($jc)[/url]</td></tr> <tr><td>[url='inventory.php']Inventory[/url]</td></tr>"; } else { print "<table width=145 class=menu><th>Main</th><tr><td> [url='index.php']Home[/url]</td></tr> <tr><td>[url='streets.php']Explore Streets<font color='red'><blink>(new)</blink></font>[/url]</td></tr> <tr><td>[url='inventory.php']Inventory[/url]</td></tr>"; } if($ec > 0) { print "<tr><td>[url='events.php']Events ($ec)[/url]</td></tr>"; } else { print "<tr><td>[url='events.php']Events (0)[/url]</td></tr>"; } if($mc > 0) { print "<tr><td>[url='mailbox.php']Mailbox ($mc)<image src='mail.jpg'>[/url]</td></tr>"; } else { print "<tr><td>[url='mailbox.php']Mailbox (0)[/url]</td></tr>"; } if($ir['jail'] and !$ir['hospital']) { print "<tr><td>[url='gym.php']Jail Gym[/url]</td></tr> <tr><td>[url='hospital.php']Hospital ($hc)[/url]</td></tr>"; } else if (!$ir['hospital']) { print "<tr><td>[url='explore.php']Explore[/url]</td></tr> <tr><td>[url='gym.php']Gym[/url]</td></tr> <tr><td>[url='criminal.php']Crimes[/url]</td></tr> <tr><td>[url='job.php']Your Job[/url]</td></tr> <tr><td>[url='education.php']Local School[/url]</td></tr> <tr><td>[url='hospital.php']Hospital ($hc)[/url]</td></tr> <tr><td>[url='jail.php']Jail ($jc)[/url]</td></tr>"; } else { print "<tr><td>[url='jail.php']Jail ($jc)[/url]</td></tr>"; } print "<tr><td>[url='/forums']Forums[/url]</td></tr>"; if($ir['new_announcements']) { print "<tr><td>[url='announcements.php']Announcements ({$ir['new_announcements']})[/url]</td></tr>"; } else { print "<tr><td>[url='announcements.php']Announcements (0)[/url]</td></tr>"; } print "<tr><td>[url='newspaper.php']Newspaper[/url]</td></tr> <tr><td>[url='search.php']Search[/url]</td></tr>"; $qq = $db->query("SELECT * FROM cities1 WHERE cityowner1={$ir['userid1']}"); if($db->num_rows($qq) >0) { print "[url='cityadmin.php']City Admin Panel[/url] "; } if(!$ir['jail'] && $ir['gang']) { print "<tr><td>[url='yourgang.php']Your Gang[/url]</td></tr>"; if(!$ir['jail'] && $ir['gang']) { print "<tr><td>[url='yourgang.php']Your Gang[/url]</td></tr>"; } echo " <th>[b]Personal:[/b]</th> <tr><td>[url='preferences.php']Preferences[/url]</td></tr> <tr><td>[url='preport.php']Player Report[/url]</td></tr> <tr><td>[url='breport.php']Bug Report<font color='red'><blink>(new)</blink>[/url]</td></tr> <tr><td>[url='helptutorial.php']Help Tutorial[/url]</td></tr> <tr><td>[url='gamerules.php']Game Rules[/url]</td></tr> <tr><td>[url='viewuser.php?u={$ir[']My Profile[/url]</td></tr> <tr><td>[url='logout.php']Logout[/url]</td></tr> </table> "; } ?> Quote Link to comment Share on other sites More sharing options...
bladewolf2010 Posted June 3, 2010 Author Share Posted June 3, 2010 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 Quote Link to comment Share on other sites More sharing options...
MDK666 Posted June 3, 2010 Share Posted June 3, 2010 pm me on yahoo andrew_032686 or msn [email protected] cuz im gonna test this on my local server right now and see why you keep getting these errors. Quote Link to comment Share on other sites More sharing options...
bladewolf2010 Posted June 3, 2010 Author Share Posted June 3, 2010 I added you onto msn Quote Link to comment Share on other sites More sharing options...
lucky3809 Posted June 3, 2010 Share Posted June 3, 2010 the one you posted before was only missing a } at the end of it before ?> Quote Link to comment Share on other sites More sharing options...
MDK666 Posted June 3, 2010 Share Posted June 3, 2010 <?php /** * Layout made by: Shaved92bravada Idea came from another post on CE * Rest of code is just standard V2 MCcodes * Made as a free mod so it is not to be sold. */ global $db,$c,$ir, $set; $hc=$set['hospital_count']; $jc=$set['jail_count']; $ec=$ir['new_events']; $mc=$ir['new_mail']; if($ir['hospital']) { print "<table width=145 class=menu><th>Main</th><tr><td> [url='hospital.php']Hospital ($hc)[/url]</td></tr> <tr><td>[url='inventory.php']Inventory[/url]</td></tr>"; } elseif($ir['jail']) { print "<table width=145 class=menu><th>Main</th><tr><td> [url='jail.php']Jail ($jc)[/url]</td></tr> <tr><td>[url='inventory.php']Inventory[/url]</td></tr>"; } else { print "<table width=145 class=menu><th>Main</th><tr><td> [url='index.php']Home[/url]</td></tr> <tr><td>[url='streets.php']Explore Streets<font color='red'><blink>(new)</blink></font>[/url]</td></tr> <tr><td>[url='inventory.php']Inventory[/url]</td></tr>"; } if($ec > 0) { print "<tr><td>[url='events.php']Events ($ec)[/url]</td></tr>"; } else { print "<tr><td>[url='events.php']Events (0)[/url]</td></tr>"; } if($mc > 0) { print "<tr><td>[url='mailbox.php']Mailbox ($mc)<image src='mail.jpg'>[/url]</td></tr>"; } else { print "<tr><td>[url='mailbox.php']Mailbox (0)[/url]</td></tr>"; } if($ir['jail'] and !$ir['hospital']) { print "<tr><td>[url='gym.php']Jail Gym[/url]</td></tr> <tr><td>[url='hospital.php']Hospital ($hc)[/url]</td></tr>"; } else if (!$ir['hospital']) { print "<tr><td>[url='explore.php']Explore[/url]</td></tr> <tr><td>[url='gym.php']Gym[/url]</td></tr> <tr><td>[url='criminal.php']Crimes[/url]</td></tr> <tr><td>[url='job.php']Your Job[/url]</td></tr> <tr><td>[url='education.php']Local School[/url]</td></tr> <tr><td>[url='hospital.php']Hospital ($hc)[/url]</td></tr> <tr><td>[url='jail.php']Jail ($jc)[/url]</td></tr>"; } else { print "<tr><td>[url='jail.php']Jail ($jc)[/url]</td></tr>"; } print "<tr><td>[url='/forums']Forums[/url]</td></tr>"; if($ir['new_announcements']) { print "<tr><td>[url='announcements.php']Announcements ({$ir['new_announcements']})[/url]</td></tr>"; } else { print "<tr><td>[url='announcements.php']Announcements (0)[/url]</td></tr>"; } print "<tr><td>[url='newspaper.php']Newspaper[/url]</td></tr> <tr><td>[url='search.php']Search[/url]</td></tr>"; $q=$db->query("SELECT * FROM cities1 WHERE cityowner11={$ir['userid']}"); //its userid not userid1 as its pulling from the users table. if($db->num_rows($q)>0) { print "[url='cityadmin.php']City Admin Panel[/url] "; } if(!$ir['jail'] && $ir['gang']) { print "<tr><td>[url='yourgang.php']Your Gang[/url]</td></tr>"; if(!$ir['jail'] && $ir['gang']) { print "<tr><td>[url='yourgang.php']Your Gang[/url]</td></tr>"; } print "<th>[b]Personal:[/b]</th> <tr><td>[url='preferences.php']Preferences[/url]</td></tr> <tr><td>[url='preport.php']Player Report[/url]</td></tr> <tr><td>[url='breport.php']Bug Report<font color='red'><blink>(new)</blink>[/url]</td></tr> <tr><td>[url='helptutorial.php']Help Tutorial[/url]</td></tr> <tr><td>[url='gamerules.php']Game Rules[/url]</td></tr> <tr><td>[url='viewuser.php?u={$ir[']My Profile[/url]</td></tr> <tr><td>[url='logout.php']Logout[/url]</td></tr> </table>"; } ?> 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.