The code below is what I have on a page that is giving feedback to the sites administrator to see if people have a username and password, as we give them out after they have registered.

PHP Code:
<?

$query  
"SELECT * FROM Register Order by RegId desc";
$result mysql_query($query);

// Function to read if a client has a Username & Password 
function myUserPass(){
$queryPass "SELECT Username, Password, RegId FROM Register";
$rapid mysql_query($queryPass);
$rapid['Password'] = Horse;
    
if (
$rapid['Password'] == "Horse" ){
    echo 
"2";
    echo 
$rapid['Password'];
    } else {
    echo 
"1";
    }
}

while(
$row mysql_fetch_array($resultMYSQL_ASSOC))
{

// Query the database and get the count    
$resultCount mysql_query("SELECT * FROM logdetails Where Log_Id={$row['RegId']}"); 
$num_rows mysql_num_rows($resultCount);
// End of query

echo "<div style='position:relative; color:#000000; border-top:#666666 solid 1px; width:700px; height:257px'>".
"<div style='position:relative; float:left; width:450px; height:257px; border-right:#666666 solid 1px;'><br>First Name: {$row['FirstName']} <br>" .
"Last Name: {$row['LastName']} <br>" .
"Company: {$row['Company']} <br>" .
"Address: {$row['Address']} <br>" .
"PostCode: {$row['PostCode']} <br>" .
"Country: {$row['Country']} <br>" .
"Email: <a href=mailto:{$row['Email']}]?subject=TourCheck>{$row['Email']} </a><br>" .
"Tel: {$row['Tel']} <br>" 
"Fax: {$row['Fax']} <br><br>".
"Click <i><a href='#'>here</a></i> to view log in records. <span style='font-size:11px; color:#ff9000'>[$num_rows]</span><br><br>".
"<i><a style='font-size:11px; color:#ff9000' href='logIn.php#topList'>Return To Top [^]</a></i><br><br></div>".
"<div style='position:relative; width:249px; height:257px; float:right; background-color:#cccccc; font-size:12px;'><p style='padding-left:10px; padding-top:6px'>{$row['FirstName']} has logged in <span style='color:#ff0000;'>[$num_rows]</span> times.<br/><br/>Username: [<img width=11px src='../site_images/Tick.jpg' />] <br/><br/>Password: [ " myUserPass() . " ] </p></div></div>";

?>
Where I'm having trouble is that last line calling a function which id does, but I'm not getting the result I wont.

the myUserPass function is looking at the username pad password and then giving a 1 or 0 as to whether a password exists, but I cant get that bit working.

I know there a lot there, but I thought it best to put the lot rather than picking it out.