Jubba
January 24th, 2003, 08:54 PM
I would like to take my information from my db query and convert it into a mulitdimensional array. Not sure if its even possible...
Code:
<?
$userID = mysql_connect("localhost", "userName", "userPass");
mysql_select_db("dbName", $linkID);
$resultID = mysql_query("SELECT nID, nText, nLink, nTarget FROM links", $userID);
for($x= 0; $x < mysql_num_rows($resultID); $x++)
{
$row = mysql_fetch_assoc($resultID);
$nOuter = array(
$nInner[$x] = array("nText" => $row[nText], "nLink" => $row[nLink], "nTarget" => $row[nTarget]);
)
}
print $nOuter[0][nText];
?>
Parse error: parse error, expecting `')'' on line 11
Cheers,
Code:
<?
$userID = mysql_connect("localhost", "userName", "userPass");
mysql_select_db("dbName", $linkID);
$resultID = mysql_query("SELECT nID, nText, nLink, nTarget FROM links", $userID);
for($x= 0; $x < mysql_num_rows($resultID); $x++)
{
$row = mysql_fetch_assoc($resultID);
$nOuter = array(
$nInner[$x] = array("nText" => $row[nText], "nLink" => $row[nLink], "nTarget" => $row[nTarget]);
)
}
print $nOuter[0][nText];
?>
Parse error: parse error, expecting `')'' on line 11
Cheers,