Hello.
I'm having problems running an application in Media Temple: the
LAST_INSERT_ID() command always returns 0 from autoincremented id
tables, to both our application and to the phpMyAdmin console. Above,
you'll find a sample of what I've been trying to do unsuccesfully:
INSERT INTO `contacts`
(`contact_type_id`,`first_name`,`last_name`,`email`,`phone`,`website`,`message`,`created`)
VALUES (2,'Test','Test','t...@test.com','','','Lorem ipsum dolor sit
amet, consectetur adipiscing elit. ','2008-12-09 19:54:38')
= OK, 1 row inserted, checked in the table ande there is the new
value with an autogenerated id.
SELECT LAST_INSERT_ID() AS insertID
= 0 --- Wrong!
I wrote them to see if they had an idea of what was going on, and they
replied saying that I must be using separated connections and that I
should try running the queries together separated by semicolon, which,
of course, worked in phpMyAdmin, but, in cakePHP it doesn't make
sense.
I have a version of my CakePHP application running locally with MySQL
5.0 (Media Temple has 4.1, although that shouldn't matter, supposedly)
and it works fine. It seems then that, somehow, the DB is closing the
connection with the application after every single query in the same
request, which is just weird.
BTW, I'm using persistent connections and the mysql block in my php
config is just like theirs (I checked it via phpinfo()), except for
the version, but, again, it shouldn't matter.
Any ideas?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---