Selecting a random photo and profile from a database.
Posted: Sun Dec 14, 2003 10:34 am
I'm trying to modify a script I found on the internet. In its original form, it picks two photos and profiles, one man and one woman, from a database and displays it on a web page. I want it to pick four photos and profiles, two each, from the database. The problem I'm having is that it picks the same two profiles for each gender. (i.e. The two male profiles are the same person, as is the two female profiles.) I want it to pick different men and different women.
I know very little about php. Mostly I solve problems by changing things and seeing what the results are. But this one has me stumped.
Here's the code.
If you need more information let me know. Thanks.
I know very little about php. Mostly I solve problems by changing things and seeing what the results are. But this one has me stumped.
Here's the code.
Code: Select all
<td width="100%" valign="top">
<table cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="110"><a href="index.php?page=view_profile&id=<? echo $femaleї id ] ?>"><?
$fPhoto = $femaleїfilename_1];
if($fPhoto != "")
{
echo sysGetSmallImage("photos/$fPhoto", "");
}
else
{
?>
<img src="images/default_photo.gif" width="100" height="100">
<? } ?></a>
</td>
<td width="100%">
<font color="#000000"> Name: </font><? echo $femaleїlogin]; ?><br>
<font color="#000000"> Age: </font> <? echo $femaleage; ?><br>
<font color="#000000"> City: </font><? echo $femaleї city ]; ?><br>
<font color="#000000"> State: </font><? echo $femaleї state ]; ?><br>
<font color="#000000"> Seeking: </font><? echo $femaleї looking_for ]; ?><br>
<br>
</td>
</tr>
<tr valign="top">
<td width="110"><a href="index.php?page=view_profile&id=<? echo $maleї id ] ?>"><?
$fPhoto = $maleїfilename_1];
if($fPhoto != "")
{
echo sysGetSmallImage("photos/$fPhoto", "");
}
else
{
?>
<img src="images/default_photo.gif" width="100" height="100">
<? } ?></a>
</td>
<td width="100%">
<font color="#000000"> Name: </font><? echo $maleїlogin]; ?><br>
<font color="#000000"> Age: </font> <? echo $maleage; ?><br>
<font color="#000000"> City: </font><? echo $maleї city ]; ?><br>
<font color="#000000"> State: </font><? echo $maleї state ]; ?><br>
<font color="#000000"> Seeking: </font><? echo $maleї looking_for ]; ?><br>
<br>
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="110"><a href="index.php?page=view_profile&id=<? echo $femaleї id ] ?>"><?
$fPhoto = $femaleїfilename_1];
if($fPhoto != "")
{
echo sysGetSmallImage("photos/$fPhoto", "");
}
else
{
?>
<img src="images/default_photo.gif" width="100" height="100">
<? } ?></a>
</td>
<td width="100%">
<font color="#000000"> Name: </font><? echo $femaleїlogin]; ?><br>
<font color="#000000"> Age: </font> <? echo $femaleage; ?><br>
<font color="#000000"> City: </font><? echo $femaleї city ]; ?><br>
<font color="#000000"> State: </font><? echo $femaleї state ]; ?><br>
<font color="#000000"> Seeking: </font><? echo $femaleї looking_for ]; ?><br>
<br>
</td>
</tr>
<tr valign="top">
<td width="110"><a href="index.php?page=view_profile&id=<? echo $maleї id ] ?>"><?
$fPhoto = $maleїfilename_1];
if($fPhoto != "")
{
echo sysGetSmallImage("photos/$fPhoto", "");
}
else
{
?>
<img src="images/default_photo.gif" width="100" height="100">
<? } ?></a>
</td>
<td width="100%">
<font color="#000000"> Name: </font><? echo $maleїlogin]; ?><br>
<font color="#000000"> Age: </font> <? echo $maleage; ?><br>
<font color="#000000"> City: </font><? echo $maleї city ]; ?><br>
<font color="#000000"> State: </font><? echo $maleї state ]; ?><br>
<font color="#000000"> Seeking: </font><? echo $maleї looking_for ]; ?><br>
<br>
</td>
</tr>
</table>
</td>