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>";
?>

Link to comment
Share on other sites

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;

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.