Question

when we enter a thomas in search bar it suppose to show two book result but...

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
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 = $result->num_rows; echo "<p>Number of books found :". $num_result."</p>"; for ($1=0; $i < $num_result; $i++){ $row = $result->fetch(); echo "<p><strong>".($i+1).".Title:"; echo htmlspecialchars(strigcslashes ($row['title']); echo "<strong><br/> Author] "; echo stripcslashes ($row['Author']); echo "<br/> ISBN: "; echo stripcslashes ($row['ISBN']); echo "<br/> Price: "; echo stripeslashes($row['price']); echo "</p>";
for($i=0; $i < $num_result; $i++) { $row = $result->fetch(); echo "<p><strong>". ($1+1).". Title:"; echo htmlspecialchars(stripcslashes ($row['title'])); echo "<strong><br/> Author: "; echo stripcslashes ($row('Author']); echo "<br/> ISBN: "; echo stripcslashes ($row['ISBN']); echo "<br/> Price:"; echo stripcslashes ($row['price']); echo "</p>"; $result->free_result(); $db->close(); 66 67 68 69 </body> </html>
0 0
Add a comment Improve this question
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...

  • SQL HELP

    STEP 1:Using the BOOKS table, write a query that will list the categories for the books in inventory. List each category only once in your result set.STEP 2:Using the BOOKS table, write a query that will list the title and publisher ID for each book in the table. Use the column heading of "Publisher ID" for the pubidfield.STEP 3:Using the BOOKS table, write a query that will list the book title, retail price, and the amount of markup for each...

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