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

57: How to create a search field with PHP and MySQLi | PHP tutorial | Learn PHP programming

Поделиться
HTML-код
  • Опубликовано: 13 авг 2024

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

  • @natiqmumtaz5309
    @natiqmumtaz5309 4 года назад +85

    "Search" code starts at 28:53

  • @xiaoyang4521
    @xiaoyang4521 5 лет назад +10

    This session really wowed me. As a total programming dummy, I didn't know you can build a search function by watching just 46 mins of video. Thank you Daniel!!

  • @atik8262
    @atik8262 4 года назад +9

    #2020
    I wrote the exact same script and found one problem which is, when you hit submit without typing anything into the input field, it shows all the records from your database table.
    I was about to ask Daniel for a solution but then I thought, wait a minute! it's easy :-)
    So in case anyone face the same problem and need a solution, just do this..
    after getting user input, run an if statement like,
    if ( $input != null ) {
    rest of the code;
    } else if ( $input == null ) {
    error message;
    }
    And thank you so much Daniel

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

      You could also put a required in at the input. So you can only hit the button if there is a value in it. And thus you don't go to an empty page with only an error message. This is atleast what I did :P

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

      @@ryandewilde6396 yeap, i didn't know about "required " attribute then 😅

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

      @@ryandewilde6396 Problem with that is if someone still really wanted to see all the records, they could just inspect element and remove the required attribute manually or just type in a space and all the results that include a space will appear

  • @akachi1637
    @akachi1637 3 года назад +2

    I always come to this guys videos and i am always 100% satisfied. this guy is a legend. I am subbing

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

      please i want the code for my university it dont print any thing when search

  • @jarrodestepp2070
    @jarrodestepp2070 7 лет назад +13

    I myself just want to thank you personally for making these tutorials. Yours always help me better then any else.

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

      please can u send me the codes please

  • @akashdhanorkar5826
    @akashdhanorkar5826 7 лет назад +17

    It makes easy to learn when you explain everything properly. It helped me a lot. Thank you for the videos

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

    Perhaps the best thing about your tutorials is that they provide a basis from which I am able to extend and adapt the content to my needs quite easily. Today I finished my search tool based on your tutorial, for my multi-user image gallery. Works perfectly.

  • @creativesasi2691
    @creativesasi2691 5 лет назад +2

    You are the best. All the things are very clear. Thank you So much Mr. Danniel...

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

    ahh just what i wanted finally!! i actually recommend watching all earlier 56 videos and then come back here because you probably wont completely understand whats going on here ill tell ya something these tutorials are such a confidence booster to me .Thanks Daniel!

  • @joelcortez3527
    @joelcortez3527 Год назад +1

    Thank you very much for this video, it is very easy to understand.

  • @CalvinBonner
    @CalvinBonner 3 года назад +3

    I know this video was posted years ago, but thank you! This was super informative as always. I don't know if you ever plan to post an updated video but, if you do, I would love to see how this search function could work with full pages on the site (so instead of putting all the data in the database itself, you can search through all pages on the website). Anway, thanks again!

  • @MohPhpMaster
    @MohPhpMaster 7 лет назад +13

    you know i'm professional PHP Programmer .. and i really enjoy with ur video .
    respect ..♥

    • @p1antings33ds8
      @p1antings33ds8 6 лет назад +1

      @Pak Home Well, in my case it took years. And I'm still learning. The more you look at code and play with it the more you begin to understand it. It's kind of like learning another language, like Spanish.

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

      Do you use PDO or mysqli ?

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

    This lesson was so useful for me to work on my page integrating PHP and SQL queries with container results div. Thank you so much! Greetings from Brazil.

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

    THANK YOU KIND SIR, YOUR TUTORIALS DO THE MOST.
    SHOUT OUT ALL THE WAY FROM SOUTH AFRICA!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

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

    Your Tutorial is very useful, please keep going 🙏🙏

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

    Dude... I'm here in 2020 and your tutorials are just the best, no doubt about it. You explain everything so good and I have NEVER failed with something when watching your tutorials. Are you a magician or something? haha :D

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

    Fantastic lesson. This will keep me busy coding my own website for the next week. So many questions I had have been answered in this video. Huge thanks.

  • @MetaAndrej
    @MetaAndrej Год назад

    This is amazing. Thank you so much. This helped me in my MBA course

  • @Princejay-xu7ed
    @Princejay-xu7ed 5 лет назад +2

    Hi sir thank you for creating this kind of tutorial this program help me a lot for my thesis :)

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

    Best , clear , simple ,
    Thank you Danial it was really useful ,
    Thank you for your time and efforts .

  • @thatsnocopyright6133
    @thatsnocopyright6133 6 лет назад +3

    Thank you! Good explaining and I like that you explain what everything is and does!
    Subscribed and Followed!

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

    Your videos really help. You explain every method and concept very thoroughly. i learned a lot from your videos. Thanks.

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

    Super helpful, Thank so much!

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

    omy you actually helped me on my project! thank you so much you earned a new sub! keep up the great work my man!

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

    Absolutely love your tutorials man keep posting you create a lot of value for the programming community!

  • @s.sedighi
    @s.sedighi 2 года назад

    Thanks Dani, that was very helpful 😍

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

    Thank you so much for this, sir!
    I've been really stressed out since I'm still a beginner to php but this video and your clear explanation really helped me a ton! I really appreciate this.
    Liked and subscribed so that it can reach a wider audience.
    Hope you're having a great day. :)

  • @30Quers
    @30Quers 6 лет назад

    You explained it very clearly. Thumbs up!

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

    Thank you so much for this tutorial. This helped me so much while taking development courses during the pandemic. Wouldn't have been able to have learned this without you!

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

    Love the details video! So clear for new bie like me to understand

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

    Thanks for this tutorial: you are a really good teacher!

  • @shripradamahajan8054
    @shripradamahajan8054 7 лет назад +1

    i have learned a lot from your tutorials, very well explained, thank you!!

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

    Thank you for sharing your knowledge. Nice job!

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

    Hi Daniel! All your tutorials are so so amazing, thanks for sharing your knowledge.

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

    Thanks you for all your PHP tutorials mmtuts :) just downloaded the full part of PHP tuts.

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

    Thank you so much for your unselfish sharing! I really appreciate it. Keep going. You did a really good job!

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

    One of the best tutorial i've ever listened.....

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

    very effective php ...!!!
    Really it is true.
    If, I could Subscribe to this Channel 100000+ times, I would do ...!!!!!

  • @w4rri0r0906
    @w4rri0r0906 7 лет назад +1

    Thank you man, it is very helpful! Keep up the good work. :)

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

    dude you are amazing! thank you.

  • @SANBIRTRADING
    @SANBIRTRADING 2 года назад +1

    Great Tutorial! Please make a tutorial for the directory listing website's multiple search box filtering.

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

    Thank your very much for your good job.

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

    Thank you so much for your video tuts, they helped me a LOT during my traineeship. Keep up the good work, looking forward to more tutorials!

  • @MilanB
    @MilanB 7 лет назад +4

    You Nailed it! Just what I needed. :)

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

    Your tutorials are amazing! Thank you so much for the knowledge!

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

    Your lessons explain everything so well! Thank you so much!

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

    thank you so so so much! it helped me a lot for my exam next week

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

    Thank you for the video!

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

    It helped me a lot.

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

    Omg! This is one of the best videos I have ever seen😍!!!
    The way you have explained the concepts is really awesome👍
    Keep making such video.❤️from🇮🇳

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

    THANK YOU!

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

      please can u send me the code when i search it dont print any thing

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

    Wow, you just created a mini CMS here. Really liked it, thanks!

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

    Great video, i did this followed the tutorial but did everything using PDO instead, still worth the watch

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

    Thank you VERY VERY VERY VERY much

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

    best tutorial THanks

  • @borjan006
    @borjan006 7 лет назад +24

    Can you pretty pls make a video about creating a live chat system?

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

      I am also eagerly waiting

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

      easier way to do a livechat is to use mongodb + express + nodejs :)

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

      @@MrFckingninja express is node

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

    Hello !
    Is there a reason why at min 33:59 when you add the $search inside the string you don't wrap it around two dots ? Like you do at 39:29 ?
    Also great work with the tutorials ! They are amazing !

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

    i am new in webdeveloping and this video is sooooooo helpful. Can i give more than one thumbsup? Anyways, thanks for sharing this. kudos

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

    Thank you bro you're the best GEEK, I had a problem of search bar which was missing on my site and now you saved my a**!! Thank you so so much. If possible you would make for me two videos one showing how to add a download button with an embedded link from the database and another one showing how to make an auto_complete search-bar.

  • @yaokouassijean-claude1499
    @yaokouassijean-claude1499 7 лет назад

    Thanks you! very very much..it's a great tutorials,. All tutorials Excellents..

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

    from mmtuts to Dani Krossing I love all of ur tutorial, It's really a big help to people like me who can't afford paying for proper education. very poor guy.

  • @ariftahir3092
    @ariftahir3092 7 лет назад +1

    Thank you very much, very helpful.

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

    39:21 I think line 15 echo "There are ".$queryResult." results! "; should be below the if ($queryResult > 0) statement instead, because if you get 0 results the page will say both "There are 0 results" and "There are no results matching your search", which is a bit redundant. Thanks for video

  • @bharath2477
    @bharath2477 7 лет назад +2

    In most cases, ID is used to refer to the article. Using title and date of article seems to be pointless. Anyway, the tutorial is nice!

  • @WasikaHausaNews
    @WasikaHausaNews Год назад

    Nice thank you so much

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

    3:14, this put a smile to my face

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

    I need help...my search page shows nothing but the "Search Page" title and it doesn't matter whether I submit a word that exists in my article or not. It doesn't say No matching results found, nor does it show me any articles. My codes are 100% identical to the one shown in the vid(even to the spaces). Why on Earth isn't my php code working at all???? I'm so close to making it work and this is so frustrating... :/

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

      I have movod from local to server, changed the databae user and password and started to have the same issue no error but no results also. Why? Is the PHP version wrong?

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

    Thank you very much!

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

    You're the best

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

    Daniel, you did the best php tutorial in the web. ı feel like I spent quality time in your lessons. I have learned great things thanks to you! I cannot thank you enough. I have a request from you though :) could you make a tutorial about star rating system in php? Maybe you can include a system where users can add content to favorites etc.
    I am curious about how to create many-to-many relationship in mysql and most of all how to implement this in php? Rating system or add to favorites seems perfect to learn.
    Again, thanks for your great efforts.

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

    This was a massive help. Thank you

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

    Simply a legend, and danish at it at well. Musician at the conservatory trying to get a sidegig. I've followed a lot of your great tutorials, and are very close to finishing my website. I was wondering what you've studied at the university, and do you know if you need an education to become a web developer, (or software-engineer in general), or can you get a job with the skills you provide tutorials for? I'm very curious! A video about it would be nice, but a comment will also do - I'll take what I can get ;)!

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

    Hi Dani, thank you a lot for your tutorials I really appreciate all your effort!
    I would like to ask you how to get rid of this error:
    Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, bool given in /opt/lampp/htdocs/PHP-Search/search.php on line 13
    I tried to so hard to fix but I'm afraid I can't find the solution.
    Thanks.

  • @yukihyo8394
    @yukihyo8394 7 лет назад +81

    "but note that the author does have a big D" I see what you are trying to tell us mister Daniel ;) LOL

    • @stefan4800
      @stefan4800 7 лет назад +2

      Fair warning!

    • @obu69
      @obu69 6 лет назад +4

      i thought i was the only one. lol Daniel with a big D. 3:12

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

      hahah

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

      and in Philippines (in Visayas) , Otten also is a D tho. +10 intelligence

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

      hahahaha wtf

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

    Thanks a lot for this

  • @vilmac.6988
    @vilmac.6988 5 лет назад +1

    aren't mysqli outdated and i need to use pdo instead? might be good but not for 2019.

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

      Hehe no mysqli isn't outdated. Like many others you confuse mysqli and mysql as the same thing. You should never use mysql today, but when it comes to mysqli it is a completely different thing. It is normal for people to confuse these two things. :)

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

      To add to that... It is a misconception that PDO is the ultimate connection method in Web dev. PDO and Mysqli have strengths and weaknesses on both sides. In the end it depends on what you plan to do with it.

    • @vilmac.6988
      @vilmac.6988 5 лет назад

      it might be the case. It's just the general problem with a lot of courses in php that a lot of things are written different and it brings the question 'If someone else doing it other way does that mean that i'm doing it wrongly?' Ego comes to play, hence the pdo is better ;) .
      p.s. Since I got your attention I just wanna make a remark/suggestion. I really don't like that a lot of youtube programming "teachers" focuses to much on writing something instead of explaining why it is the way it is. The latter seems the seems the essence of learning but in most of the cases the former completely overshadows it. Don't tell me what, tell me why, So we can learn this way. Focus on what's important and i'll love you long time.

  • @TV-vu9fg
    @TV-vu9fg 5 лет назад +2

    Thank you ,it works.But I notice you don't give the end(like ) in search.php,since you include header.php,is that okay?

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

      That is a mistake on my end. You should include the closing tags at the bottom :)

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

      please can u give me the codes

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

    Hi. I am getting this error:
    Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given
    why is this??

  • @bravehotsauce
    @bravehotsauce Год назад

    Thank you!

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

    Very nice things so beautifully explained. Before watching this video, I thought searching is the most puzzling part of the website but after that I'm just like this is a piece of piss..😂😂😂

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

    I learn so much watching your PHP videos. Can you please make a video creating a search field with pagination?

  • @user-cc9gq6de2t
    @user-cc9gq6de2t 7 лет назад

    Thanks so much, Daniel! You rock

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

    Great points you expressed here. Thanks.

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

    Thank You for your hard work.

  • @05124
    @05124 6 лет назад +1

    Thanks for the tutorial, it is very good, however I would like to ask, how do I get the search result to href to my actual page, at the moment the end result is that I am taken to the article page which echos out the database data because we have told it to. If I replace this data with my actual page data (a real article), that data will appear for all search results. Could you help me out please, I am a beginner indeed.

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

    thank you very much. The way you teach us is very clear, so we easy to understand the tuts. Question: do we really need always to include $conn variable before $_POST['search'] ?
    What I know is that mysqli_query function always need two arguments and one of them is $conn and the query statement.

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

    I really love you man. But please include some timing so we can jump to where we wanna get to.

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

    thank you this what i need. hope you make a advance search field.

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

    Thank you so much! This just saved my ass.

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

    It's very helpful video :D Thanks!!

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

    Very Nice Tutorial! Super easy to follow thank you! Can you make a video how to search every table in a database? Like for example you have 5 tables (cars, users, maintenance, contact, price). Because I been trying to refactor your example code but it's fighting me and being a beginner I don't know enough about PHP to figure why I can't get it to work.

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

    Great video, thank you!

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

    THANK YOU MAN YOU'RE THE BEST

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

    understandable!!!
    illustrative!!!
    keep going!!!
    Make a video about how to make a brand filter for online shop

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

    Been waiting for this! Love it

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

    Great tutorial thanks! I would be interested to know with regards to the comments from
    Junior WebDeveloper
    below, which of the two solutions to the empty search box situation is the "correct way"?

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

    this is a great tutorial a suggestion though you should add comments to your code that way we always have a reference to what is what

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

    THANK YOU VERY VERY MUCH!!!!!!!!!!

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

    Thnx man for helpful tutorial ♥️🙏

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

    Is it wise to query the db directly for every search like this? would it not be less intensive on the db to scrape the webpage itself? or something similar im not sure