Jump to content


Photo

[solved]mixed information shown


  • Please log in to reply
2 replies to this topic

#1 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 09 September 2006 - 12:09 PM

Hi there all hopes all ok can you kindly show me how to show from a mysql database how to mix all the entrys up and show them all in mixed view .

example if you had a database called members and you wanted to show all members but all shown as mixed and jumbled up cheers.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#2 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,025 posts

Posted 09 September 2006 - 12:19 PM

This will output names in random order

<?php

$sql = "SELECT membername FROM members
        ORDER BY RAND()";
$result = mtsql_query ($sql) or die (mysql_error() );
while ($row = mysql_fetch_assoc($result)) {

        echo $row['membername'] , '<br>';
}
?>

If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#3 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 09 September 2006 - 07:51 PM

thank you cheers.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users