RE: [PHP-DB] Re: NEWBIE - Needs Assistance with Joins
| From: | Matthew Loff | Date: | Mon, 17 Sep 2001 19:12:55 +0000 |
| Subject: | RE: [PHP-DB] Re: NEWBIE - Needs Assistance with Joins | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-12517@lists.php.net to get a copy of this message | ||
There should -not- be a semicolon at the end of the SQL query when using
mysql_query() through PHP...
http://www.php.net/manual/en/function.mysql-query.php
The problem lies elsewhere.
-----Original Message-----
From: Vera Algoet [mailto:valgoet@monterey.k12.ca.us]
Sent: Monday, September 17, 2001 1:11 PM
To: php-db@lists.php.net; Cecily Walker Kidd
Subject: [PHP-DB] Re: NEWBIE - Needs Assistance with Joins
Cecily,
I'm sure you probably heard from others about your parse error. I know
it looks weird, but you need to have two semicolons, so instead of:
> $CDList =mysql_query(
> "SELECT artist_name, album_title ".
> "FROM artists, album_titles WHERE artist_id = aid");
you would have
$CDList =mysql_query(
"SELECT artist_name, album_title ".
"FROM artists, album_titles WHERE artist_id = aid;");
(Note the semicolon after "aid"). This is because the first one is to
complete the SQL statement, while the one after the parenthisis is to
complete the PHP statement.
Vera
-------------------------------------------------------------------
Madness takes its toll. Please have exact change.
Vera Algoet, Web Developer
Monterey County Office of Education
831-784-4169