insert from selects

From: Date: Sun, 06 Aug 2000 14:33:17 +0000
Subject: insert from selects
References: 1  Groups: php.db php.general 
Request: Send a blank email to php-db+get-263@lists.php.net to get a copy of this message
hello, I have a query like, $sql = "INSERT INTO articles (title, author, intro, body, related, extra) SELECT title, author, intro, body, related, extra FROM art_queue WHERE aid='$aid'"; $result mysql_query("$sql"); It runs perfectly fine but I don't get either, 1.) number of affected rows by mysql_affected_rows($result) function. 2.) number of rows matched by mysql_num_rows($result) function. both say $result is not a valid MySQL Link identifier. how am I supposed to know if such queries of type "insert into (cols) select ... from" have done exactly what they were supposed to. that is, inserted and selected n number of rows. right now one can only get if query fails or succeeds from mysql_query(). - cnb.

« previous php.db (#263) next »