Ah, there is the issue.  You cannot issue 2 SQL queries in a single
mysql_query() call. You have to do them one at a time without the ;

-Rasmus

On Sun, 26 May 2002, Janet Valade wrote:

> Can't you do what you want to do without using two SQL statements?
>
> CREATE TABLE IF NOT EXISTS.
>
> Janet
>
>
> ----- Original Message -----
> From: "Dave Carrera" <[EMAIL PROTECTED]>
> To: "php List" <[EMAIL PROTECTED]>
> Sent: Sunday, May 26, 2002 8:01 AM
> Subject: [PHP-DB] db sql issue from var
>
>
> Hi All
>
> I have found the problem from my last post and need to know how to solve it.
>
> Example sql var:
>
> $sql =DROP TABLE IF EXISTS test; CREATE TABLE test .......";
>
> When i run the script i get
>
> Mysql error near ';' create table......
>
> So how do i run this command from my script to include the ; as part of the
> sql.
>
> phpmyadmin copes with this ok so it must be able to be done.
>
> Thanks for any help in advance
>
> Dave C
>
>
> --
> 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
>


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

Reply via email to