Re: MySQL - Problem with multiple INSERTs?

From: Date: Tue, 06 Mar 2001 22:42:46 +0000
Subject: Re: MySQL - Problem with multiple INSERTs?
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-7155@lists.php.net to get a copy of this message
Try this changes: $con_id = mysql_connect("localhost", "myusername", "mypassword"); if($con_id){ mysql_db_query("DocCountry", "INSERT INTO projects (idCreator, name, comment) VALUES (0, 'sysmsg9.txt', 'Some file')"); mysql_db_query("DocCountry", "INSERT INTO files (idProject, name, comment) VALUES (0, 'sysmsg9.txt', 'Some file')"); } else echo("Connection failed"); -----Mensagem Original----- De: Chris <chris@ooc2000.com> Para: <php-db@lists.php.net> Enviada em: terça-feira, 6 de março de 2001 16:13 Assunto: Re: [PHP-DB] MySQL - Problem with multiple INSERTs? > I did change the id fields from TINYINT to INT (that was just a careless > error), and fixed something else. But I still have the same problems. The > new table schemas are below, along with the queries that don't work. > > I'd love for someone to reproduce the error. As a possible workaround, > everything seems to be fine when I prime the tables by adding a record; > they only seem to have a problem when the tables are empty. > > Thanks, > Chris > > > > mysql_connect("localhost", "myusername", "mypassword"); > mysql_db_query("DocCountry", "INSERT INTO projects (idCreator, name, > comment) VALUES (1, 'sysmsg9.txt', 'Some file')"); > mysql_db_query("DocCountry", "INSERT INTO files (idProject, name, comment) > VALUES (1, 'sysmsg9.txt', 'Some file')"); > > CREATE TABLE projects ( id int(11) NOT NULL auto_increment, timestamp > timestamp(14), idCreator int(11) DEFAULT '0' NOT NULL, name varchar(80) NOT > NULL, comment text NOT NULL, authLevel varchar(32) NOT NULL, PRIMARY KEY > (id) ); > > CREATE TABLE files ( id int(11) NOT NULL auto_increment, idProject int(11) > DEFAULT '0' NOT NULL, idCreator int(11) DEFAULT '0' NOT NULL, name > varchar(80) DEFAULT '0' NOT NULL, comment text NOT NULL, PRIMARY KEY (id) ); >

« previous php.db (#7155) next »