dean7 Posted July 14, 2010 Share Posted July 14, 2010 Hi all, the other day I posted the same script up but with errors, but today ive removed them errors but some of the scirpt isnt working i blive. echo"<link href='regstyle.css' rel='stylesheet' type='text/css'><table width='400' border='0' align='center' cellpadding='2' cellspacing='0' class='table' bordercolor='black'><tr><td class='header'><center>Hit The Streets</td></tr>"; echo"<tr><td><center><b>"; $country = mysql_query("SELECT location FROM users WHERE username = '$username'") or die (mysql_error()); if ( $racer1 > $timenow ) { echo"You Must Wait $timer1 Seconds Before Racing Again"; } else { if ( $country == 'England' ) { echo"<a href='?race=chris'>Chris </a>"; } elseif ( $country == 'Japan' ) { echo"<a href='?race=jon'>Jon</a>"; } elseif ( $country == 'Colombia' ) { echo"<a href='?race=allen'>Allen</a>"; } elseif ( $country == 'Usa' ) { echo"<a href='?race=laura'>Laura</a>"; } elseif ( $country == 'South Africa' ) { echo"<a href='?race=ryu'>Ryu</a>"; } elseif ( $country == 'Mexico' ) { echo"<a href='?race=jess'>Jessica</a>"; } } echo"</td></tr></b><tr><td><center><b>"; That bit of the code wont show the names in the table. It shows the table layout but not the names in the table. Its not displaying any errors either. I carnt accually see nothing wrong with that bit of the script. can anyone see why its doing it? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/207709-not-displaying-part-of-script/ Share on other sites More sharing options...
trq Posted July 14, 2010 Share Posted July 14, 2010 You need to pass $country to mysql_fetch_assoc in order to actually get something usefull. $country is a result resource currently. Quote Link to comment https://forums.phpfreaks.com/topic/207709-not-displaying-part-of-script/#findComment-1085818 Share on other sites More sharing options...
TOA Posted July 14, 2010 Share Posted July 14, 2010 Thorpe is probably right, I didn't even notice that, but the first thing I noticed is that you aren't putting your connection into the query, which may or may not cause problems, depending on how things are set up. In your first if statement, I see that you need to look into concatenation. For example, instead of echo"You Must Wait $timer1 Seconds Before Racing Again"; it should be echo"You Must Wait". $timer1." Seconds Before Racing Again"; That will also cause things to not show up. And just my 2 cents, look into a switch statement whenever you have more than one elseif. Also, the errors may not be showing up becasue you don't have them enabled..look into that too. It helps in debugging Hope that helps Quote Link to comment https://forums.phpfreaks.com/topic/207709-not-displaying-part-of-script/#findComment-1085821 Share on other sites More sharing options...
Adam Posted July 14, 2010 Share Posted July 14, 2010 the first thing I noticed is that you aren't putting your connection into the query, which may or may not cause problems, depending on how things are set up. Generally provided there's been a MySQL connection, PHP will know to use that link identifier if none is specified. In your first if statement, I see that you need to look into concatenation. For example, instead of echo"You Must Wait $timer1 Seconds Before Racing Again"; it should be echo"You Must Wait". $timer1." Seconds Before Racing Again"; That will also cause things to not show up. Actually how he has has it is perfectly valid. Only using single quotes or referencing an array index would cause problems. Quote Link to comment https://forums.phpfreaks.com/topic/207709-not-displaying-part-of-script/#findComment-1085828 Share on other sites More sharing options...
TOA Posted July 14, 2010 Share Posted July 14, 2010 the first thing I noticed is that you aren't putting your connection into the query, which may or may not cause problems, depending on how things are set up. Generally provided there's been a MySQL connection, PHP will know to use that link identifier if none is specified. In your first if statement, I see that you need to look into concatenation. For example, instead of echo"You Must Wait $timer1 Seconds Before Racing Again"; it should be echo"You Must Wait". $timer1." Seconds Before Racing Again"; That will also cause things to not show up. Actually how he has has it is perfectly valid. Only using single quotes or referencing an array index would cause problems. Which is why I said it may or may not Quote Link to comment https://forums.phpfreaks.com/topic/207709-not-displaying-part-of-script/#findComment-1086002 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.