Это видео недоступно.
Сожалеем об этом.
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
Even though this is an old post, it's been the most helpful! Got my assignment done using it. BIG THANK YOU!
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.
best teacher i ever see, i like because you explain everything
+eosforfly s Agree
thanks
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!!!!!!!
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.
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 :)
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!
thanks a lot u saved my life as a student
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?
Thank you very much for your effort it still working untill now and i use it in my graduation project
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
AWESOME VIDEO !!!! been searching all day to find out how to do this and voila you explained exactly what i needed
Loved seeing how you corrected the mistakes...very helpful!
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
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
your tutorials are amazing we don't care about typos
Very very comprehensive and clearly explained . Thank you very much.
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!
Great Video! Thanks for making this. Explains a lot and easy to understand for Cavemen-Minds like me.
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.
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
this video helped me a lot in completing my assignment. thanks!
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?
You are awesome!
I subscribed you, your teaching is very hearable.
Thank you!
Please teach for people for studying PHP!!
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
Useful Tutorial for all advance & beginners!
You expletion is perfect. I like it 😊
Great! Tried it with mysql, simple and working! Thumbs up!
Thank you you have helped me learn how to create my first search engine! Thank you!
This tutorial is great. This helps me a lot. Thanks a lot.
Fantastic tutorial. Helped me more than you imagine!!
What algorithm is used here(I mean like binary search, depth first search etc)? I want to know the algorithm. Thanks
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.
No problem dude! glad to help :)
thank you for the tutorial sir!! please kindly make a sample how to make printout of those items?
Im trying to add labels about the php output... in my case im outputting movie titles and actor’s names.. any suggestions ?
Amazing explanation brother. That was very helpful for my projects!
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
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!
thank you so much . your coding manage to help me make a search . thank you . i really need this :)
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
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.
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?
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!
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
Has helped tremendously!
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
VERY NICE and very helpfull tutorial
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.
Great tut. Thank you so much for it. Best regards
from Serbia.
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..
Thanks so much this tutorial is so much helpful for me
nice tutorial.....Well done friend......
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.
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
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?
Instead of using a MySQL database is there a way to use a Microsoft access database instead (just for a local website)
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.
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. :)
Can you upload a video for Boolean search using multiple skills with AND operator
Nice tutorials.. I learnt some more interesting things about php. Thank you.
Hey I actually already knew how this works but this is an awesome tutorial :)!
wow great teach !
Dinesh mountain guide in Nepal.
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.
I have learn many thing from you.You are really awesome :)
I used pdo method to connect ? how do i replace the mysqlquery ?
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...
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?
nice video, is this info still up to date?
superb and excellent tutorial ! helps me a lot !
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?
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?
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.
yah i would like that i subbed to wait and see
UPDATE function.
Notice: Undefined variable: output in D:\Program Files\XAMPP\htdocs\search\index.php on line 67
-- for that php line inside html --
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?
Thanks it really worked...
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.
i like the way you start this tutorial
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
Nice big font. It is easy to watch on iPad.
very good teacher i love this lesson
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!!
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.
Can you demo how this search engine will also display an image along with the current output? Like john Smith with his photo?
This nice tutorial.
Please, can I get the next to the next video
wooh!! you took me where i want to be...thanks very much
the html part works, but when i put the php for connection it doesn't show anything. I'm using postgres,please help.
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?
I think I have a problem in the sql sentence, cuz I am getting an error = Could not search... any ideas?
thank you very much
Still a good explanation video. Thanks for the help!
lovely job, so how do I use this to enter the database of my company software, whitch is basically sql
best tutorial
Very nice tutorial. I am expecting more video on php mysql tutorial.
really,it help me alot
\thanx for video
hi,i want to connect "search" option with php my admin database. but i don't know how to do. so please help me....
Good suggest there ! I am very Happy on this tutorial. seriously I say that it's very good code for me.
mine only show one result even though there is 2 more, what did i do wrong??
same here
Great tutorial, How can I allow a hyphen in preg_replace?
Nice....Quite good to learn..
I like this guy! You are awesome !