-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Daevid --
...and then Daevid Vincent said...
%
% > You mentioned a
% > echo "".$sql."";
% > in your first post; what do you see?
%
% I see exactly what I expected to see. Basically the contents of a db.sql
% file read in that looks like this rough
You cannot execute several SQL statements within a single query.
You are trying to reinvent 'mysql' client batch processing; if you want
to do that, you have to write an SQL parser in PHP that split
your input in independant SQL statements and execute them one by one :(
Daevid Vincent wrote:
>>Yo
> You mentioned a
> echo "".$sql."";
> in your first post; what do you see?
I see exactly what I expected to see. Basically the contents of a db.sql
file read in that looks like this roughly:
CREATE TABLE table1 (
blah int(10),
foo char(5)
);
CREATE TABLE table2 (
blee int(10),
fee
day, December 17, 2002 2:47 AM
>>To: [EMAIL PROTECTED]
>>Subject: Re: How can I duplicate a mysql template database? [hack]
>>
>>
>>Hi,
>>
>>There is an easier way to duplicate a database; from the comand
>>line, you can run:
>>
>>mysqladmin
IL PROTECTED]
> Subject: Re: How can I duplicate a mysql template database? [hack]
>
>
> Hi,
>
> There is an easier way to duplicate a database; from the comand
> line, you can run:
>
> mysqladmin create db2
> mysqldump db1 | mysql db2
>
> If you want to duplicate
ql_fetch_row($tableResult))
> {
> $tsql = "CREATE TABLE ".$V2DB.".".$row[0]." AS SELECT * FROM
> V2_Template.".$row[0];
> echo $tsql."\n";
> $tresult = mysql_query($tsql,$linkI);
> if (!$tresult) $errorstring .= "E
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Daevid --
...and then Daevid Vincent said...
%
% Thanks for the reply Bill, however this did not solve the problem. I
% still receive the same error with your method as well.
%
% 1064: You have an error in your SQL syntax near ';
% CREATE TABLE Depa
".$V2DB.".".$row[0]." table\n".mysql_errno($linkI).":
".mysql_error($linkI)."\n";
}
> -Original Message-
> From: Daevid Vincent [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, December 17, 2002 1:16 AM
> To: [EMAIL PROTECTED]
> Cc:
Thanks for the reply Bill, however this did not solve the problem. I
still receive the same error with your method as well.
1064: You have an error in your SQL syntax near ';
CREATE TABLE Departments (
DeptID int(10) unsigned NOT NULL auto_increment,' at line 4
> Are you first creating a new da
Are you first creating a new database first with mysql_create_db()
before trying to run your schema? What error message do you get? The
code you've posted is only creating a table.
Also, rather than opening and reading in an external file or doing all
those $sql .= lines, you might have an eas
10 matches
Mail list logo