Jump to content

return a recordset


otuatail

Recommended Posts

functions.php

function readconfig()
{
	$sqlReadConfig = "SELECT * FROM whatadrama_config";
	$qReadConfig = mysql_query($sqlReadConfig) or die ("E201-100A");
	$rs = mysql_fetch_array($qReadConfig) or die ("E201-100B");
	//echo $rs[0] . " - " . $rs[1]  . " - " . $rs[2] . " - " . $rs[3]; // *** This works fine ***
	//exit;
	return $rs;
}


webpage.php

<?
$rs = readconfig();
echo $rs[0];
?>


I can read the contents of a table in my functions file but when I comment out the reading code and return $rs; I can't read it in the main web page.

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.