I am stuck to this forum like glue
New question. How might I get the auto_increment_id of the previous insert operation I made. I tried using mysql_insert_id() but it's returning zero (0).
In business_logic.php:
[pre]
$sql = "INSERT INTO mytable ('name') VALUES ('vinny')";
$result = execute_db($sql, $conn);
echo "ID of last inserted record is: " . mysql_insert_id();
[/pre]
Output:
[pre]
ID of last inserted record is: 0
[/pre]
New question. How might I get the auto_increment_id of the previous insert operation I made. I tried using mysql_insert_id() but it's returning zero (0).
In business_logic.php:
[pre]
$sql = "INSERT INTO mytable ('name') VALUES ('vinny')";
$result = execute_db($sql, $conn);
echo "ID of last inserted record is: " . mysql_insert_id();
[/pre]
Output:
[pre]
ID of last inserted record is: 0
[/pre]