Thanks for all the advice, I thought it might have something to do
with being a reserved word.  I changed the table name from group to grps,
and everything works fine now.

-----Original Message-----
From: Rob Bryant [mailto:[EMAIL PROTECTED]
Sent: Monday, March 10, 2003 11:39 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Query Help...


----- Original Message -----
From: "NIPP, SCOTT V (SBCSI)" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 10, 2003 9:23 AM
Subject: [PHP-DB] Query Help...


> I am having a lot of trouble with a query that works fine from a
> basic SQL command line, but fails in my web script.  Here is the
portion of
> code including the query:
>
> mysql_select_db($database, $Prod);
> $query_groups = "SELECT name FROM group";
> $groups = mysql_query($query_groups, $Prod) or die(mysql_error());
>
> Here is the error I am receiving:
>
> You have an error in your SQL syntax near '"group"' at line 1
>

Have you tried using backticks in your query? E.g.,

$query_groups = "SELECT name FROM `group`";

--
rob


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to