Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
universe:ifu:applicants.php [ 1 Feb 2007 22:56] – external edit 127.0.0.1 | universe:ifu:applicants.php [ 4 Jan 2015 12:47] (current) – james | ||
---|---|---|---|
Line 83: | Line 83: | ||
elseif($gen> | elseif($gen> | ||
{ $Genetics=" | { $Genetics=" | ||
- | $seed1=rand(1, | ||
- | $seed2=rand(1, | ||
- | include("/ | ||
- | include("/ | ||
- | $Surname | + | // connect to MySQL server and select the IFU database |
+ | include ("/ | ||
+ | include ("/ | ||
+ | $db = mysql_select_db(' | ||
+ | |||
+ | // randomly select a group of names from the database | ||
+ | $sql = 'SELECT | ||
+ | $names | ||
+ | |||
+ | // step through the selected list of names to get a surname and forename from separate rows | ||
+ | while ($row=mysql_fetch_array($names, | ||
+ | { | ||
+ | extract($row); | ||
+ | $LastName = $Surname; | ||
+ | next($row); | ||
+ | |||
+ | // then randomly take a firstname of the correct gender from the same list | ||
+ | if ($Gender==$sex) | ||
+ | { | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | } | ||
+ | |||
- | $FirstName = mysql_query(" | ||
echo " | echo " | ||
Line 108: | Line 129: | ||
} while ($appl< | } while ($appl< | ||
echo "</ | echo "</ | ||
- | </ | + | </ |