Forum Moderators: open
// Formulate Query
$query = "SELECT embed1, length, email, header FROM redirect WHERE continent = 'Africa' ORDER BY RAND() LIMIT 1";
// Perform Query
$result = mysql_query($query);
// Check result
// This shows the actual query sent to MySQL, and the error. Useful for debugging.
if (!$result) {
$message = 'Invalid query: ' . mysql_error() . "\n";
$message .= 'Whole query: ' . $query;
die($message);
}
// Use result
while ($row = mysql_fetch_assoc($result)) {
echo $row['embed1'];
echo $row['length'];
echo $row['email'];
echo $row['header'];
}