[thelist] php/mySQL error...

Tom Dell'Aringa pixelmech at yahoo.com
Fri Jul 18 13:23:48 CDT 2003

Hi folks,

Can't figure this out:

mysql_fetch_array(): supplied argument is not a valid MySQL result

I wrote a function to get some content:

function PrintSidebarMain()
	// select sidebarMain content
	$result = @mysql_query("SELECT sidebarMain FROM sidebar");
	// Get db results
	$qResult = mysql_fetch_array($result);
	$sbMain = $qResult["sidebarMain"];

	print $sbMain;

which is called in my page:

<?= PrintSidebarMain(); ?> (not sure if I need the "=" there...)

Anyway, the same code works for another query I have, but not here. I
do have a valid db connection, and I do have content in the db.

What have I done wrong?


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