I have 3 fields from 3 tables I want to combine into a temp table. They are all named the same and they are all the same datatype. The syntax I got for the temp table came from what I read at mysql.com. I'm getting an error in the mysql_num_rows() function. Can anyone see a problem with my code.
db_connect(); //connects to DB
mysql_query("CREATE TEMPORARY TABLE temp_table (
`w_name` VARCHAR( 50 ) NOT NULL ,
`artist` VARCHAR( 100 ) NOT NULL ,
`song` VARCHAR( 100 ) NOT NULL)");
$result = mysql_query("INSERT INTO temp_table (w_name) SELECT roster.w_name FROM roster");
$num_results=mysql_num_rows($result);
I do not have mysql 4.0.xx running on my server so I can not use the UNION operator which would be a great solution right now. Any ideas? Thanks in advance.