solved WHERE ... syntax
Posted 21 August 2006 - 04:31 AM
"SELECT news.newsID, news.authorID AS newsAuthor, news.topicID AS newsTopic, news.name AS newsName, news.abstract, " .
"news.fulltext, date.name AS date, topic.name AS topic, author.name AS author " .
"FROM news, date, topic, author " .
"WHERE newsAuthor = 1";
$result = mysql_query($query) or die('Error, query failed');
I get 'Error, query failed'
there is an entry that matches this but it shouldnt say that even if there isnt an entry
Thanks for any help you may offer!
Posted 21 August 2006 - 08:49 AM
$query = 'query here'; $result = mysql_query($query) or die($query."<br />\n".mysql_error());
Posted 21 August 2006 - 03:35 PM
SELECT `news.newsID`, `news.authorID`, `news.topicID`, `news.name`, `news.abstract`, `news.fulltext`, `date.name` FROM `news`, `date`
Unknown column 'news.newsID' in 'field list'
newsID is definatly a field in my news table
Posted 21 August 2006 - 03:42 PM
SHOW CREATE TABLE news
Posted 21 August 2006 - 03:59 PM
Posted 21 August 2006 - 04:06 PM
If the entire value is surrounded by backticks (`) then it's assumed to be a column name in that context. You can either remove the backticks or surround the table name and column name individually with backticks.
SELECT `news`.`id` FROM ...
Posted 21 August 2006 - 04:17 PM
Posted 21 August 2006 - 04:23 PM
MySQL server has gone away
Posted 21 August 2006 - 09:02 PM
and knowing is half the battle... GI JOE!
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users