Jump to content

You have an error in your SQL syntax ??


jigsawsoul

Recommended Posts

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');
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.