10-06-2016, 05:46 AM
I agree that your code, Mudmin, is better because it doesn't try to get the $last_id if the insert was unsuccessful. But I've never heard of scope issues like this in PHP related to an if statement...
@GePraxa, when you say it wasn't working, what was not working? Is it possible your insert was failing and that was causing the problem?
@GePraxa, when you say it wasn't working, what was not working? Is it possible your insert was failing and that was causing the problem?