Hi all,
Please help...Why do I get "Query fail"? I put in a bogus password and I get "I cannot connect to the database". Is it safe to "assume" that when I use the correct password and I am connecting not getting the "cannot connect" msg that I am connecting OK?
Assuming, I am connecting OK I dont know why the Query Fails. Also, can I do a command like "show tables" to see that I am using the correct table name. Of course I know this is the name I used when I did Create Table.
I am stuck.
<html>
<body>
<?php
$db = mysql_connect("localhost", "sdhz_fred", "m3046" or die("I cannot connect to the database"
mysql_select_db("sdhz_bahgdad",$db);
$query = "select * from questions";
$result = mysql_query($query) or die("Query fail"
printf("The Question: %s<br>\n", mysql_result($result,0,"question");
?>
</body>
</html>
Please help...Why do I get "Query fail"? I put in a bogus password and I get "I cannot connect to the database". Is it safe to "assume" that when I use the correct password and I am connecting not getting the "cannot connect" msg that I am connecting OK?
Assuming, I am connecting OK I dont know why the Query Fails. Also, can I do a command like "show tables" to see that I am using the correct table name. Of course I know this is the name I used when I did Create Table.
I am stuck.
<html>
<body>
<?php
$db = mysql_connect("localhost", "sdhz_fred", "m3046" or die("I cannot connect to the database"
mysql_select_db("sdhz_bahgdad",$db);
$query = "select * from questions";
$result = mysql_query($query) or die("Query fail"
printf("The Question: %s<br>\n", mysql_result($result,0,"question");
?>
</body>
</html>