[member=86323]trevor1[/member]
[member=46186]Kevin Rubio[/member] was meaning something like this. I too try and stay as far away from wordpress as possible…
this code is just an example to show you how a prepared statement would look with the information you provided.
[php]<?php
if ($stmt = $mysqli->prepare(“SELECT ad_id FROM ad_table ORDER BY RAND() LIMIT 10”)) {
?>[/php]
EDIT, realized i pasted the wrong code … here is the corrected.
here is a more complete code from a snippit of code i use for a bug report listing …
[php]$rand = “SELECT ROUND(RAND() * (SELECT COUNT(*) FROM Bugs))”;
$offset = $pdo->query($rand)->fetch(PDO::FETCH_ASSOC);
$sql = “SELECT * FROM Bugs LIMIT 1 OFFSET :offset”;
$stmt = $pdo->prepare($sql);
$stmt->execute( $offset );
$rand_bug = $stmt->fetch();[/php]