chappill
New Member
- Messages
- 74
- Reaction score
- 0
- Points
- 0
PHP Code:
</div> Is some code I have for selecting the rows from a table, counting them and randomizing them between 2 and the result.
What I have after that is:
<div class="code_header">PHP Code:
But this doesn't work... It was a guess at it actually happening and much to my non suprisment... It didn't work. Is there anything like this that may work (Something that will delete an amount of rows randomly so instead of starting at 1 all the time it may start at row 34288 if there were that many).
I was thinking keep what I have at the top then below that have:
<div class="code_header">PHP Code:
Then having:
<div class="code_header">PHP Code:
All help will be much appreciated!
PHP:
$slavesel = mysql_query("SELECT * FROM `slaves`");
$result = mysql_num_rows($slavesel);
$randomdel = rand(2,$result);
</div> Is some code I have for selecting the rows from a table, counting them and randomizing them between 2 and the result.
What I have after that is:
<div class="code_header">PHP Code:
PHP:
$delete = mysql_query("DELETE FROM slaves AMOUNT '$randomdel'");
I was thinking keep what I have at the top then below that have:
<div class="code_header">PHP Code:
PHP:
$rand2 = rand(1,$randomdel);
<div class="code_header">PHP Code:
PHP:
$delete = mysql_query("DELETE FROM slaves LIMIT $rand2, $randomdel");