Re: SQL Quick problem
| From: | Scott Barron | Date: | Sat, 02 Dec 2000 23:25:31 +0000 |
| Subject: | Re: SQL Quick problem | ||
| References: | 1 2 3 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-4965@lists.php.net to get a copy of this message | ||
On Sat, Dec 02, 2000 at 09:12:15PM -0200, FXbio Ottolini wrote:
> The parentheses in this case is something related to my personal style.
> Working with double quotes works fine. What I believe that is wrong is that
> there is no ";" after the name of the table (clubs). As far as I know each
> and every MySQL statement must end with a ";", right? Ok, there are some
> excpetions. But in this casa it is mandatory to use the ";" at the end of
> the sentence. This tells MySQL to execute the statement. So if we forget
> about the parentheses the PHP should look like this:
>
> $query = "SELECT name, city FROM clubs;";
>
> Please correct if I am wrong.
>
> Best regards,
>
> Fábio Ottolini
>
>
The ending semicolon is not required when using PHP or the C API or really
anything other than mysql's interactive interpreter. The semicolon is a way
for the interactive interpreter to know that you are finished entering your
query and that it should process it. This makes no sense when using it from
a programming language because your entire query is given in the function
call. The problem, as stated earlier, is somewhere else, not the semicolon.
Further code will have to be given to determine where.
-Scott
--
-------------------------------------------------------------------------------
"That's a deer shooting hat."
"Like hell it is. This is a people shooting hat. I shoot people in this hat."