jigsawsoul Posted January 24, 2010 Share Posted January 24, 2010 I have this error but can't seem why. everything looks just fine to me. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE web_roles.staff_id=web_staff.staff_id LEFT JOIN web_login WHERE web_s' at line 2 $query = "INSERT INTO web_roles (occurrence_id, staff_id, role) VALUES ('$occurrenceid', '$chairperson', 'Chairperson')"; if (mysql_query ($query)) { $result = "SELECT * FROM web_roles LEFT JOIN web_staff WHERE web_roles.staff_id=web_staff.staff_id LEFT JOIN web_login WHERE web_staff.login_id=web_login.login_id WHERE web_roles.occurrence_id = '$occurrenceid' AND web_roles.staff_id = '$chairperson'"; $result = mysql_query ($result) or die (mysql_error()); $row = mysql_fetch_assoc($result); $email = $row['email']; $subject = "Meeting System, Appointed Chairperson Notification" ; $message = "You have been appointed as the chairperson for a meeting, please login and perform the required steps"; mail("$email", "Subject: $subject", $message, "From: noreply@meeting.com" ); } else { $_SESSION['message'] = " <div class='notification error png_bg'> <a href='#' class='close'><img src='http://stuweb.cms.gre.ac.uk/~hr728/_web/_resources/images/icons/cross_grey_small.png' title='Close this notification' alt='close' /></a> <div> Error. please can't admin </div> </div>"; header('Location: list.php'); } Quote Link to comment Share on other sites More sharing options...
jl5501 Posted January 24, 2010 Share Posted January 24, 2010 you cant have WHERE in your query more than once. the two in the JOINs should be ON Quote Link to comment Share on other sites More sharing options...
jigsawsoul Posted January 24, 2010 Author Share Posted January 24, 2010 your such a gangsta dude Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.