array
| From: | John Taylor-Johnston | Date: | Wed, 08 Sep 2004 04:30:57 +0000 |
| Subject: | array | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-196099@lists.php.net to get a copy of this message | ||
I'm reading data. Can I open a connection within a connection and write data to another
$db.$table or do I have to write my data to an array. In an array, how do I do this?
I've looked at array_push, but don't think this is what I want?
$authors = array();
array_push($singleauthor,$mydata->id);
I've been reading http://ca3.php.net/manual/en/function.array-push.php
John
-------------------------------------------------------
$myconnection = mysql_connect($server,$user,$pass);
mysql_select_db($db,$myconnection);
$news = mysql_query("select id,AUS from $table");
while ($mydata = mysql_fetch_object($news))
{
$mydata->AUS = str_replace(" ;", ";", $mydata->AUS);
$mydata->AUS = str_replace("; ", ";", $mydata->AUS);
$tempauthors = explode(";", $mydata->AUS);
foreach ($tempauthors as $singleauthor)
{
if ($singleauthor <> "")
{
echo
"<tr>\n<td>$singleauthor</td>\n<td>$mydata->id</td>\n</tr>\n";
}
}
}