On Sunday 12 August 2001 01:01, Bennett Haselton wrote:
> I've written a CGI script that runs a database query on a MySQL database (I
> know that's risky -- it's password-protected though, for what it's
> worth). (...)

It's a free world ;-)

> When I run the script with the first of these two lines commented out, and
> the second one uncommented:
>
> #my $sql_query = $q->param('sql_query');
> my $sql_query = "SELECT * FROM newssites_dynamicdata;";
                                                      ^
(rest of mail snipped)

Try leaving out the trailing semicolon from all queries.

Semicolons are only really useful when using the mysql client, where they 
signify the end of a statement (alternatively you can use \g). In DBI 
statements they will, more likely than not, cause errors. And as they aren't 
in any way necessary, save yourself the trouble they might cause...

HTH 

Ian Barwick

-- 
Ian Barwick - Developer - [EMAIL PROTECTED]
akademie.de asp GmbH - http://www.akademie.de

"To query tables in a MySQL database is more fun than eating spam"

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to