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);
What do you mean "write to array"??
$array = array($mydata->AUS,$mydata->id);
That?
2. Then I need to create $SQL
foreach ($authors as something) { $sql += "INSERT INTO newtable VALUES ($AUS, $id);\r\n"; }
+= is addition. I doubt that's what you want.
$sql .= "INSERT INTO newtable VALUES ({$mydata->AUS},{$mydata->id});\r\n";
Not sure why you're joining all these queries together, you can only run one at a time with MySQL...
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php