note 102297 added to function.rand

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
Well, i don't know much about php and i try to get my own solutions:

<?php

include('config.php');

$lastid= 'lastid';

$result = mysql_query("SELECT id AS $lastid FROM registered_members ORDER BY id DESC LIMIT 0,1");

while($row = mysql_fetch_array($result))
  {
  $lastid2= $row[$lastid];} 
    
  echo rand(0, $lastid2);
  
?>

This will get the latest value from ID row, once this is done, the rand($min, $max) will work. Any inconviniet? Just need to generate random numbers between the 0 and the latest id entry on the registered_members
----
Server IP: 69.147.83.197
Probable Submitter: 89.152.4.231
----
Manual Page -- http://www.php.net/manual/en/function.rand.php
Edit        -- https://master.php.net/note/edit/102297
Del: integrated  -- https://master.php.net/note/delete/102297/integrated
Del: useless     -- https://master.php.net/note/delete/102297/useless
Del: bad code    -- https://master.php.net/note/delete/102297/bad+code
Del: spam        -- https://master.php.net/note/delete/102297/spam
Del: non-english -- https://master.php.net/note/delete/102297/non-english
Del: in docs     -- https://master.php.net/note/delete/102297/in+docs
Del: other reasons-- https://master.php.net/note/delete/102297
Reject      -- https://master.php.net/note/reject/102297
Search      -- https://master.php.net/manage/user-notes.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.