I have a php site. It's for a local intranet so I can't give the site out. The entire site is database driven with mySQL.
We started having some weird problems due to a virus, so I recently Reinstalled the apache server and php 4.2.2. I did it NOT as a module but as aaaaa...... whatever the other way to do it is.
My scripts seemed to be working fine for a little while. There wasn't much extensive use on them for that time so I'm sure no one would have really noticed if anything was wrong. However, we were ready to get back into the swing of things and nothing works.
It seems that I can't connect to the mySQL database
here's part of a script....
<?
$mysql_link = mysql_connect("localhost", "username", "password")
or die
("<p>Could not connect to the database!");
mysql_select_db("mydatabase", $mysql_link)
or die
("<p>Could not open the database!");
?>
if($submit)
{
if($selectWhat == 'all')
{
$query = "select * from products";
$mysql_result = mysql_query($query, $mysql_link);
print("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
// Top Border
print("<tr><td style = \"border-bottom: 2 solid #000000\" align=\"center\"><b>Item #</b></td><td style = \"border-bottom: 2 solid #000000\" align=\"center\"><b>Asst</b></td><td style = \"border-bottom: 2 solid #000000\" align=\"center\"><b>Description</b></td><td style = \"border-bottom: 2 solid #000000\" align=\"center\"><b>S. Price</b></td><td style = \"border-bottom: 2 solid #000000\" align=\"center\"><b>C. Price</b></td><td style = \"border-bottom: 2 solid #000000\" align=\"center\"><b>Pack</b></td><td style = \"border-bottom: 2 solid #000000\" align=\"center\"><b>Code</b></td><td style = \"border-bottom: 2 solid #000000\" align=\"center\"><b>Truck?</b></td><td style = \"border-bottom: 2 solid #000000\" align=\"center\"><b>O. Price</b></td><td style = \"border-bottom: 2 solid #000000\" align=\"center\"><b>AP</b></td></tr>");
// End Top Border
This is the receiving end of the script. It queries the database depending on input
I went to the php.ini file and turned error = on
and this is what I got:
Warning: Supplied argument is not a valid MySQL result resource in c:\program files\apache group\apache\htdocs\listwhat.triple on line 176
I've also been getting error like:
Warning: Undefined variable: YES in c:\program files\apache group\apache\htdocs\productsDeleteAdmin.triple on line 2
What the heck is going on???