Thanks for the replies :)
Victor's suggestion put me on the right track. (I still have trouble with
language constructs)
Heres what I have now.. All I need to do is name my form fields with the
same name as the column names from the mysql table, and presto! now I can
just add/remove from the sear
1800 AND ID=43";
Worked well for me.
Jonathan Hilgeman
-Original Message-
From: JD Daniels [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 19, 2001 10:41 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Advice On Building Dynamic MySQL Queries
I am building a query from a sear
My solution was almost as elegent...
$query="select * from customers";
$queryand=false;
if(!empty($f_Account)) {
$query.=" WHERE upper(P.Account) like upper('$f_Account')";
$queryand=true;
}
if(!empty($f_First_Name)) {
$query.=($queryand?" AND ":" WHERE ")."upper(p.First_Nam
Hello JD,
on 19.04.2001 you wrote:
> if (!empty($Price))
> {
> if(empty($whereclause))
> {
> $whereclause.="Price$Price";
> }
> els
Hello JD,
on 19.04.2001 you wrote:
> I am building a query from a search form. This is the code I have now:
> if (!empty($whereclause))
> {
> $whereclause=urldecode($whereclause);
> $whereclause=stripslashes($whereclause);
> }
> extrac
I am building a query from a search form. This is the code I have now:
if (!empty($whereclause))
{
$whereclause=urldecode($whereclause);
$whereclause=stripslashes($whereclause);
}
extract($HTTP_POST_VARS);
if (!empty($