Это видео недоступно.
Сожалеем об этом.

Creating a PHP Search

Поделиться
HTML-код
  • Опубликовано: 6 июл 2012
  • This is a tutorial which goes over how to create a PHP search which filters out results from a database table. Sorry for the mistakes made in this video, the video following this goes over how to take this and make it instant with jQuery
    Tutor Facebook: / joethetutor
    Dibbble: www.dribbble.com/sleekode
    www.helpingdevelop.com

Комментарии • 491

  • @leannegraham1985
    @leannegraham1985 Год назад +2

    Even though this is an old post, it's been the most helpful! Got my assignment done using it. BIG THANK YOU!

  • @edwardsantora2059
    @edwardsantora2059 8 лет назад +3

    Joseph, I wanted to say thank you as this was a really solid tutorial. BTW, I always find it better to have the mistakes as part of the training so that we get the opportunity to troubleshoot. It enhances the training and really enforces what was covered.

  • @eosforfly
    @eosforfly 8 лет назад +40

    best teacher i ever see, i like because you explain everything

  • @SlapDart
    @SlapDart 8 лет назад +2

    This was VERY helpful!!!! I am actually glad you made those few mistakes. It shows us what to do when if those errors come up for us! Way to go man!!!!!!!

  • @dk0money
    @dk0money 10 лет назад

    Yes, the mistakes you made were ironically very useful to help demonstrate and identify your debugging methods. I like how you knew you had a misspelling in one of the variables as opposed to panic about why it didn't work.

  • @2-ply
    @2-ply 6 лет назад +2

    Awesome Tutorial! Btw mistakes are actually a good thing because it can shed some light for other programmers to keep them aware and on their toes :)

  • @MrMackster01
    @MrMackster01 4 года назад

    I’m having some issues when I try your script; I’m getting a ‘500’ error code in my Chrome browser and in my Safari browser I just get a blank browser windows.. Regardless, yours is one of the best tutorials because not only do you explain WHAT you’re doing, you explain WHY you’re doing it!! Nice work!

  • @hekmaarous6227
    @hekmaarous6227 3 года назад +1

    thanks a lot u saved my life as a student

  • @davidmyers1652
    @davidmyers1652 8 лет назад +21

    Hi, great tutorial, just what I was looking for, thanks.
    Know I'm being lazy - but is there a zip file with the code that I can download?

  • @hassanahmed3122
    @hassanahmed3122 4 года назад +1

    Thank you very much for your effort it still working untill now and i use it in my graduation project

  • @markdecursosmoody526
    @markdecursosmoody526 7 лет назад

    WOW that was really really good. Great job i have spent a week trying to understand what I just learned here in 5 minutes. Thank you very much

  • @bleemy
    @bleemy 12 лет назад

    AWESOME VIDEO !!!! been searching all day to find out how to do this and voila you explained exactly what i needed

  • @andythomas9218
    @andythomas9218 9 лет назад

    Loved seeing how you corrected the mistakes...very helpful!

  • @bl1585
    @bl1585 10 лет назад +1

    dude i dont know ur name but ur tutorial is excellent it helped me to solve my prblm....keep on posting the videos......thanx a lot

  • @kingsleynmai5608
    @kingsleynmai5608 4 года назад +1

    Thank you very much Joe, you made know I can search not by "=" operation only but I can also use the like clause in searching for both names from my database

  • @squirrelgaming4028
    @squirrelgaming4028 6 лет назад

    your tutorials are amazing we don't care about typos

  • @F4FIGHT
    @F4FIGHT 10 лет назад

    Very very comprehensive and clearly explained . Thank you very much.

  • @_jsmth
    @_jsmth  11 лет назад

    I will get around to it, I have been super busy these holidays doing Helping Develop's website when ever I can... I will get back to all the tutorials once that is done so I have somewhere to house my source code and download packages etc!

  • @cooswitjes7371
    @cooswitjes7371 6 лет назад

    Great Video! Thanks for making this. Explains a lot and easy to understand for Cavemen-Minds like me.

  • @DavidAshby1
    @DavidAshby1 10 лет назад

    Nice tutorial, thanks.
    To update to mysqli I added/edited the following
    $dbc = mysqli_connect("localhost", "root", "PASSWORD") or die("Could not connect");
    mysqli_select_db($dbc, "search_test") or die ("Could not find database. Please try again later");
    $query = mysqli_query($dbc, "SELECT * FROM members WHERE firstname LIKE '%$searchq%' OR lastname LIKE '%$searchq%'") or die("Could not search");
    Every reference to mysql should be changed to mysqli and obviously in the connection script make sure you enter the correct password and database name as well as the table name in the SELECT query.
    works like a dream.

  • @_jsmth
    @_jsmth  12 лет назад +7

    haha yes I guess! I just try to make my tutorials are professional as I can! :D Thanks for the comment though it makes me feel a lot better :D

  • @h7snp556
    @h7snp556 6 лет назад

    this video helped me a lot in completing my assignment. thanks!

  • @JawaJosh
    @JawaJosh 9 лет назад +2

    this didn't work for me once I put in all the php. For some reason nothing appears on the page. Is there anyway to download the source code?

  • @kimfrost3362
    @kimfrost3362 9 лет назад

    You are awesome!
    I subscribed you, your teaching is very hearable.
    Thank you!
    Please teach for people for studying PHP!!

  • @_jsmth
    @_jsmth  12 лет назад +3

    Yeah I understand what you mean if you watch my jquery image slider tutorial that teaches that part... I will do a third part maybe tomorrow night, (might be a forth part too) about how to make a dynamic image slider :p meaning uploading images and displaying them automatically :D

  • @AbdiqaniAliJ
    @AbdiqaniAliJ 8 лет назад

    Useful Tutorial for all advance & beginners!

  • @DnKZone
    @DnKZone 3 года назад

    You expletion is perfect. I like it 😊

  • @vladxoxo8128
    @vladxoxo8128 8 лет назад

    Great! Tried it with mysql, simple and working! Thumbs up!

  • @SpeedtrixProductions
    @SpeedtrixProductions 10 лет назад

    Thank you you have helped me learn how to create my first search engine! Thank you!

  • @Sachinartani
    @Sachinartani 7 лет назад

    This tutorial is great. This helps me a lot. Thanks a lot.

  • @alexbentham1253
    @alexbentham1253 10 лет назад

    Fantastic tutorial. Helped me more than you imagine!!

  • @SahidulIslam-tz6tm
    @SahidulIslam-tz6tm 7 лет назад

    What algorithm is used here(I mean like binary search, depth first search etc)? I want to know the algorithm. Thanks

  • @TheMinikid22
    @TheMinikid22 9 лет назад

    this was a great tutorial thank you very much and as to the mistakes i think that's good it shows what you have to do if something goes wrong.

  • @_jsmth
    @_jsmth  12 лет назад +5

    No problem dude! glad to help :)

  • @lastninja2022
    @lastninja2022 3 года назад

    thank you for the tutorial sir!! please kindly make a sample how to make printout of those items?

  • @MrMackster01
    @MrMackster01 4 года назад

    Im trying to add labels about the php output... in my case im outputting movie titles and actor’s names.. any suggestions ?

  • @vamshivivaan
    @vamshivivaan 5 лет назад

    Amazing explanation brother. That was very helpful for my projects!

  • @tural7778
    @tural7778 8 лет назад

    it works .. thnaks. but when pressing search button while text area is empry outputing all information in mysql. how to fix this problem? i want show this message "please fill area" when text area is empty and button pressed. thanks

  • @juanignaciogonzalezcalabro1293
    @juanignaciogonzalezcalabro1293 9 лет назад

    If I have a local Database and not one created in phpmyadmin , what should I put after mysql_connect?
    Let's say my db is in "C:/Apache2.2/htdocs/MTDB/App_Data and it is called dbo.Table.sql
    Where do I get what I should put in those three arguements in mysql_connect?
    If I never set my password, can I leave it empty? Thank you very much!

  • @azlanlan7870
    @azlanlan7870 10 лет назад

    thank you so much . your coding manage to help me make a search . thank you . i really need this :)

  • @espinaryan
    @espinaryan 6 лет назад

    Actually the mistake is ok and also a tutorial so we will know how to solve the problem if we also encounter those errors, by the way you help me with your tutorial a good one

  • @bradleybrand0
    @bradleybrand0 10 лет назад +1

    for some reason mine is showing "fname lname" on the page rather than their firstname and lastname. What should I do? It says my error is on line 20.

  • @narendraverma825
    @narendraverma825 7 лет назад

    Can you search the records without clicked on the button. I mean keypress. Just type anything into the fields and record will display.. Can you help me in this?

  • @vyoivanov
    @vyoivanov 7 лет назад

    Hey! What should I write on preg_replace statement if I want my search to include Cyrilic keyboard? Utf-8? Thank you for that lesson! U are the best teacher! You explain everything, using simple words so we can understand you! God bless!

  • @fiscalpaladin7509
    @fiscalpaladin7509 4 года назад

    Oh my gash! What a great video bro!! Keep it up!! Your video was very helpful for us specially to us who were beginners! Ive learned so many things in this video. DONE SUBSCRIBE

  • @brittanysheppard8601
    @brittanysheppard8601 9 лет назад +1

    Has helped tremendously!

  • @bethanydavidson5609
    @bethanydavidson5609 3 года назад

    Hi when i press the the seach button nothing happens, have you any idea what i have done wrong, or how i could fix this? thanks

  • @fractureGamIng1
    @fractureGamIng1 6 лет назад

    VERY NICE and very helpfull tutorial

  • @vladjovan2744
    @vladjovan2744 9 лет назад

    Cool. Thanks. Btw I think it is realy good to make mistakes, becouse by that You helping us realize eventual problems we can face with in our work. BW. thanks again.

  • @nemanjastankovic941
    @nemanjastankovic941 10 лет назад

    Great tut. Thank you so much for it. Best regards
    from Serbia.

  • @larsbollas8003
    @larsbollas8003 9 лет назад

    sir i wanted to do some design so i changed the of your's to
    Search

    and i am using a bootstrap.. but it didn't work..

  • @WaqarAhmad-oc5ox
    @WaqarAhmad-oc5ox 7 лет назад +1

    Thanks so much this tutorial is so much helpful for me

  • @bhuvanavignesh8468
    @bhuvanavignesh8468 8 лет назад

    nice tutorial.....Well done friend......

  • @axelberlot2560
    @axelberlot2560 8 лет назад

    Este video es genial !!! todo funciona como lo especifica !!!
    Thisvideo is great!!! everything works as you said !!!
    I hope you could upload any tutorial video especific to OOP PHP, thanks for your help.

  • @jyoti16eng
    @jyoti16eng 5 лет назад

    its good but my concern is that i am making a real estate website in this i have a search form that have property-location property-type and property id so how to search it from php search operation. i want to get in output property_location propertytype and id.... plz answer me

  • @vesselincohen437
    @vesselincohen437 7 лет назад

    Hello, Mr. Smith.
    You can explain very clear php possibilities. Your example works with me very stable with a few moderations. Can you explain how to grab data from table generated after search and use it for example to insert in another table?

  • @TheCaptainElliott
    @TheCaptainElliott 10 лет назад

    Instead of using a MySQL database is there a way to use a Microsoft access database instead (just for a local website)

  • @rockfootballdude
    @rockfootballdude 9 лет назад +11

    I think you should purposely make mistakes, debugging is a big part of coding and seeing how you do it and what potential problems we would see is extremely useful for those of us learning new programming languages. Also, thanks for the great vid.

    • @frederikolsen767
      @frederikolsen767 9 лет назад +2

      I dont think attempting to fix something that you are maybe seeing for the first time, isn't the greatest move. Sure debugging is a big part of learning PHP or any other language, but you have to learn the basics before you try to fix things. :)

  • @subhavadhana5689
    @subhavadhana5689 2 года назад

    Can you upload a video for Boolean search using multiple skills with AND operator

  • @somnathgarai
    @somnathgarai 10 лет назад

    Nice tutorials.. I learnt some more interesting things about php. Thank you.

  • @AntonMagician
    @AntonMagician 12 лет назад

    Hey I actually already knew how this works but this is an awesome tutorial :)!

  • @dineshkarki846
    @dineshkarki846 8 лет назад

    wow great teach !
    Dinesh mountain guide in Nepal.

  • @hlspg
    @hlspg 5 лет назад

    for those who follow the tutorial and have the problem with empty field showing all data:
    just below this code:
    if(isset($_POST['search'])) {
    $searchq = $_POST['search'];
    $searchq = preg_replace("#[^0-9a-z]#i","",$searchq);
    write this:
    if(empty($_POST['search'])){
    $output = 'empty field';
    }else{
    and put another } at the end of the file to close it.

  • @pitocms
    @pitocms 10 лет назад

    I have learn many thing from you.You are really awesome :)

  • @kevinwaag9976
    @kevinwaag9976 3 года назад

    I used pdo method to connect ? how do i replace the mysqlquery ?

  • @gayatrik3360
    @gayatrik3360 6 лет назад

    SIR, If i have multiple tables in single database and i want to select the particular table, and particular fields in that table using select option. After select I give search. That particular table will be displayed., how I implement it, any idea sir...

  • @justindolino
    @justindolino 6 лет назад

    how can i make a simple search that only looks for the navigation in my website, so instead of navigating through all my menus i can do a quick search?

  • @funkychicken100005
    @funkychicken100005 5 лет назад +1

    nice video, is this info still up to date?

  • @fahmimdnoor3346
    @fahmimdnoor3346 10 лет назад

    superb and excellent tutorial ! helps me a lot !

  • @ClassicCartoonsNL
    @ClassicCartoonsNL 7 лет назад

    How do you display multiple records with the same name ? I mean I've tried also your way but I still it doesn't display multiple results. Maybe because of some coding in java which is included in my code?

  • @AkramulMazid
    @AkramulMazid 8 лет назад

    Shows an error ""Parse error: syntax error, unexpected '' '' (T_CONSTANT_ENCAPSED_STRING) in C:\xampp\htdocs\TripGuide\search.php on line 21 " . What to do?

  • @xesigndesign
    @xesigndesign 10 лет назад +2

    thank you very much.
    worked fine !!!!
    can you please make a tutorial how to update information in the db ?
    i can insert and delet in the db but cant update.

    • @mattmaggio229
      @mattmaggio229 9 лет назад

      yah i would like that i subbed to wait and see

    • @iExtraBacon
      @iExtraBacon 9 лет назад

      UPDATE function.

  • @kimtaetae6125
    @kimtaetae6125 9 лет назад

    Notice: Undefined variable: output in D:\Program Files\XAMPP\htdocs\search\index.php on line 67
    -- for that php line inside html --

  • @DanielRamirez-nc9wu
    @DanielRamirez-nc9wu 5 лет назад

    I've been quoted 8 hrs to implement a PHP Search function on a site I'm having built , seems like you knocked it out in a fraction of the time... would you say my developer is inflating their numbers a bit?

  • @blankshell3401
    @blankshell3401 5 лет назад

    Thanks it really worked...

  • @PraveenKC007
    @PraveenKC007 8 лет назад

    i want to display the search result only if user inputs 2 search items matches the data on same row.for example i want to display the record of student only if his registration id and date of birth matches. how can we do that.

  • @philippengendaneza218
    @philippengendaneza218 6 лет назад

    i like the way you start this tutorial

  • @lastninja2022
    @lastninja2022 4 года назад

    awesome video sir...but can you please create a search base on selected drop down list example if i want to search first name then i select first the drop down list and find it using textbox in php

  • @IPHPCOM
    @IPHPCOM 10 лет назад

    Nice big font. It is easy to watch on iPad.

  • @KSstreetKhmerFood
    @KSstreetKhmerFood 7 лет назад

    very good teacher i love this lesson

  • @koolkass8708
    @koolkass8708 10 лет назад

    Okay the local server gave me 3 errors:
    1.undefine index:search on line 7 "on your video its line 7"
    2.undefine variable:preg_replace on line 8
    3.function name must be in string on line 10.
    What should i do know???Please help!!

  • @lilverson1333
    @lilverson1333 3 года назад

    I am using an API Key and I dont understand how to access the data from the website to display what was searched. I dont think I can use a database.

  • @punchoutND
    @punchoutND 10 лет назад

    Can you demo how this search engine will also display an image along with the current output? Like john Smith with his photo?

  • @apulibaatawine3999
    @apulibaatawine3999 4 года назад

    This nice tutorial.
    Please, can I get the next to the next video

  • @paulsichone707
    @paulsichone707 8 лет назад

    wooh!! you took me where i want to be...thanks very much

  • @evio95
    @evio95 10 лет назад

    the html part works, but when i put the php for connection it doesn't show anything. I'm using postgres,please help.

  • @denvercheddie
    @denvercheddie 8 лет назад

    Great video with explanations and all. I am new to php. Suppose I wanted to search from a table or array located within the php file itself, what do I need to do differently?

  • @Iviima
    @Iviima 9 лет назад

    I think I have a problem in the sql sentence, cuz I am getting an error = Could not search... any ideas?

  • @mimok4383
    @mimok4383 4 года назад +1

    thank you very much

  • @gyozohorvath322
    @gyozohorvath322 5 лет назад

    Still a good explanation video. Thanks for the help!

  • @RodneyEkrano
    @RodneyEkrano 7 лет назад

    lovely job, so how do I use this to enter the database of my company software, whitch is basically sql

  • @cyleangelobautista7359
    @cyleangelobautista7359 7 лет назад

    best tutorial

  • @hasan135
    @hasan135 9 лет назад

    Very nice tutorial. I am expecting more video on php mysql tutorial.

  • @AbhiBhardwaj1289
    @AbhiBhardwaj1289 10 лет назад

    really,it help me alot
    \thanx for video

  • @asifmahmood6829
    @asifmahmood6829 10 лет назад

    hi,i want to connect "search" option with php my admin database. but i don't know how to do. so please help me....

  • @mdsharifulislam5304
    @mdsharifulislam5304 9 лет назад

    Good suggest there ! I am very Happy on this tutorial. seriously I say that it's very good code for me.

  • @espheroz
    @espheroz 8 лет назад +2

    mine only show one result even though there is 2 more, what did i do wrong??

  • @sups5586
    @sups5586 7 лет назад

    Great tutorial, How can I allow a hyphen in preg_replace?

  • @jayanthibhobho4281
    @jayanthibhobho4281 9 лет назад

    Nice....Quite good to learn..

  • @lheedp
    @lheedp 7 лет назад

    I like this guy! You are awesome !