ilikephp Posted January 23, 2011 Share Posted January 23, 2011 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>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/225432-drop-down-list-not-displaying-info-online-only-on-localhost/ Share on other sites More sharing options...
atrum Posted January 24, 2011 Share Posted January 24, 2011 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; Quote Link to comment https://forums.phpfreaks.com/topic/225432-drop-down-list-not-displaying-info-online-only-on-localhost/#findComment-1164212 Share on other sites More sharing options...
ilikephp Posted January 24, 2011 Author Share Posted January 24, 2011 Now it is fixed, the problem was fixed by adding the connection again in the field that brings the data from mysql Quote Link to comment https://forums.phpfreaks.com/topic/225432-drop-down-list-not-displaying-info-online-only-on-localhost/#findComment-1164275 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.