Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 02-09-2003, 06:52 PM   #1
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.

$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>";


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!


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 > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:10 PM.

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