Hi Rincewind,
Thanks for the suggestion, although that produced the same error. Then I tried this variation:
$newname = $row["username"];
$newmail = $row["useraddress"];
$newpass = $row["userpassword"];
$newquery = "INSERT INTO new (uname, email, pass) VALUES ('" . $newname . "', '" . $newmail . "', '" . $newpass . "'), $newlink ";
The statement below works (so I know I am able to execute a query on that table):
$newquery = "INSERT INTO new (uname, email, pass) VALUES ('one', 'two', 'three')";
I'm kind of wondering if the problem is because mysql wants this type of syntax:
1.7.4.2 SELECT INTO TABLE
MySQL Server doesn't yet support the Oracle SQL extension: SELECT ... INTO TABLE .... MySQL Server supports instead the ANSI SQL syntax INSERT INTO ... SELECT ..., which is basically the same thing. See section 6.4.3.1 INSERT ... SELECT Syntax.
INSERT INTO tblTemp2 (fldID) SELECT tblTemp1.fldOrder_ID
FROM tblTemp1 WHERE tblTemp1.fldOrder_ID > 100;
Alternatively, you can use SELECT INTO OUTFILE... or CREATE TABLE ... SELECT.
Are you supposed to not use the hash and just INSERT INTO newtable (fields) SELECT FROM oldtable.field ??
Maybe I would be better off writing the stuff to a file and then closing the first table and opening the 2nd one to INSERT INTO??
Thanks for any help!