Welcome to WebmasterWorld Guest from 54.147.20.131

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

MySQL LIKE code not working in safari browser

MySQL LIKE code not working in safari browser

     

AimyThomas

4:21 am on Sep 12, 2012 (gmt 0)



Hello,

I am looking for database

PHP Code:

SELECT * FROM table_name WHERE event LIKE '%" . $search . "%' OR date LIKE '%. $search . "%'

This works fine in Firefox and in IE, but when i try it in safari, it seems to pull up the right results but then straight away changes and gives me all the results from the table. I am sure it has soomething to do with the LIKE operator because when i tried

This script works fine in Firefox and in Chrom, but when i try it in safari browser, it seems to pull up the right results but then as the crow flies away changes and gives me all the results from the table.

I am sure it has something to do with the LIKE coad because when i tried

SELECT * FROM table_name WHERE date = (the date i was trying to search for)

Kindly provide me solutions

Thanks in advance

phranque

7:10 am on Sep 12, 2012 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



the database query occurs on your server, not in your browser.
therefore you should look for a safari-specific problem in in the document served, not in the query.

does your html document have a DTD specification?
have you validated the html?

lostdreamer

9:25 am on Sep 12, 2012 (gmt 0)

5+ Year Member



How are you giving the query the $search variable?

When you say that you first get the correct list, but in safari it will then refresh and show all rows, I'm thinking you're using javascript (ajax call?) or something?

If this is the case, it could very well be that it first gives the right $search variable, but than (for some reason) it does another call without the $search variable, thus returning all rows.

phranque

9:50 am on Sep 12, 2012 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



I'm thinking you're using javascript (ajax call?) or something?


not javascript.
from the OP:
PHP Code:

lostdreamer

10:51 am on Sep 12, 2012 (gmt 0)

5+ Year Member



@ phranque

Of course the QUERY is in php ;)
but as I said, this:

This script works fine in Firefox and in Chrom, but when i try it in safari browser, it seems to pull up the right results but then as the crow flies away changes and gives me all the results from the table.

leads me to believe there is some javascript involved in the frontend.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month