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

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 พ.ย. 2024

ความคิดเห็น • 362

  • @natiqmumtaz5309
    @natiqmumtaz5309 5 ปีที่แล้ว +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!!

  • @akachi1637
    @akachi1637 4 ปีที่แล้ว +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

  • @joelcortez3527
    @joelcortez3527 ปีที่แล้ว +1

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

  • @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 4 ปีที่แล้ว +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 4 ปีที่แล้ว

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

    • @garfielf6301
      @garfielf6301 4 ปีที่แล้ว

      @@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

  • @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.

  • @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

  • @arjuntantry7894
    @arjuntantry7894 3 ปีที่แล้ว

    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!

  • @creativesasi2691
    @creativesasi2691 5 ปีที่แล้ว +2

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

  • @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.

  • @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 ?

  • @nhlakaniphondwandwe796
    @nhlakaniphondwandwe796 4 ปีที่แล้ว

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

  • @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

  • @bodatawwab6558
    @bodatawwab6558 2 ปีที่แล้ว

    Your Tutorial is very useful, please keep going 🙏🙏

  • @theunboxingchannel3735
    @theunboxingchannel3735 6 ปีที่แล้ว

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

  • @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!

  • @sharifabahar6257
    @sharifabahar6257 7 ปีที่แล้ว

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

  • @30Quers
    @30Quers 6 ปีที่แล้ว

    You explained it very clearly. Thumbs up!

  • @nathanhamlett8133
    @nathanhamlett8133 5 ปีที่แล้ว

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

  • @TiffanyNg100
    @TiffanyNg100 3 ปีที่แล้ว

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

  • @WvyyFPS
    @WvyyFPS 4 ปีที่แล้ว

    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!

  • @cosmosandchill
    @cosmosandchill 3 ปีที่แล้ว

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

  • @TheSakyun
    @TheSakyun 6 ปีที่แล้ว

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

  • @ahmerjaved7627
    @ahmerjaved7627 6 ปีที่แล้ว

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

  • @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. :)

  • @Princejay-xu7ed
    @Princejay-xu7ed 6 ปีที่แล้ว +2

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

  • @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.

  • @nmrisrl11
    @nmrisrl11 7 ปีที่แล้ว

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

  • @shripradamahajan8054
    @shripradamahajan8054 7 ปีที่แล้ว +1

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

  • @hailebraile
    @hailebraile 5 ปีที่แล้ว

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

  • @thatsnocopyright6133
    @thatsnocopyright6133 6 ปีที่แล้ว +3

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

  • @olaiyahabeeb
    @olaiyahabeeb 7 ปีที่แล้ว

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

  • @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🇮🇳

  • @turdferguson195
    @turdferguson195 7 ปีที่แล้ว

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

  • @turdferguson195
    @turdferguson195 7 ปีที่แล้ว

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

  • @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!

  • @junlinhe9049
    @junlinhe9049 6 ปีที่แล้ว

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

  • @glenn9490
    @glenn9490 6 ปีที่แล้ว

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

  • @s.sedighi
    @s.sedighi 2 ปีที่แล้ว

    Thanks Dani, that was very helpful 😍

  • @BdEnglishTutorial
    @BdEnglishTutorial 3 ปีที่แล้ว

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

  • @Quatsch82
    @Quatsch82 6 ปีที่แล้ว

    Wow, you just created a mini CMS here. Really liked it, 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

    • @spykeeek
      @spykeeek 5 ปีที่แล้ว

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

    • @rick_from_yr
      @rick_from_yr 5 ปีที่แล้ว

      hahahaha wtf

  • @ColibriTrips
    @ColibriTrips 3 ปีที่แล้ว

    Thank you for sharing your knowledge. Nice job!

  • @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!

  • @w4rri0r0906
    @w4rri0r0906 7 ปีที่แล้ว +1

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

  • @AdelinBonheur
    @AdelinBonheur 5 ปีที่แล้ว

    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.

  • @lauracooper4676
    @lauracooper4676 3 ปีที่แล้ว +1

    THANK YOU!

    • @Paulprokhoury
      @Paulprokhoury 3 ปีที่แล้ว

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

  • @Mr_Mellowz
    @Mr_Mellowz 3 ปีที่แล้ว

    Super helpful, Thank so much!

  • @sumeyradavran4738
    @sumeyradavran4738 7 ปีที่แล้ว

    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.

  • @vitocraftlp
    @vitocraftlp 3 ปีที่แล้ว

    3:14, this put a smile to my face

  • @SANBIRTRADING
    @SANBIRTRADING 2 ปีที่แล้ว +1

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

  • @onur8727
    @onur8727 3 ปีที่แล้ว

    dude you are amazing! thank you.

  • @essentialjazztranscriptions
    @essentialjazztranscriptions 4 ปีที่แล้ว

    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 ;)!

  • @dhakprasadupreti6249
    @dhakprasadupreti6249 4 ปีที่แล้ว

    Thank your very much for your good job.

  • @garfielf6301
    @garfielf6301 4 ปีที่แล้ว +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

  • @yaokouassijean-claude1499
    @yaokouassijean-claude1499 7 ปีที่แล้ว

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

  • @gjvidz
    @gjvidz 7 ปีที่แล้ว

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

  • @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

  • @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.

  • @zareenremendies
    @zareenremendies 4 ปีที่แล้ว

    It helped me a lot.

  • @MilanB
    @MilanB 7 ปีที่แล้ว +4

    You Nailed it! Just what I needed. :)

    • @savidulai
      @savidulai 6 ปีที่แล้ว +1

      Says Quagmire haha

    • @Paulprokhoury
      @Paulprokhoury 3 ปีที่แล้ว

      please can u send me the code

  • @jamesframe2705
    @jamesframe2705 7 ปีที่แล้ว

    This was a massive help. Thank you

  • @quakepie6627
    @quakepie6627 6 ปีที่แล้ว

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

  • @chaddsmith3354
    @chaddsmith3354 3 ปีที่แล้ว

    Thank you for the video!

  • @sajid3160
    @sajid3160 4 ปีที่แล้ว

    best tutorial THanks

  • @tinsld
    @tinsld 5 ปีที่แล้ว

    Thank you VERY VERY VERY VERY much

  • @sagarmaheshwary3150
    @sagarmaheshwary3150 7 ปีที่แล้ว

    Thank You for your hard work.

  • @ariftahir3092
    @ariftahir3092 7 ปีที่แล้ว +1

    Thank you very much, very helpful.

  • @loaf7832
    @loaf7832 7 ปีที่แล้ว

    THANK YOU MAN YOU'RE THE BEST

  • @ahgiynq
    @ahgiynq 5 ปีที่แล้ว

    You're the best

  • @ДаниилКиселев-к3к
    @ДаниилКиселев-к3к 7 ปีที่แล้ว

    Thanks so much, Daniel! You rock

  • @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 !

  • @mascotacademy2100
    @mascotacademy2100 6 ปีที่แล้ว

    Great points you expressed here. Thanks.

  • @DetectiveMichealScarn
    @DetectiveMichealScarn 7 ปีที่แล้ว

    Been waiting for this! Love it

  • @tonismith1445
    @tonismith1445 5 ปีที่แล้ว

    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.

  • @webdev4786
    @webdev4786 2 ปีที่แล้ว

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

  • @SimkePA
    @SimkePA 6 ปีที่แล้ว +1

    Daniel, thanks a lot for all fantastic videos! I guess you have a lot of things to do already, but you should be a tutor on some university! Your codes and speech are very clear and easy to understand! Bravo!

  • @Omar-ef3hj
    @Omar-ef3hj 5 ปีที่แล้ว

    i never knew that making a functioning search field could be easy.

  • @Mrlimitless006
    @Mrlimitless006 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

  • @photoinshot1355
    @photoinshot1355 4 ปีที่แล้ว

    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"?

  • @kristijan7140
    @kristijan7140 7 ปีที่แล้ว

    It's very helpful video :D Thanks!!

  • @christoferi9636
    @christoferi9636 6 ปีที่แล้ว

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

  • @birdofhermes6152
    @birdofhermes6152 4 ปีที่แล้ว

    Thanks a lot for this

  • @liet365
    @liet365 5 ปีที่แล้ว

    Great video, thank you!

  • @vijayakumar_3
    @vijayakumar_3 4 ปีที่แล้ว

    Thamk you so Much Brother..:) 🧡🧡🧡

  • @jlayinronchi5888
    @jlayinronchi5888 6 ปีที่แล้ว

    Thnx man for helpful tutorial ♥️🙏

  • @rezwanulislam4264
    @rezwanulislam4264 5 ปีที่แล้ว

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

  • @tojiyev_cg
    @tojiyev_cg 7 ปีที่แล้ว

    Thanks for helpful video

  • @ferminduron5089
    @ferminduron5089 7 ปีที่แล้ว

    Awesome video, thanks

  • @hanstausend9922
    @hanstausend9922 5 ปีที่แล้ว

    if you get an Warning like "Notice: Use of undefined constant” use echo "".$row['a_title']."";
    (with single quotes) instead

  • @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..😂😂😂

  • @saidsharif6549
    @saidsharif6549 3 ปีที่แล้ว

    Thank you so much for your amazing explanation, this video has been really helpful to me. But I got one problem I don't know how to deal with it. I have two tables in my database, how to access both of them from my search field?

  • @zenith5071
    @zenith5071 7 ปีที่แล้ว

    You should do a tutorial on how to create a profile page with the ability to post blogs

  • @rivindhugeeneth9987
    @rivindhugeeneth9987 4 ปีที่แล้ว

    Thank You! Sir.

  • @ibexplusentertainment6012
    @ibexplusentertainment6012 3 ปีที่แล้ว

    hi Dani It was very helping Tnx!!!, But How about when we have multiple tables???

  • @79mrym
    @79mrym 2 ปีที่แล้ว

    Hello, thank you for your great video 🌹
    I have a question...
    Why is date and time types ('type='date') not used for searching?