Jump to content

drop down list not displaying info online only on localhost


ilikephp

Recommended Posts

Hi, I am using this code to display the info in mysql database to dropdown list, it is working good on the localhost, when I upload everything the form is still working fine, but the drop down list are not displaying anything!!

What could be the problem?

 

* I did upload all the tables also

 

<?php
$query="SELECT ID, nationality FROM nationalities";
$result = mysql_query ($query);

echo "<select name=first_nationality_father value=''></option>";
echo "<option value=''>-- Choose one --</option>";
while($nt=mysql_fetch_array($result)){
echo "<option value=$nt[nationality]>$nt[nationality]</option>";
}
echo "</select>";
?>

Well do you have a copy of your database on your server?

 

EDIT: nevermind just saw your *.

 

Any way what I would do is first turn errors on.

 

Second see what your query is actually giving you.

 

$numrows = mysql_num_rows($result);
echo $numrows;

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.