I am a real newbis here so this may be a simple question, but...
I am trying to connect to my DB and query it, outputting the results. I believe I am connecting because it is throwing no errors. For the same reason I believe my query is working.
However, I can not seem to print the results. Here is what I have...
<?php
// Set the database access information as constants.
DEFINE ('DB_USER', '######');
DEFINE ('DB_PASSWORD', '######');
DEFINE ('DB_HOST', '######');
DEFINE ('DB_NAME', '########');
// Make the connnection and then select the database.
$dbc = @mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) OR die ('Could not connect to MySQL: ' . mysql_error() );
mysql_select_db (DB_NAME) OR die ('Could not select the database: ' . mysql_error() );
$sql = "select * from forum";
$q = mysql_query($sql) OR die("Query Error: ".mysql_error());
echo $q;
?>
obviously i am not posting the db connection values.
Thanks in advance!