[thelist] php/mySQL query problem

Nan Harbison nansmith at heritageconcord.org
Wed Jul 23 19:30:49 CDT 2003


Tom,
It looks like you have an at sign (@) in front of
mysql_query, probably a typo. Is that it?
Nan

-----Original Message-----
From: thelist-bounces at lists.evolt.org
[mailto:thelist-bounces at lists.evolt.org]On Behalf Of Tom
Dell'Aringa
Sent: Wednesday, July 23, 2003 4:51 PM
To: thelist at lists.evolt.org
Subject: [thelist] php/mySQL query problem


Hello,

I'm am trying to pull some categories in a php function
from my
database. I do have a valid connection to my DB, and I am
referencing
the correct table. Here is my function:

function PrintCategories()
{
	// get cats
	$result = @mysql_query(
	"SELECT categoryID FROM category"
	);

	$items = mysql_num_rows($result);

        // then do stuff
}

I've left the while loop out after for clarity since I
don't get that
far. The error is:

Warning: mysql_num_rows(): supplied argument is not a
valid MySQL
result resource

This is referring to my $result query. I can't understand
why this is
erroring out, I use this in many places, same code. There
are 2 lines
of data in the db table. I do use the same variable names
in other
functions ($result etc,) so I tried changing them. It
didn't
matter...I'm lost as to what it can be and it must be
plain as the
nose on my face...

TIA

Tom

=====
http://www.pixelmech.com/ :: Web Development Services
http://www.DMXzone.com/ :: Premium Content Author /
JavaScript / Every Friday!
http://www.maccaws.com/ :: Group Leader
[Making A Commercial Case for Adopting Web Standards]

"That's not art, that's just annoying." -- Squidward
--
* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

Evolt.org conference in London, July 25-27 2003.  Register
today at http://evolt.org.uk

For unsubscribe and other options, including the Tip
Harvester
and archives of thelist go to: http://lists.evolt.org
Workers of the Web, evolt !





More information about the thelist mailing list