Stumbled accross this nasty little error on a client’s installation of OsCommerce. The problem occurs when a new user is signing up, so this can be a real show stopper and cost sales!
Anyway thankfully I quickly found the solution and the fix is pretty quick and simple
catalog/includes/functions/database.php. Find the line relating to tep_db_insert_id and change it to:
function tep_db_insert_id( $link = 'db_link') {
global $$link;
return mysql_insert_id($$link);
}
By the looks of the solution, perhaps problem occurs because of a non persistant database connection, or other subsequent queries having run.
Jen says
You are talking about a problem that is over 2 years old and relates to database configurations more than osCommerce. And you found the solution on that post.
So why the blog post about it. It’s old news.
Mr Mackintosh says
Wow I didn’t realise it was 2 years old! Anyway it was a serious show stopper last to a clients store last week, so I think it’s helpful to publish the solution here, even if it’s published elsewhere aswell – the more publisised the solution the easier it will be to find especially for newbies who will invariably turn to google as their first port of call.
I think this comment from the forum above was what really encouraged me to post!
James says
I get that nasty error and I inserted this fix…it worked at first, but now I get the error again so I double checked the database.php file and the fix is still there…
any thoughts?