I am having trouble with my script. I know that the database has two rows and it is not outputting. I don't think I'm getting an data for my query. Maybe I am doing something wrong. I trying to output contents. Maybe another pair of eyes would help?
<?php
$host = "blah. Com";
$database = "blah";
$user = "blah";
$password = "blah";
$con =mysqli_connect($host,$user,$password,$database);
if(!$con)
{
echo "Could not connect: " . $database;
}
$sql = "SELECT * FROM CreditCards";
$result = mysqli_query($con,$sql);
echo "<select name=\"word\">";
while($ary = mysql_fetch_array($result))
{
echo "<option value=\"" . $ary[cc_id] . "\">" . $ary[type] . "-" . $ary[last_four] . "</option>";
}
echo "</select>";
mysqli_close($con);
?>
Sorry in advance about the formatting. I on my mobile device...