Replies To: ID generator not working

Re: ID generator not working

Posted 19 March 2013 - 03:32 AM

the problem is line #9. $sql2 is a string and when you add 1 the string is converted to 0, resulting in 1 (always).

despite the fact that one should always use the built-in AUTO_INCREMENT for an auto increment and that the mysql extension is deprecated and outdated and that you are wide open to SQL Injection, you would have to query and fetch your first SQL statement to get the number.