Jump to content

My PHP Search Results Page Pulls Inconsitant MySQL Data Displayed!!!!


marlboro_me

Recommended Posts

Ok, this one is really confusing me...

 

I have a PHP search page created with different filters and search field options. (First Name, Last Name, Drop-down Filter, etc.)

 

What's happening is on some search results the page will display the record sets correctly from MySQL. (Short record results of less than 10 or refined by further filter options)  But when you do a search for "Last Name" or larger open "filter options" it seems like it loses the connection to the database and displays no results.

 

If users continually hit the search form button the database will eventually pull up the results. (30+ records) After clicking it again the results will go away.

 

I was originally thinking it was the error 2003 (10061) error for not connecting to MySQL but I know it does since it pulls data on more refined search options.

 

Has anyone experienced or know where to point me in the right direction for a solution?

 

I'll post code later but wanted to hear from the guru's first.

 

My feeling is it's not the code but something with losing the data packets with MySQL or the connection.  But if that's the case, how could users press the search button multiple times (2-3) and display results??

 

Any help would be great!

 

Link to comment
Share on other sites

The mysql server is likely having problems. Your code should be checking all mysql function calls for an error or success, output a useful message to the visitor on an error (such as cannot complete the requested action), log all possible information about the error to the log file (such as the mysql_error() information) and then exit/die to prevent further problems.

 

Find out if the problem is with connecting to the mysql server or if there are errors occurring when queries are made. It is possible that the form data is not being put into the query correctly and is causing sql syntax errors.

 

Posting your code would help find if some of these type of problems are present in the code.

Link to comment
Share on other sites

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.