I have this query :
INSERT INTO db1.outbox (DestinationNumber, TextDecoded)
SELECT User.CellPhone, '$SMSMessage' as TextDecoded
FROM db2.User
WHERE User.PurchaseDate BETWEEN 2012-01-01 AND 2012-01-31
it does multiple rows insertion to ‘outbox’ table. but I don’t know how many rows inserted. how to have number of rows inserted from that SQL syntax? thanks.
update
I got ‘-1’ as result of this command :
$insertedRows = mysql_query("SELECT ROW_COUNT()");
$rowInserted = mysql_fetch_array($insertedRows);
$rowInserted = $rowInserted[0];
echo $rowInserted;
but I see there are 27 rows inserted on my table. what did I do wrong?
put this on your last statement;
UPDATE 1
how about using
mysql_affected_rows, example