After the data is displayed I want the exact text to get deleted from MySQL I have a random generator that gets data from a row and displays it random
Architecture : "minecraft" and inside the table its a row named "list"
<?php
// Connect to database server
mysql_connect("localhost", "bdweb_panel", "password") or die (mysql_error ());
// Select database
mysql_select_db("bdweb_panel") or die(mysql_error());
$strSQL = "SELECT * FROM minecraft";
// Execute the query (the recordset $rs contains the result)
$rs = mysql_query($strSQL);
// Array to hold all data
$rows = array();
// Loop the recordset $rs
// Each row will be made into an array ($row) using mysql_fetch_array
while($row = mysql_fetch_array($rs)) {
// add row to array.
$rows[] = $row;
}
// Close the database connection
mysql_close();
// Max rand number
$max = count($rows) - 1;
// print out random combination of data.
echo $rows[rand(0, $max)][0] . " "
?>
Update :
To be more explicit
This is the architecture from the DB
and the php page with a refresh button
Each time a user is pressing the refresh button he gets a data from the DB (EX : test1, and if he press once again test2 or test3 or test 4 - all random data) all random. Once he gets for example test 1, the text 1 data from the DB deletes so it will not be generated once more again, so after he press the refresh button he will display a data and at the same time he will delete it from the data base.