Jump to content

php code works and dose not work - confused? take a look!


gaogier

Recommended Posts

You have a peppering of require_once() statements opening connections to your database server. Since there is not a valid connection at the point where the mysql_query() is being executed, then it is likely that your code before that point on the page is closing the connection as well.

 

Either make a single connection at the beginning of your application and leave it open, or you will need to  remove the _once() part of the require_once() statement in that code. Repeatedly opening and closing the database connection on one page will always take more time then opening it once.

It means that you have probably included that file before, you only need to include it once so remove the re-declaration or encase the function in a function_exists if statement to prevent it from re-declaring itself.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.