SarcasticDwarf
Diamond Member
I have this:
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$bid = $line['bookid'];
$votes = $line['votes'];
$avgvote = $line['avgvote'];
$avgvotew = $line['avgvotew'];
$sql2 = "INSERT INTO rating_averages (bookid, rating_average, rating_weighted, votes, updated) VALUES ($bid, $avgvote, $avgvotew, $votes, NOW())";
$result2 = mysql_query($sql2);
}
I want to turn it into something I can execute via a remote database connection, not by PHP. Can anyone show me how to do this?
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$bid = $line['bookid'];
$votes = $line['votes'];
$avgvote = $line['avgvote'];
$avgvotew = $line['avgvotew'];
$sql2 = "INSERT INTO rating_averages (bookid, rating_average, rating_weighted, votes, updated) VALUES ($bid, $avgvote, $avgvotew, $votes, NOW())";
$result2 = mysql_query($sql2);
}
I want to turn it into something I can execute via a remote database connection, not by PHP. Can anyone show me how to do this?