[thelist] php/mySQL query problem

Emma Jane Hogbin emmajane at xtrinsic.com
Wed Jul 23 17:43:53 CDT 2003


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()

emma

-- 
Emma Jane Hogbin
[[ 416 417 2868 ][ www.xtrinsic.com ]]


More information about the thelist mailing list