Jump to content

Not displaying part of script


dean7

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.