Skip to main content
1 of 2

I think you might have an syntax problem in your TSQL. If your doing

$table_name = $wpdb->prefix . 'quotes';

should you not then have

$sql = $wpdb->prepare( "
    SELECT *
    FROM ".$table_name."
    ORDER BY RAND()
    LIMIT 1
");