pure_skill_2000 Posted April 21, 2008 Share Posted April 21, 2008 How does this have a syntax error? poss relating to the mysql server version ?!? <?php $query = "SELECT * FROM LFA WHERE LFABrief LIKE ‘%".$keywords[$i]."%’"; " ORDER BY LFABrief"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/102057-syntax-error/ Share on other sites More sharing options...
DarkWater Posted April 21, 2008 Share Posted April 21, 2008 You ended the initialization statement and finished on the next line. O_O <?php $query = "SELECT * FROM LFA WHERE LFABrief LIKE ‘%".$keywords[$i]."%’ ORDER BY LFABrief"; ?> That should work. Quote Link to comment https://forums.phpfreaks.com/topic/102057-syntax-error/#findComment-522343 Share on other sites More sharing options...
dptr1988 Posted April 21, 2008 Share Posted April 21, 2008 Yes!!! Read about string contencation operators at http://us3.php.net/manual/en/language.operators.string.php Quote Link to comment https://forums.phpfreaks.com/topic/102057-syntax-error/#findComment-522347 Share on other sites More sharing options...
Fadion Posted April 21, 2008 Share Posted April 21, 2008 The concatenation has nothing to do. The query is ok and the second line is just ingored, but no triggering an error. The error must be caused from the smart quotes (`), which should be single quotes '. Quote Link to comment https://forums.phpfreaks.com/topic/102057-syntax-error/#findComment-522350 Share on other sites More sharing options...
DarkWater Posted April 21, 2008 Share Posted April 21, 2008 The concatenation has nothing to do. The query is ok and the second line is just ingored, but no triggering an error. The error must be caused from the smart quotes (`), which should be single quotes '. He's got a PHP syntax error. That's from PHP being confused about the random string with a semicolon on a random line. Yeah. >_> Quote Link to comment https://forums.phpfreaks.com/topic/102057-syntax-error/#findComment-522354 Share on other sites More sharing options...
pure_skill_2000 Posted April 21, 2008 Author Share Posted April 21, 2008 Thanks thats solved it, I didnt relise there was a diff in what I had used :s oops Quote Link to comment https://forums.phpfreaks.com/topic/102057-syntax-error/#findComment-522355 Share on other sites More sharing options...
DarkWater Posted April 21, 2008 Share Posted April 21, 2008 No problem. Quote Link to comment https://forums.phpfreaks.com/topic/102057-syntax-error/#findComment-522357 Share on other sites More sharing options...
Fadion Posted April 21, 2008 Share Posted April 21, 2008 The concatenation has nothing to do. The query is ok and the second line is just ingored, but no triggering an error. The error must be caused from the smart quotes (`), which should be single quotes '. He's got a PHP syntax error. That's from PHP being confused about the random string with a semicolon on a random line. Yeah. >_> mate try to write "your name"; and see if that triggers a syntax error. Im not talking in vain here. I knew it but i tried it to be sure. (),),),),) lol EDIT: pure_skill_2000 which suggestion solved the problem? lol Quote Link to comment https://forums.phpfreaks.com/topic/102057-syntax-error/#findComment-522362 Share on other sites More sharing options...
dptr1988 Posted April 21, 2008 Share Posted April 21, 2008 Your right! I'd never noticed that before! What where they ( the php designers ) thinking when they wrote the PHP interpretor to allow that???? Quote Link to comment https://forums.phpfreaks.com/topic/102057-syntax-error/#findComment-522367 Share on other sites More sharing options...
DarkWater Posted April 21, 2008 Share Posted April 21, 2008 The concatenation has nothing to do. The query is ok and the second line is just ingored, but no triggering an error. The error must be caused from the smart quotes (`), which should be single quotes '. He's got a PHP syntax error. That's from PHP being confused about the random string with a semicolon on a random line. Yeah. >_> mate try to write "your name"; and see if that triggers a syntax error. Im not talking in vain here. I knew it but i tried it to be sure. (),),),),) lol EDIT: pure_skill_2000 which suggestion solved the problem? lol That's really weird. O_O Why does that not set an error off? *Wonders* Quote Link to comment https://forums.phpfreaks.com/topic/102057-syntax-error/#findComment-522368 Share on other sites More sharing options...
Fadion Posted April 21, 2008 Share Posted April 21, 2008 No idea. Even if it is weird, what kind of error should that trigger, "String left orphan!"? lol Quote Link to comment https://forums.phpfreaks.com/topic/102057-syntax-error/#findComment-522376 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.