Hello Firends.

I have the following code. I am getting the query results but they are not displaying 
in the table. I presume there is something wrong with a "}" in the "while" statement. 
Can someone please tell me where I am wrong?

Quote :


<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>

<p>&nbsp;</p>
<p>&nbsp; </p>
<?php
require 'common.inc';

if(!($link=mysql_pconnect($DB_SERVER,$DB_LOGIN,$DB_PASSWORD))){
  DisplayErrMsg(sprintf("internal error %d:%s\n",
     mysql_errno(),mysql_error()));
  return 0;
  }
 if ($link){
   Print "";
   }  else {
   Print "No connection to the database";
   }
   if (!mysql_select_db("MyDomain_com")){
    Print "Couldn't connect database";
 } else {
 Print ""."<br>\n";
 }?>
 
 
<table width="75%" border="1">
  <tr bgcolor="#006600"> 
    <td><strong><font color="#FFFFFF" size="2" face="Arial, Helvetica, 
sans-serif">Company's 
      name</font></strong></td>
    <td><strong><font color="#FFFFFF" size="2" face="Arial, Helvetica, 
sans-serif">Company's 
      address</font></strong></td>
    <td><strong><font color="#FFFFFF" size="2" face="Arial, Helvetica, 
sans-serif">Company's 
      website</font></strong></td>
    <td><strong><font color="#FFFFFF" size="2" face="Arial, Helvetica, 
sans-serif">Company's 
      logo</font></strong></td>
  </tr>
  <?PHP 
  $sql="select * from CompanyData" ;  
   if ($result=mysql_query($sql)) {
           $numofrows=mysql_num_rows($result);       
     }
  
 while($row=mysql_fetch_array($result)){ 
  ?>
  <tr> 
    <td width="12%" align="center" height="6"><font face="Tahoma" 
color="#000000"><?php Print " $row[CompanyName]" ;?></font>  &nbsp;</td>
   <td width="12%" align="center" height="6"><font face="Tahoma" color="#000000"><?php 
Print " $row[CompanyAddress]" ;?></font>  &nbsp;</td>
    <td width="12%" align="center" height="6"><font face="Tahoma" 
color="#000000"><?php Print " $row[Companywebsite]" ;?></font>  &nbsp;</td>
    <td width="12%" align="center" height="6"><font face="Tahoma" 
color="#000000"><?php Print " $row[Companytel]" ;?></font>  &nbsp;</td>
  </tr>
</table>
<p>&nbsp;</p>
</body>
</html>



Unquote

Thanks very much
denis

Reply via email to