dflow Posted December 15, 2009 Share Posted December 15, 2009 im switching a dropdown why is CountryName not echoing?i get an empty list <?php require_once('Connections/tests.php'); ?> <?php $CatID=intval($_GET['country']); echo $CatID; ?> <?php mysql_query("SET NAMES 'utf8'")?> <?php $dbconnection = mysql_connect ("localhost", "root", "") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ("international", $dbconnection) or die("Couldn't open database: ".mysql_error()); if (isset($CatID)) { echo "This var is set so I will print."; } switch ($CatID) { case 1: $result = mysql_query("SELECT country_list.CountryName,country_list.CountryName_heb from country_list WHERE CategoryID = '".$_GET['CatID']."'"); break; case 2: $result = mysql_query("SELECT country_list.CountryName,country_list.CountryName_heb from country_list WHERE CatID2 = '".$_GET['CatID']."'"); break; case 3: $result = mysql_query("SELECT country_list.CountryName,country_list.CountryName_heb from country_list WHERE CatID3 = '".$_GET['CatID']."'"); break; case 4: $result = mysql_query("SELECT country_list.CountryName,country_list.CountryName_heb from country_list WHERE CatID4 = '".$_GET['CatID']."'"); break; case 5: $result = mysql_query("SELECT country_list.CountryName,country_list.CountryName_heb from country_list WHERE CatID5 = '".$_GET['CatID']."'"); break; } ?> <select name="state" onchange="getCity(<?php echo $CatID;?>,this.value)"> <option>Select State</option> <?php while($row=mysql_fetch_array($result)) { ?> <option value="<?php echo $CatID; ?>"><?php echo $row_result['CountryName']; ?></option> <?php } ?> </select> <?php mysql_free_result($result); ?> Link to comment https://forums.phpfreaks.com/topic/185216-not-echoing-value/ Share on other sites More sharing options...
Goafer Posted December 15, 2009 Share Posted December 15, 2009 <form> </form> Is this required? Link to comment https://forums.phpfreaks.com/topic/185216-not-echoing-value/#findComment-977743 Share on other sites More sharing options...
dflow Posted December 15, 2009 Author Share Posted December 15, 2009 <form> </form> Is this required? im not posting yet so it's not Link to comment https://forums.phpfreaks.com/topic/185216-not-echoing-value/#findComment-977748 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.