mysql-insert-id Questions

5

Solved

When I run the following code, I get the error saying Fatal error: Uncaught exception 'mysqli_sql_exception' with message 'No index used in query/prepared statement' $mysql = new mysqli(DB_...
Wastrel asked 7/4, 2011 at 11:3

2

Solved

Is there some equivalent to PHP mysql_insert_id to fetch the last inserted UUID() primary key? (I always get 0. It works for auto_inc integers though)
Adria asked 21/2, 2012 at 14:29

4

Solved

I've found a few answers for this using mySQL alone, but I was hoping someone could show me a way to get the ID of the last inserted or updated row of a mysql DB when using PHP to handle the insert...
Heterologous asked 14/4, 2010 at 0:34

4

Solved

I know there are a lot of topics with the same title. But mostly it's the query that's been inserted in the wrong place. But I think I placed it right. So the problem is, that I still get 0 even w...
Cate asked 23/11, 2011 at 14:4

1

Solved

I swear I have poured and poured over every other similar question on this site and others... but I think I'm just missing something. Hopefully someone can point out a silly mistake that my brain i...
Karleen asked 8/10, 2012 at 4:27

6

Solved

I always hear that using "lastInsertId" (or mysql_insert_id() if you're not using PDO) is evil. In case of triggers it obviously is, because it could return something that's totally not the last ID...
Gratt asked 14/11, 2008 at 12:19

2

Solved

Im wondering as to what the best solution is to get the last inserted ID after a mysql inquiry? I have found the following solutions : <?php function get_current_insert_id($table) { $q = "SE...
Voyeur asked 29/4, 2012 at 10:10

1

I have this table CREATE TABLE IF NOT EXISTS `t5` ( `id` int(11) NOT NULL auto_increment, `a` int(11) NOT NULL, `b` int(11) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `a` (`a`,`b`) ) ENGINE=I...
Mesothorium asked 9/12, 2011 at 8:32

1

Solved

This is for a sort of proof of concept draft to get things working, but don't want to have completely crap code. For my database, I tried to get true foreign key relations going using innoDB, but c...
Lucianaluciano asked 6/9, 2011 at 19:1

3

Solved

mysql_insert_id does not return the last inserted id when i place it inside a function. im kinda confused why it does not. here is my code: function addAlbum($artist,$album,$year,$genre) { $con...
Management asked 5/12, 2010 at 11:22

5

Solved

Background: I'm working on a system where the developers seem to be using a function which executes a MYSQL query like "SELECT MAX(id) AS id FROM TABLE" whenever they need to get the id of the LAST...
Scop asked 18/8, 2010 at 12:3
1

© 2022 - 2024 — McMap. All rights reserved.