create and read array
| From: | John Taylor-Johnston | Date: | Sat, 11 Sep 2004 03:50:44 +0000 |
| Subject: | create and read array | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-196385@lists.php.net to get a copy of this message | ||
Can someone help me, show me how to do this please?
1. How do I write $mydata->AUS and $mydata->id into an array?
$authors = array();
while ($mydata = mysql_fetch_object($news))
{
# echo "$mydata->AUS, $mydata->id\n";
??? write to array
}
mysql_close($myconnection);
2. Then I need to create $SQL
foreach ($authors as something)
{
$sql += "INSERT INTO newtable VALUES ($AUS, $id);\r\n";
}
I am reading http://ca3.php.net/manual/en/language.types.array.php
but don't really get it.
Can I do $sql += "blah"; or do I have to write $sql = $sql + "blah";?