Labradoodle-360 Posted August 24, 2010 Share Posted August 24, 2010 Hey everybody! A simple query I am working on is throwing a syntax error out, and I can't seem to find anything wrong with it, I am obviously overlooking something. SELECT id, name FROM {db_prefix}mainmenu ORDER BY name WHERE is_top <> {int:true}', array( 'true' => 1, ) What am I overlooking? Quote Link to comment https://forums.phpfreaks.com/topic/211574-mysql-syntax-error/ Share on other sites More sharing options...
trq Posted August 24, 2010 Share Posted August 24, 2010 It looks like you've posted this query out of context. What is {db_prefix} ? what is array() ? what is {int:true} ? None of that is valid sql. Quote Link to comment https://forums.phpfreaks.com/topic/211574-mysql-syntax-error/#findComment-1102976 Share on other sites More sharing options...
Labradoodle-360 Posted August 24, 2010 Author Share Posted August 24, 2010 I take it that you are not familiar with how SMF works? And yes, that is a small part of the query, but the only part I need help with, and the part that's causing the error. Quote Link to comment https://forums.phpfreaks.com/topic/211574-mysql-syntax-error/#findComment-1102979 Share on other sites More sharing options...
trq Posted August 24, 2010 Share Posted August 24, 2010 Why would I be familiar with SMF? You might also mention that your using it instead of simply assuming people would be aware especially considering you posted in MySQL Help. Again I say it is invalid sql. Can we see your actual query, the query that actually gets sent to the database? Quote Link to comment https://forums.phpfreaks.com/topic/211574-mysql-syntax-error/#findComment-1102987 Share on other sites More sharing options...
PFMaBiSmAd Posted August 24, 2010 Share Posted August 24, 2010 What am I overlooking? A) Not bothering to tell someone that this is the SMF database abstraction layer and as such it is not directly a mysql question, B) Not bothering to post the actual syntax error, because that would help someone directly help you. C) Thinking that just because a syntax error is reported at that point in the query that it could not have actually been caused by something before that point. Quote Link to comment https://forums.phpfreaks.com/topic/211574-mysql-syntax-error/#findComment-1102990 Share on other sites More sharing options...
Labradoodle-360 Posted August 24, 2010 Author Share Posted August 24, 2010 First of all, I assumed you would be familiar with SMF, simply because this is an SMF forum. Secondly, I didn't specify that this was based on SMF code because it is a syntax error, not an error with the structure or a variable from SMF. So it's not directly related to SMF, it's related to the syntax. But, I do apologize for the misunderstanding. Why would I be familiar with SMF? You might also mention that your using it instead of simply assuming people would be aware especially considering you posted in MySQL Help. Again I say it is invalid sql. Can we see your actual query, the query that actually gets sent to the database? This reply, I feel was very rude and not very understanding or kind. And definitely a bad experience for coming to PHP Freaks. Regarding your response. A) I stated it was a syntax error, not an error with how SMF coded it, which is why I failed to mention this. B) The syntax error was inside those couple lines of query, which is why I posted them. However, the thing that bothered me most about this post was C) Thinking that just because a syntax error is reported at that point in the query that it could not have actually been caused by something before that point. That is quite an assumption, that isn't very nice. I knew it was in these couple lines because I made multiple tests to confirm this. It is also implying that I know nothing about how coding works, which I take as an insult. What am I overlooking? A) Not bothering to tell someone that this is the SMF database abstraction layer and as such it is not directly a mysql question, B) Not bothering to post the actual syntax error, because that would help someone directly help you. C) Thinking that just because a syntax error is reported at that point in the query that it could not have actually been caused by something before that point. Quote Link to comment https://forums.phpfreaks.com/topic/211574-mysql-syntax-error/#findComment-1103311 Share on other sites More sharing options...
Labradoodle-360 Posted August 24, 2010 Author Share Posted August 24, 2010 Anyhow, I have resolved this. Thank you guys for the posts Quote Link to comment https://forums.phpfreaks.com/topic/211574-mysql-syntax-error/#findComment-1103316 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.