Using a combination of PHP and MySQL, let\'s say I have a database with some tab
ID: 656194 • Letter: U
Question
Using a combination of PHP and MySQL, let's say I have a database with some tables. I have a page (php or html) which allows a user to enter a string; this will search a specific table for their input and return information on the entry if it exists, and tell them nothing could be found otherwise. So more specifically, if I had a table titled "zookeepers" and I wanted a page where the user is prompted to enter a name and return whether there was a zookeeper with that name or not and if so output his information, what would the code look like for that?
Explanation / Answer
SELECT * FROM zookeepers WHERE name = $variable
SELECT * FROM zookeeper WHERE name LIKE '%$variable%'";
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.