[PHP-DB] Strange MySQL Query Problem

2002-07-03 Thread eat pasta type fasta

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

$result = mysql_query(SELECT some_id, some_description, some_feature 
FROM '$pop-up1' WHERE some_description LIKE '%$texfield%' AND 
some_feature LIKE '%$pop-up2');

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

a bit buffled I am, I've these queries before on larger web servers, this 
is the first time on my workstation and it does just that, simpler 
queries work fine...

thanks in advance,

R

ps. the form is guarded against empty entries
ps2. RedHat 7.3, Mysql 3.23.51, Apache 1.3+ wik PHP 4.2.1 configured for 
MySQL

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] Strange MySQL Query Problem

2002-07-03 Thread Martin Clifford

From your query, it looks as if you are letting the user select the table that they 
can query with $pop-up1.  Is that correct?

If so, do all the available choices of tables have the same column names?  Other than 
that I can't see why this query would fail.

Martin

 eat pasta type fasta [EMAIL PROTECTED] 07/03/02 04:27PM 
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

$result = mysql_query(SELECT some_id, some_description, some_feature 
FROM '$pop-up1' WHERE some_description LIKE '%$texfield%' AND 
some_feature LIKE '%$pop-up2');

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

a bit buffled I am, I've these queries before on larger web servers, this 
is the first time on my workstation and it does just that, simpler 
queries work fine...

thanks in advance,

R

ps. the form is guarded against empty entries
ps2. RedHat 7.3, Mysql 3.23.51, Apache 1.3+ wik PHP 4.2.1 configured for 
MySQL

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php 



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] Strange MySQL Query Problem

2002-07-03 Thread Jen Swofford

Could this be as simple as a typo?

textfield
texfield

Jen Swofford
[EMAIL PROTECTED]

 -Original Message-
 From: eat pasta type fasta [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, July 03, 2002 3:27 PM
 To: PHP LIST
 Subject: [PHP-DB] Strange MySQL Query Problem


 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

 $result = mysql_query(SELECT some_id, some_description, some_feature
 FROM '$pop-up1' WHERE some_description LIKE '%$texfield%' AND
 some_feature LIKE '%$pop-up2');

 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

 a bit buffled I am, I've these queries before on larger web servers, this
 is the first time on my workstation and it does just that, simpler
 queries work fine...

 thanks in advance,

 R

 ps. the form is guarded against empty entries
 ps2. RedHat 7.3, Mysql 3.23.51, Apache 1.3+ wik PHP 4.2.1 configured for
 MySQL

 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php






-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Strange MySQL Query Problem

2002-07-02 Thread eat pasta type fasta

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

$result = mysql_query(SELECT some_id, some_description, some_feature 
FROM '$pop-up1' WHERE some_description LIKE '%$texfield%' AND 
some_feature LIKE '%$pop-up2');

it tells me that column which equals to the $texfield does not exists,

a bit buffled I am, I've these queries before on larger web servers, this 
is the first time on my workstation and it does just that, simpler 
queries work fine...

thanks in advance,

R

ps. the form is guarded against empty entries
ps2. RedHat 7.3, Mysql 3.23.51, Apache 1.3+ wik PHP 4.2.1 configured for 
MySQL

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] Strange MySQL Query Problem

2002-07-02 Thread Jason Wong

On Wednesday 03 July 2002 12:42, eat pasta type fasta wrote:
 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

 $result = mysql_query(SELECT some_id, some_description, some_feature
 FROM '$pop-up1' WHERE some_description LIKE '%$texfield%' AND
 some_feature LIKE '%$pop-up2');

 it tells me that column which equals to the $texfield does not exists,

 a bit buffled I am, I've these queries before on larger web servers, this
 is the first time on my workstation and it does just that, simpler
 queries work fine...

Print out $result

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *


/*
Support your local police force -- steal!!
*/


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php