Supplied argument is not a valid MySQL result resource
Posted: Sat Jul 06, 2002 12:01 pm
Hi Folks,
I am getting the abve error with this script.
Any Suggestions Why?
I am getting the abve error with this script.
Any Suggestions Why?
$db = mysql_connect($DBhost, $DBuser, $DBpass) or die("News=Uh Oh, Could not connect");
mysql_select_db("$DBName", $db);
$sql ='SELECT * FROM $table WHERE CompanyCode = "'.$CompanyCode.'"';
$result = mysql_query($sql);
$row = mysql_fetch_array($result); //error points to this line//
$Contact = $row["1"];
$Phone = $row["2"];
$reason = $row["3"];
$version = $row["4"];
$bill = $row["5"];
$comments = $row["6"];
echo 'Company Code ' .$CompanyCode."<br><br>\n";
echo 'Contact: '.$Contact."<br><br>\n";
echo 'Phone Number: '.$Phone."<br>\n";
echo 'Reason for upgrade request: '.$reason."<br>\n";
echo 'Version requested: '.$version."<br>\n";
echo 'Upgrade billable? '.$bill."<br><br>\n";
echo 'Comments: '.$comments."<br>\n";
?>