Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
universe:ifu:applicants.php [ 1 Feb 2007 22:56] – external edit 127.0.0.1universe:ifu:applicants.php [ 4 Jan 2015 12:47] (current) james
Line 83: Line 83:
     elseif($gen>4)     elseif($gen>4)
       { $Genetics="Perfect"; }       { $Genetics="Perfect"; }
-$seed1=rand(1,1200); 
-$seed2=rand(1,1200); 
-include("/var/www/html/IFU/sqlconnect.php"); 
-include("/var/www/html/IFU/sqlconnect2.php"); 
  
-$Surname mysql_query("SELECT Surname FROM Names Where NameID=$seed1");+// connect to MySQL server and select the IFU database 
 +include ("/var/www/html/IFU/sqlconnect.php");  
 +include ("/var/www/html/IFU/sqlconnect2.php");  
 +$db mysql_select_db('full-moon_info_-_IFU',$connection); 
 + 
 +// randomly select a group of names from the database  
 +$sql = 'SELECT FROM `Names` ORDER BY Rand() LIMIT 10'; 
 +$names mysql_query($sql); 
 + 
 +// step through the selected list of names to get a surname and forename from separate rows 
 +  while ($row=mysql_fetch_array($names,MYSQL_ASSOC)) 
 +  { 
 +    extract($row); 
 +    $LastName = $Surname;  
 +    next($row); 
 + 
 +// then randomly take a firstname of the correct gender from the same list 
 +    if ($Gender==$sex) 
 +    {  
 +     $Forename = $FirstName; 
 +     next($row); 
 +     extract($row); 
 +     end($row); 
 +    } 
 +   } 
 + 
  
-$FirstName = mysql_query("SELECT Forename FROM Names WHERE Gender=$sex AND NameID>=$seed2 ORDER BY Surname LIMIT 1"); 
  
 echo " echo "
Line 108: Line 129:
 } while ($appl<=$apps);  } while ($appl<=$apps); 
 echo "</table>"; echo "</table>";
-</php>+</php> 
Print/export
QR Code
QR Code Applicants (generated for current page)