Question
when we enter a thomas in search bar it suppose to show two book result but i'm getting nothing i don't know where the error in code. if u could solve that will be much awesome please show every step.
Book-O-Rama Catlog Search Choose Search Type: Author Enter Search Term: Thomas Search
Book-O-Rama Search Results
; $query = select * from books where .$searchtype. LIKE %. $searchterm. $result = $db->query($query); $num_result = $r
for($i=0; $i < $num_result; $i++) { $row = $result->fetch(); echo <p><strong>. ($1+1).. Title:; echo htmlspecialchars(str
0 0
Add a comment Improve this question Transcribed image text
Answer #1

If you have any doubts, please give me comment...

The error might cause space before LIKE word...

$query = "select * from books where ".$searchtype." LIKE '%".$searchterm."%'";

Explanation:

Suppose $searchtype is Author, then your code generate like AuthorLIKE %...%, It generates an error.

If you still facing an error, give me comment. I will help...

Add a comment
Know the answer?
Add Answer to:
when we enter a thomas in search bar it suppose to show two book result but...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • How to write the insert, search, and remove functions for this hash table program? I'm stuck......

    How to write the insert, search, and remove functions for this hash table program? I'm stuck... This program is written in C++ Hash Tables Hash Table Header File Copy and paste the following code into a header file named HashTable.h Please do not alter this file in any way or you may not receive credit for this lab For this lab, you will implement each of the hash table functions whose prototypes are in HashTable.h. Write these functions in a...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT