-1

Please I need help. I need load random companies from database where sk_popis, kategorie1 and who it edit is NULL.

<?php

    if ($akce=="vyber_firmu") {
        $query=mysql_query("SELECT sk_popis, kategorie1, upravil FROM firmy_popisy INNER JOIN firmy ON firmy_popisy.id = firmy.id LIMIT 1");  
        $tmpq=mysql_fetch_array($query);

        header("Location: upravafirem.php?id=$tmpq[id]");
        exit;
    }
?>

Thanks for tips

1 Answers1

0

Add ORDER BY RAND() to your SQL query to return random rows.

You should note that the mysql_* extensions are deprecated and will be removed, you should use PDO or mysqli. See: The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead

Community
  • 1
  • 1
doublesharp
  • 26,888
  • 6
  • 52
  • 73