Jump to content

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


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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.