I just want to check and see if a row exists where the $lectureName shows. If a row does exist with the $lectureName somewhere in it, I want the function to return "assigned" if not then it should return "available". Here's what I have. I'm fairly sure its a mess. Please help.
function checkLectureStatus($lectureName)
{
$con = connectvar();
mysql_select_db("mydatabase", $con);
$result = mysql_query("SELECT * FROM preditors_assigned WHERE lecture_name='$lectureName'");
while($row = mysql_fetch_array($result));
{
if (!$row[$lectureName] == $lectureName)
{
mysql_close($con);
return "Available";
}
else
{
mysql_close($con);
return "Assigned";
}
}
When I do this everything return available, even when it should return assigned.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…