Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004

    Unanswered: php query problem..

    I have these variables to grab the info from my form, which the user puts in the edit boxes..

    $number = $_POST['p_number'];
    $name = $_POST['p_name'];
    $price = $_POST['p_price'];

    But I'm a bit confused as to create a query to search everything the user put in the fileds (IF the user actually put any data in it)

    maybe something like this:

    select * from products where no=$number(if $number is set) AND name=$name(if $name is set) AND price=$price(if $price is set)

    Can anyone please help, many thanks in advance..

  2. #2
    Join Date
    Jan 2005


    I think you have to check first prommagically if the post- "data" (f.ex.- if ($post1=' ')- or something like that?!)is not null and so make the query.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts