Now I seem to be getting this error. I am not too sure if this error is stemming from my query.
Parse error: parse error, unexpected T_PRINT, expecting T_WHILE in C:\Inetpub\wwwroot\itlab\html\ComputerSearchResults.php on line 33
Basically, I want to search the table resourcescheduling to see if a computer in a particular lab is booked or not.
My field names are Computer_ID, Lab_ID
Also I am not too sure if i put the if statement brackets in the right place
<?
$db = mysql_connect("localhost", "admin", "");
mysql_select_db("itlab", $db);
if ($ComputerName == "")
{$ComputerName = '%';}
if ($LabName == "")
{$LabName = '%';}
// $user and $passwd are the two column names I used. Change this to fit your database
$result = mysql_query ("SELECT * FROM resourcescheduling
WHERE Computer_ID LIKE '%$ComputerName%'
AND Lab_ID LIKE '%$LabName%
AND Schedule_Start_Date >='08/25/2003' and Schedule_End_Date <='08/31/2003' AND Confirmed = 'Reserved' ORDER BY Schedule_Start_Date");
if ($row = mysql_fetch_array($result)) {
do
PRINT "<b>Computer Name: </b> ";
print $row["Computer_ID"];
print (" ");
print ("<br>");
PRINT "<b>Lab Name: </b> ";
print $row["Lab_ID"];
print ("<p>");
PRINT "<b>Start Date: </b> ";
print $row["Schedule_Start_Date"];
print ("<p>");
PRINT "<b>End Date: </b> ";
print $row["Schedule_End_Date"];
print ("<p>");
} while($row = mysql_fetch_array($result));
} else {print "Sorry, no records were found!";}
}
?>