Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert SQL to MySQL statement?

Status
Not open for further replies.

Quintios

Technical User
Mar 7, 2002
482
US
I need to convert this MS Access generated SQL statement into something MySQL likes:

Code:
SELECT 'phpbb_forums.forum_id', 'phpbb_posts_text.post_text'
FROM ('phpbb_forums' 
INNER JOIN 'phpbb_posts' ON 'phpbb_forums.forum_id' = 'phpbb_posts.forum_id') 
INNER JOIN 'phpbb_posts_text' ON 'phpbb_posts.post_id' = 'phpbb_posts_text.post_id'
WHERE ((('phpbb_forums.forum_id')=10));

It gives me this error:
Code:
You have an error in your SQL syntax near ''phpbb_forums' INNER JOIN 'phpbb_posts' ON 'phpbb_forums.forum_id' = 'phpbb_post' at line 1

I don't know what the error is... I am entering this statement into phpmyadmin.

Thanks in advance for your help! Onwards,

Q-
 
Never mind. I got it to work by taking out all the quote marks:

Code:
SELECT phpbb_forums.forum_id, phpbb_posts_text.post_text
FROM (phpbb_forums INNER JOIN phpbb_posts ON phpbb_forums.forum_id = phpbb_posts.forum_id) INNER JOIN phpbb_posts_text ON phpbb_posts.post_id = phpbb_posts_text.post_id
WHERE (((phpbb_forums.forum_id)="10"));

:) Onwards,

Q-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top