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

    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
    Posts
    362

    query

    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.
    dimis

Posting Permissions

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