This is the code I am working with: $sql = "SELECT address, city, state, zip, rent, dateavailable, available, description, leaseterms, unit, rooms, photodescription1, photodescription2, photodescription3, photoupload1, photoupload2, photoupload3 FROM `$areaname` WHERE id = $id"; $result = mysql_query($sql); echo mysql_error(); $line = mysql_fetch_array($result); $sql = "INSERT INTO `$areaname` (address, city, state, zip, rent, dateavailable, available, description, leaseterms, unit, rooms, photodescription1, photodescription2, photodescription3, photoupload1, photoupload2, photoupload3) VALUES (" . "'" . $line['address'] . "', '" . $line['city'] . "', '" . $line['state'] . "', '" . $line['zip'] . "', '" . $line['rent'] . "', '" . $line['dateavailable'] . "', '" . $line['available'] . "', '" . $line['description'] . "', '" . $line['leaseterms'] . "', '" . $line['filename'] . "', '" . $line['unit'] . "', '" . $line['rooms'] . "', '" . $line['photodescription1'] . "', '" . $line['photodescription2'] . "', '" . $line['photodescription3'] . "', '" . $line['photoupload1'] . "', '" . $line['photoupload2'] . "', '" . $line['photoupload3'] . "')"; Code (markup): And this is the error I am getting Unknown column 'photoupload1' in 'field list' Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/content/58/5459158/html/manage2/copylisting.php on line 17 Column count doesn't match value count at row 1 Code (markup): I know the column exist in the table and I don't have problems with other parts of the code that uses the same table and columns. Any ideas?
Not saying this is the solution, but try a mysql_fetch_assoc($result) instead of array. See what that does for you.