Solved

MySQL returns wrong results!

Posted on 2007-12-04
9
236 Views
Last Modified: 2013-12-12
I have a search and results page.  When I call the page in Firefox browser and enter a surname it returns the correct results. However, when I call the page in MS Internet Explorer it doesn't return my search term but returns all enteries in my MySQL database unsorted.  Does it have something to do with the differing urls as noted below and how they are translated by the browsers?

I noticed that Firefox the url string is:  

http://www.postcardsleuth.com/Postcards2/Postcards_Results.php?S_Surname=Coons&Search_x=0&Search_y=0&Search=Search

In Internet Explorer the url string appears as:

http://www.postcardsleuth.com/Postcards2/Postcards_Results.php?S_Surname=Coons
0
Comment
Question by:geist62
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 28

Expert Comment

by:gamebits
Comment Utility
It has to be since you are doing an incomplete query.
0
 
LVL 21

Expert Comment

by:nizsmo
Comment Utility
hi geist62,

in my FF and IE6 both searches results in the same URL and works without problems?
0
 

Author Comment

by:geist62
Comment Utility
Any ideas why Internet Explorer would truncate the url?
0
 
LVL 28

Expert Comment

by:gamebits
Comment Utility
Do you have any space in the url?
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 25

Accepted Solution

by:
imitchie earned 250 total points
Comment Utility
That has to do with the way Firefox and IE differ when passing information from IMAGE form tags used for POST.
Firefox in this case (the version you have) is populating Button.X and Button.Y (position within button clicked) and Search=Search (the image/button clicked to cause the post).  IE does a default post action without any of these additional info
0
 

Author Comment

by:geist62
Comment Utility
If this is a problems any idea how to fix it?  The odd thing is that somes Internet Explorer will consistantly return the correct results (with the full url) and then revert to returning the wrong results (partially formed url). Urggggh!
0
 
LVL 25

Expert Comment

by:imitchie
Comment Utility
It all depends on your javascript interaction. Hard to comment without seeing full code.  But I'm not into that, maybe someone can pick up from there.
0
 
LVL 29

Assisted Solution

by:fibo
fibo earned 250 total points
Comment Utility
You might test the effect of assigning a value of "search" to the search button, so that you force the value to be passed on
0
 

Author Comment

by:geist62
Comment Utility
Turns out the following code was the culprit:

Line 61 is:
if ((isset($_GET["Search_x"]) && $_GET["Search_x"] != "")) {

Code should be:
 
if ((isset($_GET["S_Surname"]) && $_GET["S_Surname"] != "")) {

0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

I had to do a bit of research to find the answer to this question so I thought I'd share my results.  Due to our outdated mainframe systems, we need to downgrade IE9 to IE8 in order to stay compatible.  We also needed to downgrade Java.  In order to…
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now