3. MySQL PHP Search Programming : SQL LIKE Syntax UNION and AS Alias with Filters Tutorial




Script: http://www.developphp.com/video/PHP/SQL-LIKE-Syntax-UNION-and-AS-Alias-with-Filters Part 3 of MySQL PHP Search Programming Exercises for …

source


30 responses to “3. MySQL PHP Search Programming : SQL LIKE Syntax UNION and AS Alias with Filters Tutorial”

  1. Hi adam! When i try to search, others would show correctly and some wont show correctly even if theres a record in the database. The word are the same, just confuse why it wont show. My example is Filter: Gender Search: Female, it would show the female and male.. it wont filter

  2. When i try to search i get

    Successful database connection, happy coding!!!
    Warning: mysql_query(): Access denied for user ''@'localhost' (using password: NO) in C:xampphtdocssearchsearch.php on line 22

    Warning: mysql_query(): A link to the server could not be established in C:xampphtdocssearchsearch.php on line 22
    Access denied for user ''@'localhost' (using password: NO)

    but i know the mysql is there because in the connect_to_mysql.php i get Successful database connection, happy coding!!! can you please help me out?

  3. Great tutorial Adam! However, I found out that that there is a typo where it says: " if($count > 1)"; that should be "if($count > 0)". That took me some time to figure out (thank you), but time well spent to get experience! Maybe, you can elaborate on converting MySql code to MySqli?  That would be awesome! Kind regards, F. 

  4. Hi! For some reason, only the words Adam used as examples returned actual results with the code that I copied from his site. Other words like 'disney', 'javascript', 'calculator', etc…return 0 results…how is this possible?

  5. I have added another option to the listbox, advising the user to make a selection. My objective is so that if the end user enters text in the searchbox but does not choose an option from the dropdown then a message will echo out at the top of the form advising them to make a selection from the list as well as enter a search term however I am getting the following message – Undefined variable: sqlCommand in line 22. Wondered if someone could enlighten me.

  6. Hi ur tutorials are excellent here i have a doubt about search i have 4 tables which are linked between each other with relevant ids. my question is how can i search from these tables. tables are products- fields are id, product name, price and details.
    product_categories- fields are id and categories.
    product_subcategories- fields are id and subcategories.
    and product_categories_taken- fields are id, pid(id from products), pcid(from product_categories) , and psid (from product_subcategories).

  7. Great tutorial, just ignore the last 4 minutes of it where he explains that you need to add
    an extra field to your tables and set default values

    The correct and easier way to do this would be to add
    SELECT id, page_title AS title, *** 'pages' as tableName ***WHERE …..
    (don't add the ***) – do the same for 'blog'.

    You can then reference this as if it was a column. ($columnName = $row['tableName'];

    Hope this helps someone.

  8. + if you are planning to support UTF8, this regexp will not match UTF8. You can add p{L} to match UTF8 characters (non-punctuation) and better to replace (space) match with class s , matching all space-like characters like tabs etc.

    Good Luck !

  9. This was the first series of yours I ever watched. Ironically I have not ever had to use search code until now So I revisited this. Got it going great in minutes. Then it took about 3 hours to figure out why some searches were not happening even though the same code worked great in Php MyAdmin. Long story short………..

    if($count > 1 Hmmmmmmmmm Maybe it should be if($count >= 1 Or even if($count > 0 ? Just saying………

Leave a Reply