Re: Strange MySQL Query Problem

From: Date: Thu, 04 Jul 2002 21:49:58 +0000
Subject: Re: Strange MySQL Query Problem
Groups: php.general 
Request: Send a blank email to php-general+get-105522@lists.php.net to get a copy of this message
>I already got some replies for this but it wasn't it, here is the problem: > >I have a simple form which queries the database based on 2 pop-up menu >choices and keywords entered by the user, >it passes on the variables as follows: > >pop-up1=choice1, pop-up2=choice2, textfield=user specified data > >the query is as follows > > >it tells me that column which equals to the $texfield does not exists, >meaning that the query seems to be fed wrong? No idea here, $texfield and >$pop-up2 are not requests for tables but matches in those tables Probably you have '' inside of $textfield ... You *STILL* need to do this if you want to figure this out in less than 3 days: $query = "SELECT some_id, some_description, some_feature FROM '$pop-up1' WHERE some_description LIKE '%$texfield%' AND some_feature LIKE '%$pop-up2'"; echo $query, "<BR>\n"; $result = mysql_query($query); -- Like Music? http://l-i-e.com/artists.htm

« previous php.general (#105522) next »