Hi Guys, hopefully a little help again.
The purpose of this learning script is to list the data in my database on the screen.
I am receiving the following error from the script below:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/content/d/e/e/dexxxxxx/html/phptest/newtest.php on line 14
[php]
<?php // Connects to xxxxxdata and looks for data in the table go-gators and displays contents $con = mysql_connect("XXXXXdata.db.XXXX794.hostedresource.com", "XXXXXdata", "XXXXXX"); mysql_select_db("xxxxxdata"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("xxxxxdata", $con); $table="go-gators"; $result = mysql_query("SELECT * FROM $table"); // $result2 = mysql_query($myQuery) or die($myQuery."".mysql_error()); while($row = mysql_fetch_array($result)) { echo $row['EmailName'] . " " . $row['Domain'] . " " . $row['CustName']; echo "
"; } mysql_close($con); ?>
[/php]
The data in the database is
EmailName Domain CustName ReservedDate
randy bbdawg Randy J 2012-10-12
yourname go-gators Randy J 2012-10-12
I creates this script almost from scratch, but I hit these little things I just can not locate answers for.
(I am thinking it might have something to do with the “-” in the domain go-gators (but this is just a guess))
I hope someone can help,
Thanks
Randy J