Jump to content

[SOLVED] PHP MySQL problem


dt192

Recommended Posts

Hi ive got a MySQL table with values imported from XML, some of the data imported is blank, i am trying to perform a search on the data now that it is in the database and i want to be able to match cells with matching data and also have the option to match cells with no data:

 

"SELECT * FROM mytable WHERE something LIKE '%' AND (somethingelse BETWEEN 0 AND 1000) AND (thisthing='what i searched for' OR thisthing='') ORDER BY the_date DESC"

 

i have also tried

 

(thisthing='blabla' OR thisthing IS NULL)

(thisthing='blabla' || thisthing='')

 

i tried removing the brackets lol desperate measures, anywho please end my misery

Link to comment
https://forums.phpfreaks.com/topic/147357-solved-php-mysql-problem/
Share on other sites

Hi can some one please answer my question, I really want to get this script finished tonight and this problem is stopping me from finishing it in several ways lol

 

oh and something else i found out, once i pull the value from the database and use php to compare it, it does match to ''

 

so in summary SELECT * FROM mytable WHERE thisthing='' would result in 0 rows but if i pull thisthing and did if($rows['thisthing'] == ''){echo 'what the hell is going on';} it would

 

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.