RE: Need help with MySQL....
[email protected] ("Ted Knudson")
| Newsgroups | php.general |
|---|---|
| Message-ID | <001a01bfc154$5bd591c0$11e1a03f@pentium> |
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:[email protected]] > Sent: Thursday, May 18, 2000 9:57 AM > To: [email protected] > 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 > [email protected] > > > >