I've tried a million different ways and they all do what I don't want them to. Let me explain:
The words come up like so:
Code: Select all
69654) Neuroanatomy
26444) Cauline
76930) Phoneticism
68923) Nailless
23968) Buchu
82004) Puggy
72758) Outcharm
16904) Aperient
14058) Adhere
29330) Coasting
Total: 39 points
Minimum Length <input field here>
Maximum Length <input field here>
# of Words: <input field here>
Save List as Today'sCode: Select all
$_SESSION['words'] = array();
$total = 0;
if(empty($_SESSION['words'])){
$getWords = mysql_query("SELECT word, id, LENGTH(word) AS len FROM all_words WHERE LENGTH(word) > $min AND LENGTH(word) < $max ORDER BY RAND() LIMIT 0, $limit");
while($r = mysql_fetch_assoc($getWords)){
$today[] = $r['word'];
$total += $r['len'];
//display code removed... just echoing <tr>, <td> etc...
}
if(isset($_GET['do']) && $_GET['do'] == 'savelist'){
foreach($today as $todo){
$_SESSION['words'][] = $todo;
}
}
}