Search found 4 matches

by Marcos-N41
01.06.2008, 23:38
Forum: MySQL
Topic: How to Discover Next AutoIncrement Number
Replies: 7
Views: 1511

Thanks for help!! Finally it's working!!

ps: I removed the line ExecSQL and worked, i had not removed it before because i hadn't understand your first answer...
by Marcos-N41
01.06.2008, 23:20
Forum: MySQL
Topic: How to Discover Next AutoIncrement Number
Replies: 7
Views: 1511

i tryed this code: ZQuery1.FieldByName('NAME').AsString but a error message appears saying that field doesn't exists CODE: frmprincipal.ZID.SQL.add('SELECT last_insert_id() as IDfinal'); frmprincipal.ZID.Open; frmprincipal.ZID.ExecSQL; IDint:= frmprincipal.ZID.fieldbyname('IDfinal').AsInteger; Thanks
by Marcos-N41
01.06.2008, 21:31
Forum: MySQL
Topic: How to Discover Next AutoIncrement Number
Replies: 7
Views: 1511

How should i use the last_insert_id(), how do i put the result in a variable? i tryed this code: ZQuery1.FieldByName('NAME').AsString but a error message appears saying that field doesn't exists CODE: frmprincipal.ZID.SQL.add('SELECT last_insert_id() as IDfinal'); frmprincipal.ZID.Open; frmprincipal...
by Marcos-N41
01.06.2008, 05:45
Forum: MySQL
Topic: How to Discover Next AutoIncrement Number
Replies: 7
Views: 1511

How to Discover Next AutoIncrement Number

Hi, Sorry my english first of all, i'm brazilian and my english is very poor lol I Need discover what is the value of Auto Increment, i use this code in PHP: $sqlid = "SHOW TABLE STATUS LIKE \"pira_imob\""; $exeid = mysql_query($sqlid,$base)or die (mysql_error()); $arrid = mysql_...