in my code I have the table itself created, I am just trying to copy all fields from one table into another
INSERT INTO $tbl_query (imagetargetpath, gamename, gamedirectory, like, dislike)
SELECT *
FROM $sql_tbl
WHERE gamename LIKE '%$item_searched%'
the table itself was created and structured like this
$tbl_query(`id` INT( 14 ) NOT NULL AUTO_INCREMENT ,
`imagetargetpath` VARCHAR( 80 ) NOT NULL ,
`gamename` VARCHAR( 50 ) NOT NULL , `gamedirectory` VARCHAR( 50 ) NOT NULL
, `like` INT( 14 ) NOT NULL , `dislike` INT( 14 ) NOT NULL ,PRIMARY KEY ( `id` )) ";
my goal is basically to copy the query results into a new table but have the $tbl_query have its own unique id numbers
Select only the columns you need:
FYI, this problem/question comes up a lot with databases, so it worth remembering how to do it