Hi,
I'm trying to connect to 2 different tables for country and state in my form but they come up empty. I have checked spelling and it all looks right so here we go again with a possible query error, lol.
Here's what I have so far:
<?php
include("header.php");
/there is a check in the dbconnect file on the connection with the "die" code and failed to connect msg/
include("dbconnect.php");
?>
//first part of form left out to keep it short
<SELECT NAME="country">
<?php
$dblink=MYSQL_CONNECT($MySqlHostname, $MySqlUsername,
$MySqlPassword) OR DIE("Unable to connect to database");
@mysql_select_db("$MySqlDatabase") or die( "Unable to select
database");
?>
$sql="SELECT * FROM $countries ORDER BY country";
$result=mysql_query($sql,$dblink);
$num = mysql_num_rows($result);
$cur = 1;
echo "<ol>";
while ($num >= $cur) {
$row = mysql_fetch_array($result);
$country = $row["country"];
?>
<option><?php echo "$country" ?></option>
<?php
$cur++;
echo "</ol>";
?>
</SELECT>
<SELECT NAME="state">
<?php
$dblink=MYSQL_CONNECT($MySqlHostname, $MySqlUsername,
$MySqlPassword) OR DIE("Unable to connect to database");
@mysql_select_db("$MySqlDatabase") or die( "Unable to select
database");
?>
$sql="SELECT * FROM $states ORDER BY $state";
$result=mysql_query($sql,$dblink);
$num = mysql_num_rows($result);
$cur = 1;
echo "<ol>";
while ($num >= $cur) {
$row = mysql_fetch_array($result);
$state = $row["abbrev"];
?>
<option><?php echo "$state" ?></option>
<?php
$cur++;
echo "</ol>";
?>
</SELECT></P>
Any ideas? Thanks in advance, Barb
PS if you respond please please please use the same $variables I have used here so I don't get confused lol. A new one will be easier to spot. tytyty lol