Date: 04/09/01
- Next message: Maxim Derkachev: "Re: [phplib] session4_custom"
- Previous message: Pfeiffer Bau + Immo: "[phplib] html formular nach php-Skript für mysql - Abfrage"
- In reply to: GWBAG <email protected>: "[phplib] Eingabefelder html-Formular an php-Skript"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi
The way I solve this issue:
I am preparing the SQL like this:
$sql = "SELECT ";
$sql .= "name, ";
$sql .= "address ";
$sql .= "FROM objekte ";
$sql .= "WHERE ";
if(!empty($PREIS) || $PREIS == "0")
$sql .= "price = '$PREIS' AND ";
if(!empty($BAUJAHR) && $BAUJAHR > 1900 && $BAUJAHR < 2002)
$sql .= "baujahr = '$BAUJAHR' AND ";
and now if statements for all the other stuff.
Finally:
if($order == "name")
$sql .= "ORDER BY name ";
Good luck
Stephan
On Mon, 9 Apr 2001 GWBAG <email protected> wrote:
> Hallo,
>
> vielleicht kann mir jemand helfen, habe folgendes Problem:
> habe ein Formular in html mit Eingabefelder wie z.B. <INPUT NAME="PREIS"
> value""> wobei ein user den Preis eingeben kann. Solche Felder habe ich nun
> auch für Wohnfläche und Baujahr. Wenn nun der Benutzer für z.B. Wohnfläche
> und Baujahr Werte eingibt, aber nicht in Preis, dann werden (über das
> php-skript - selektionsabfrage bei der Mysql datenbank) keine Datensätze
> ausgeben, man muß immer alle Felder ausfüllen,damit Datensätze ausgegeben
> werden. Aber was ich möchte ist, daß wenn ein Feld nicht ausgefüllt wird, daß
> dies wie ein % bewertet wird, also keine Einschränkung bedeutet. Weiß jemand
> wie das geht?
> Vielen Dank für eure Hilfe
>
> Angelika
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: phplib-unsubscribe <email protected>
> For additional commands, e-mail: phplib-help <email protected>
>
>
-- Dipl.-Ing. Stephan Ullmann Tel: +49 89 289-16008 Fachgebiet Raumfahrttechnik Fax: +49 89 289-16004 Technische Universität München Boltzmannstr. 15 85748 Garching, Germany Email: S.Ullmann <email protected>--------------------------------------------------------------------- To unsubscribe, e-mail: phplib-unsubscribe <email protected> For additional commands, e-mail: phplib-help <email protected>
- Next message: Maxim Derkachev: "Re: [phplib] session4_custom"
- Previous message: Pfeiffer Bau + Immo: "[phplib] html formular nach php-Skript für mysql - Abfrage"
- In reply to: GWBAG <email protected>: "[phplib] Eingabefelder html-Formular an php-Skript"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

