thebobby Posted November 15, 2014 Posted November 15, 2014 $checkjail = mysql_query("SELECT jail FROM `grpgusers` WHERE `jail` > '0'"); $nummsgs = mysql_num_rows($checkjail); $jail = "[".$nummsgs."]"; if (mysql_num_rows($checkjail) != 0){ $jail = "[".$nummsgs."]"; }This is in html section <?= ($jail >= 1) ? ' "<----error is here $jail"<li><a href="jail.php"> <!_-jail-_!></a></li> ' : "" ?>this will not work for some reasonthis does <?= ($user_class->jail == 2) ? '<li><a href="city1.php"> <!_-cityname-_!></a></li> ' : "" ?>but i want to pull from jail table which $jail does Quote
Script47 Posted November 15, 2014 Posted November 15, 2014 (edited) What is the actual error, and please format your code so we can actually read it. Until the code is formatted all I can suggest is that you make sure the server allows short tags. Edited November 15, 2014 by Script47 Quote
DAMINK Posted November 15, 2014 Posted November 15, 2014 $checkjail = mysql_query("SELECT * FROM `grpgusers` WHERE `jail`!='0'"); $nummsgs = mysql_num_rows($checkjail); $jail = "[".$nummsgs."]"; Then <!_-jail-_!> Unless im missing something. Quote
Script47 Posted November 15, 2014 Posted November 15, 2014 $checkjail = mysql_query("SELECT * FROM `grpgusers` WHERE `jail`!='0'"); $nummsgs = mysql_num_rows($checkjail); $jail = "[".$nummsgs."]"; Then <!_-jail-_!> Unless im missing something. How did you manage to get that code from his code? :O You're missing the full if() statement part and the short tag part. Quote
DAMINK Posted November 15, 2014 Posted November 15, 2014 How did you manage to get that code from his code? :O Grabbed a snippet of code from my grpg engine. Quote
Script47 Posted November 15, 2014 Posted November 15, 2014 Grabbed a snippet of code from my grpg engine. Ah, well you're missing some part of it. Quote
DAMINK Posted November 15, 2014 Posted November 15, 2014 Ah, well you're missing some part of it. Yea but my game is a little different. I just grabbed the main bits i felt relevant. if ($user_class->jail > 0){ echo "You are in jail for " . floor($user_class->jail / 60) . " more minutes."; } I dont show this like the default does so did not show it. Normally this is in the header somewhere if thats what your talking about. Quote
Script47 Posted November 15, 2014 Posted November 15, 2014 Yea but my game is a little different. I just grabbed the main bits i felt relevant. if ($user_class->jail > 0){ echo "You are in jail for " . floor($user_class->jail / 60) . " more minutes."; } I dont show this like the default does so did not show it. Normally this is in the header somewhere if thats what your talking about. Never used GRPG so I wouldn't know, but thanks for clearing that up. Quote
Zettieee Posted November 15, 2014 Posted November 15, 2014 Your missinf the park in the header aswell (maybe) Quote
DAMINK Posted November 16, 2014 Posted November 16, 2014 Your missinf the park in the header aswell (maybe) No no.... I got head in the park........ oh wait.... what? Quote
Sim Posted November 16, 2014 Posted November 16, 2014 what you need from the jail? if ($user_class->jail > 0){ $user_class->jail looks like it is how many minutes he/she is in jail for. Quote
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.