LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-09-2003, 06:52 PM   #1
stayathomemom
LQ Newbie
 
Registered: Feb 2003
Location: Oil City
Posts: 3

Rep: Reputation: 0
MYSQL Question


Just learning PHP & MYSQL and am getting an error message...

I'm typing an example right out of a textbook...I know my database 'books' is good but I'm curious if anyone sees the problem with this section of code.

mysql_select_db("books");
$query = "select * from books where ".$searchtype."
like '%".$searchterm."%' ";
$result = mysql_query($query);
$num_results = mysql_num_rows($result); (this is line 31)

echo "<p>Number of books found: ".$num_results."</p>";

ERROR MESSAGE I get:

Warning: Supplied argument is not a valid MySQL result resource in /www/htdocs/results.php on line 31

Thanks to anyone who takes time to look this over!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 09:44 AM
MySQL question... kith Linux - General 3 03-06-2004 07:40 PM
MySQL Question NoBrains Linux - Software 2 03-01-2004 11:10 PM
MySQL question TraCe66 Linux - Newbie 11 07-15-2003 03:35 PM
MySQL question ascii2k Linux - General 1 03-27-2002 05:48 PM


All times are GMT -5. The time now is 12:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration