I am setting up a test query.
This is my code:
<?php
$dbh=mysql_connect ("localhost", "user", "pass")
or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("user_events");
$query = "SELECT * FROM events_yxh";
$result = mysql_query($query);
if ($result) {
while ($array= mysql_fetch_assoc($result)) {
print "$array[event_title]";
}
} else {
print "<li>No results.</li>";
}
?>
Now I connect to the db fine, but my query doesn't work. I keep getting No results. I have a table called events_yxh and it has two test records in it. It has to be something simple I am missing, but I can't figure it out. I know you guys will see it right away and I thank you for your help.
Shout out to batman for all his help in a different thread.