Re: Problem w/query - again

Amit Tandon <[email protected]>
Newsgroups gmane.comp.php.database
Message-ID <CAM5Pkjex2_BPdqxBq3A0W7wQRr5XFSkQgGh9NbhXgKG5UJsxFQ@mail.gmail.com>
Dear Ethan

The line you are getting is because the $_POST[fieldname] is blank. So for
the following line
 if ( ! empty( $_POST['field'] ) )
change it to
 if ( ! empty( $_POST["$field"] ) )

Your line : Program is searxchinbg for variable name field
New line : The Program is seacging for varable stored in $field. Rember to
use double quotes

And to verify the value echo $_POST["$field"] before your if line i.e.
 if ( ! empty( $_POST["$field"] ) )

============
regds
amit

"The difference between fiction and reality? Fiction has to make sense."


On Fri, Feb 10, 2012 at 11:04 AM, Ethan Rosenberg <[email protected]>wrote:

> At 12:13 AM 2/10/2012, Amit Tandon wrote:
>
>> Dear Ethan
>>
>> It seems you are trying to build a query.But you are not getting field
>> names. If you required field names then change the following line to
>>
>> foreach ( $allowed_fields AS $field => $_POST['field'])
>> to
>> foreach ( $allowed_fields AS $field)
>>
>> This would convert the variable field to value. In yoyr line the variable
>> field is treated as array index
>> ============
>> regds
>> amit
>>
>> "The difference between fiction and reality? Fiction has to make sense."
>>
>> <snip>
>>
>> >
>> > Advice and help please.
>> >
>> > Thanks.
>> >
>> >
>> > Ethan
>> > PHP Database Mailing List (http://www.php.net/)
>> > To unsubscribe, visit: http://www.php.net/unsub.php
>> >
>> >
>>
>
> Amit -
>
> Thanks.
>
> Tried it.  Still does not work.
>
> This is the query I get:
>
>
> select * from Intake3 where  1
>
> Ethan
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.