RE: Need help with MySQL....

From: Date: Fri, 19 May 2000 05:37:45 +0000
Subject: RE: Need help with MySQL....
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-176@lists.php.net to get a copy of this message
One big difference between Windows and Unix is that Unix is case sensitive. That could be your problem. Ted Knudson http://www.automatedcabinets.com http://www.pulsarusa.com > -----Original Message----- > From: Scott S. Nicholson [mailto:scottn@pnx1.com] > Sent: Thursday, May 18, 2000 9:57 AM > To: php-general@lists.php.net > Subject: Need help with MySQL.... > > > I realize this isn't strictly PHP3, but... > > I developed a site with a PHP script to search a database for > keywords with > a certain field. On my local (Win32) box, it worked just fine, but when I > uploaded it to a Red Hat server, it doesn't work. > > To be more specific... The search form allows you to choose to find ANY or > ALL of the terms entered (OR or AND, basically). For an AND search, the > script creates a query along the lines of: > > SELECT * FROM artwork WHERE keywords LIKE '%car%' AND keywords LIKE > '%truck%'; > > I can enter this query in PHPMyAdmin on the Red Hat box, and it > returns the > expected results, but when my script runs it, it executes the > "die" portion > of "$result = mysql_query($query, $mysql_link) or die(...);" > > Any ideas on that? > > The other problem is an OR search, for which I have the script generate a > query along the lines of: > > SELECT *, IF (Keywords LIKE '%car%',1,0) 'car', IF (Keywords LIKE > '%truck%',1,0) 'truck' FROM artwork HAVING car>0 OR truck>0 ORDER BY > car > DESC, truck DESC, ImageID ASC; > > which, on my Win32 box, finds all records containing any terms and orders > them by relevance (ie records with multiple search terms are listed higher > than those with only one). > > This query doesn't work on the Red Hat box, whether in PHPMyAdmin or in my > script. > > Any ideas? > > TIA for the help. > > Scott Nicholson > scottn@pnx1.com > > > >

« previous php.general (#176) next »