Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $randomQ = @mysql_query( "SELECT * FROM `Pastes` ORDER BY RAND() LIMIT 1" );
- if ( mysql_num_rows( $randomQ ) == 0 )
- {
- echo "No pastes are available to show a random paste.";
- }
- else
- {
- $randomA = @mysql_fetch_array( $randomQ );
- echo '<a href="pastes.php?id=' . $randomA["PasteID"] . '">Random Paste</a>';
- }
- ?>
Add Comment
Please, Sign In to add comment