View Single Post
(#1 (permalink))
Old
jreynolds22 jreynolds22 is offline
Junior Member
jreynolds22 is on a distinguished road
 
Posts: 3
Join Date: Jun 2012
Default PHP Error Message - 07-09-2012, 11:54 PM

I'm creating a web page using php, but I continue to get the following error message: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource on line 37 when trying to open the page. Below is the code that I have. Any help is greatly appericated.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>

<head>
<title>Weekday PM Pullouts</title>
<link rel="stylesheet" type="text/css" href="../styles.css">
<link rel="stylesheet" type="text/css" href="../print.css" media="print">
<script script type="text/javascript" src="../functions.js"></script>
</head>

<body>

<h1 class="hidden">WEEKDAY PM PULL-OUTS</h1>

<div id="noprint" class="header" align="center">
<ul>
<li><a href="#" onclick="show_alert()">All</a></li>
<li><a href="#" onclick="show_alert()">Channel 1</a></li>
<li><a href="#" onclick="show_alert()">Channel 4</a></li>
<li><a href="javascript:window.print()">Print</a></li>
</ul>
</div>

<?php
$con = mysql_connect($localhost,$user,$password);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}

mysql_select_db("pullouts", $con);

$result = mysql_query ("SELECT * FROM pullouts WHERE pullouts.day='Weekday' AND pullouts.time > '12:00:00' AND pullouts.effective='2012/03/12' ORDER BY pullouts.time");

while($row = mysql_fetch_array($result))
{
echo $row['check'] . " " . $row['time'] . " - " . $row['details'] . " " . $row['day'] . " " . $row['channel'] . " " . $row['yard'] . " " . $row['effective'];
echo "<br />";
}
mysql_close($con);
?>

</body>
</html>
Reply With Quote
Sponsored Links