hoi Posted November 5, 2006 Share Posted November 5, 2006 Ermm, this is my errorYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'EXCEPT id = '1'' at line 1and my script:[code]$query = mysql_query ("SELECT * FROM `leden` WHERE email = '" . $_POST['email'] . "' EXCEPT id = '" . $_COOKIE['id'] . "' ") or die (mysql_error());[/code]mja, ive got a script, and their u can edit ur email, but i want to select all the emails from the clan EXCEPT for the id of the member itself, how do i do it? :( Link to comment https://forums.phpfreaks.com/topic/26251-error-need-help/ Share on other sites More sharing options...
almightyegg Posted November 5, 2006 Share Posted November 5, 2006 [code=php:0]$query = mysql_query ("SELECT * FROM `leden` WHERE email = '{$_POST['email']}' EXCEPT id = '{$_COOKIE['id']}' ") or die (mysql_error());[/code] that should work :) Link to comment https://forums.phpfreaks.com/topic/26251-error-need-help/#findComment-120063 Share on other sites More sharing options...
trq Posted November 5, 2006 Share Posted November 5, 2006 [code=php:0]$query = mysql_query("SELECT * FROM `leden` WHERE email = '" . $_POST['email'] . "' && id <> '" . $_COOKIE['id'] ."'") or die(mysql_error());[/code] Link to comment https://forums.phpfreaks.com/topic/26251-error-need-help/#findComment-120065 Share on other sites More sharing options...
CBStrauss Posted November 5, 2006 Share Posted November 5, 2006 hmmmm well you could try the != operator meaing if the user who looking for the email address is 1 then try Select all from table where id !=1. In theory that should work maybe someone will correct me if im wrong im not an expert, I still got alot to learn myself Link to comment https://forums.phpfreaks.com/topic/26251-error-need-help/#findComment-120066 Share on other sites More sharing options...
trq Posted November 5, 2006 Share Posted November 5, 2006 Yeah.. you can use either <> or !=There is no such thing as EXCEPT. Link to comment https://forums.phpfreaks.com/topic/26251-error-need-help/#findComment-120068 Share on other sites More sharing options...
hoi Posted November 6, 2006 Author Share Posted November 6, 2006 [quote author=thorpe link=topic=113930.msg463359#msg463359 date=1162759100][code=php:0]$query = mysql_query("SELECT * FROM `leden` WHERE email = '" . $_POST['email'] . "' && id <> '" . $_COOKIE['id'] ."'") or die(mysql_error());[/code][/quote]ty m8, it worked ;)[quote author=thorpe link=topic=113930.msg463362#msg463362 date=1162759495]Yeah.. you can use either <> or !=There is no such thing as EXCEPT.[/quote]lol, the except thing... i knew it was wrong, but with the word except, u guys would know what u mean, and give me the good answer ;) ty all Link to comment https://forums.phpfreaks.com/topic/26251-error-need-help/#findComment-120372 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.