[PHP-DB] Problem w/query - again

2012-02-09 Thread Ethan Rosenberg
Dear list - This did not seem to post, so I am sending it again. If it did post, and I missed it, my apologies. Ethan Dear list - I have the following code: $query = "select * from Intake3 where 1"; $allowed_fields = array('Site', 'MedRec', 'Fname', 'Lname',

Re: [PHP-DB] Problem w/query - again

2012-02-09 Thread Amit Tandon
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. I

Re: [PHP-DB] Problem w/query - again

2012-02-09 Thread Ethan Rosenberg
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

Re: [PHP-DB] Problem w/query - again

2012-02-09 Thread Amit Tandon
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 st

Re: [PHP-DB] Problem w/query - again

2012-02-09 Thread Ethan Rosenberg
At 12:48 AM 2/10/2012, Amit Tandon wrote: 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 N

Re: [PHP-DB] Problem w/query - again - CORRECTION

2012-02-09 Thread Ethan Rosenberg
At 12:48 AM 2/10/2012, Amit Tandon wrote: 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 N