[thelist] php/mySQL query problem

Tom Dell'Aringa pixelmech at yahoo.com
Wed Jul 23 18:30:51 CDT 2003


--- Emma Jane Hogbin <emmajane at xtrinsic.com> wrote:
> On Wed, Jul 23, 2003 at 01:50:59PM -0700, Tom Dell'Aringa wrote:
> > 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"
> > 	);
> 	
> Try adding a "die" statment to figure out what's going wrong:
> 	mysql_query() or die("Could not get stuff out
> because...".mysql_error())
> 
> Note the dot in .mysql_error()

Ahhh, thanks Emma...I should have been doing that off the bat and I
just forgot. That pointed me to my error. (I wasn't creating a db
connection after all I guess)

Thanks

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


More information about the thelist mailing list