In this code I get a proper count from the SELECT, but the SELECT INTO TEMPORARY TABLE returns -1.
$dbh = DBI->connect(...);$sth = $dbh->prepare("SELECT data,name FROM saved_searches order by random()");
$sth->execute(); print "Rows=".$sth->rows."\n";$sth = $dbh->prepare("SELECT data,name INTO TEMPORARY TABLE foo_1 FROM saved_searches order by random()");
$sth->execute(); print "Rows=".$sth->rows."\n";