Thread: Please Help Gyz

Page 2 of 2 First 12
  • Jump to page:
    #16
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    9
    Rep Power
    0
    Originally Posted by Triple_Nothing
    That's because when you submit your search, no matter what you type in, you are running the exact same query every time:
    Code:
    SELECT * FROM `Products`;
    You want to add the WHERE clause. Something so it ends up a search like:
    Code:
    SELECT * FROM `Products` WHERE `name`='George';
    Your first goal is inserting the search string into your MySQL query to be ran, so it doesn't always select all rows.
    Then, figure out which would work better for you as far as HOW you wish to search. Do a little research on the LIKE or the MATCH AGAINST items with MySQL searches.
    i add this $data = mysql_query("SELECT * FROM `Products` WHERE `name`='phone'")
    and the result is blank page
  2. #17
  3. Transforming Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,294
    Rep Power
    9400
    That probably means a syntax error. What's your complete code now?
  4. #18
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2009
    Posts
    720
    Rep Power
    7
    And when you define 'blank page', do you literally mean all-white blank? Or just missing-items blank where your list should be?

    As far as your query, the only way a row would be returned from that is if the `name` column exists and has a row holding 'phone' as it's data. This WILL NOT return a row that holds 'iphone' or anything contain more than JUST the word 'phone'.
  6. #19
  7. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,908
    Rep Power
    6352
    Your copy/paste has no semicolon at the end of the line. Perhaps that's it.

    You should invest in a good beginning PHP book. The O'Reilly book covering PHP, MySQL, and JavaScript is a good one.
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  8. #20
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    9
    Rep Power
    0
    Originally Posted by requinix
    That probably means a syntax error. What's your complete code now?
    read on first page i type complete code in my previous post
  10. #21
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    9
    Rep Power
    0
    Originally Posted by Triple_Nothing
    And when you define 'blank page', do you literally mean all-white blank? Or just missing-items blank where your list should be?

    As far as your query, the only way a row would be returned from that is if the `name` column exists and has a row holding 'phone' as it's data. This WILL NOT return a row that holds 'iphone' or anything contain more than JUST the word 'phone'.
    all white nothing is displayed
  12. #22
  13. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,908
    Rep Power
    6352
    Your error reporting level is incorrect. Change error_reporting in php.ini
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
Page 2 of 2 First 12
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo