Hello Guys,
   
  I have 2 MYSQL tables. The first one is containing user_ID and the
second one is containing author_ID. 
I want to list and display up to 15 author_IDs at the same time, and whenever
author_ID and user_ID are matching, the author_ID will be bolded. 
  I have written some code myself,  but what I have now is only displaying 1 
author_ID instead of 15.
  Does anybody know how to work this out with .php? 

  <?
include("password.php");
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="select * from AUTHORS DESC LIMIT 15";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
  $i=0;
while ($i < $num) {
$id=mysql_result($result,$i,"id");
$name_U=mysql_result($result,$i,"user_name");

  //-----------------------------//
//include("password.php"); u have already included this on the top
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "this server is dying");
$query="SELECT * FROM REGISTERED WHERE ='$name_U'";
$result=mysql_query($query);
$num1=mysql_numrows($result);
mysql_close();
//-----------------------------//

  if($num1>="1"){
echo "<b>$name_U</b>";
}//end IF num1
else {
echo "$name_U";
}//end else
++$i;
}//end while
?>


           

   
  Thankz in advance


                
---------------------------------
Do you Yahoo!?
 Get on board. You're invited to try the new Yahoo! Mail Beta.

[Non-text portions of this message have been removed]






Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to