I Just signed up for hosting at hostmomster and then I uploaded my site, imported my db from the old site on yahoo, then changed all the info in my script to match my new password, db name, etc. After doing that I tried to view the page and all 3 scripts display the following errors.
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/teambrav/public_html/home.php on line 138
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/teambrav/public_html/home.php on line 164
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/teambrav/public_html/home.php on line 183
Bill from tech support said to me "you are declaring a argument for a mysql query. the argument is $result for some reason it does not apper to be properly declared"
If he is correct how do I fix it? The exact same script works perfectly on our test site that I host at Yahoo so I am confused and I am really new to php and mysql.
http://teambraves.org/home.php is where you can see the page for yourself.
all 3 are identical but take data from different tables
And here is the code:
<?php
mysql_connect("localhost","dbname","dbpass");
mysql_select_db("dbname");
$query ="SELECT newstitle, newsbody, newssub, postby,";
$query.=" DATE_FORMAT(postdate, '%M %d, %Y') AS date";
$query.=" FROM news ORDER BY postdate DESC LIMIT 9";
$result=mysql_query($query);
while (list($newstitle,$newsbody,$newssub,$postby,$postdate,) =
mysql_fetch_row($result)) {
echo "<dt><b><h1>$newstitle </h1></b></dt>";
echo "<dd><b><h2>$newssub </h2></b></dd>";
echo "<dd><h4><b>Posted By: $postby;($postdate)</b></h4></dd>";
echo "<dd> </dd>";
echo "<dd>$newsbody</dd>";
}
?>
Thanks for the help in advance.