I was looking for a way to create a collaboration widget. So I have a mysql database and a table (called translations) and a little script to allow users to translate one page at a time.
But I'm not quite sure about my script. I do not think this is effective enough. First, mysql retrieves all rows with an empty "en" column, and then one of them appears across the screen after a while. Is there any other way to do this? This is the code:
$result = mysql_query("SELECT * FROM translations WHERE en IS NULL OR en=''") or die(mysql_error());
$Randnum=rand(0,mysql_num_rows($result)-1);
$i=0;
while($Col = mysql_fetch_array($result))
{
if ($i==$Randnum)
{
echo "\"".$Col['es']."\"<br><br>Translate it to English: <br>";
}
$i++;
}
- "echo $Col [$ Randnum] ['es']" "echo $Col. $Randnum ['es']" while while . ? . script $Col 'en' col, ! ( , , ). 'en' - , , . , ORDER BY.