Jump to content

*SOLVED* MySql Not Showing


JackJack

Recommended Posts

The actual text i type in shows but the MySql code i type doesn't work.
Here is a screeny and a the code.
Please Help

[img src=\"http://img96.imageshack.us/img96/1569/screeny6yg.png\" border=\"0\" alt=\"IPB Image\" /]

[code]
<? include ("header.php"); ?>

<?php
if($view > 0){
?>
    <?php
    $companyssel = mysql_query("SELECT * FROM companys where id=$view");
    while ($companys = mysql_fetch_array($companyssel)) {
    ?>
    <center>
      <p><img src="<?php echo '$companys[avatar]'; ?>" alt="Companys Avatar" height="150" width="150" /><br />
      <br /></p>
    </center>

      <table width="37%" height="110" border="2" cellpadding="1">
        <tr>
          <th width="51%" height="22" bgcolor="#CCCCCC" scope="row"><div align="center">Company Name: </div></th>
          <td width="49%"><div align="center"><?php echo '$companys[name]'; ?></div></td>
        </tr>
        <tr>
          <th height="22" bgcolor="#CCCCCC" scope="row"><div align="center">Company Owner: </div></th>
          <td><div align="center"><?php echo '$companys[owner]'; ?></div></td>
        </tr>
        <tr>
          <th height="22" bgcolor="#CCCCCC" scope="row"><div align="center">Number of Members: </div></th>
          <td><div align="center"><?php echo '$companys[members]'; ?></div></td>
        </tr>
        <tr>
          <th height="22" bgcolor="#CCCCCC" scope="row"><div align="center">Profile : </div></th>
          <td><textarea name="textarea" cols="20" rows="3"><?php echo '$companys[profile]'; ?></textarea>
          </td>
        </tr>
        <tr>
          <th height="22" bgcolor="#CCCCCC" scope="row">Currently Recruiting:
          <div align="center"></div></th>
          <td><div align="center"><?php echo '$companys[recruiting]'; ?></div></td>
        </tr>
    </table>
      <?php
      if($companys[recruting] == 'Yes'){
      ?>
      <a href="join.php?join=<?php echo "$companys[id]"; ?>" target="mainframe"><u>Join</u></a>
        <?php }?>
        <?php }?>
        <?php }else{ ?>
        </div>
      </p>
      <h1 align="center" class="style2"><u>Company District</u> </h1>
<p align="left" class="right">Welcome to the company district.<br>
Here you can join or create a company.</p><br>
<center>
  <table width="66%" border="2" cellpadding="1">
    <tr>
      <td width="24%" bgcolor="#CCCCCC"><div align="center"><strong>Name</strong></div></td>
      <td width="20%" bgcolor="#CCCCCC"><div align="center"><strong>Owner</strong></div></td>
      <td width="16%" bgcolor="#CCCCCC"><div align="center"><strong>Type</strong></div></td>
      <td width="20%" bgcolor="#CCCCCC"><div align="center"><strong>Members </strong></div></td>
      <td width="20%" bgcolor="#CCCCCC"><div align="center"><strong>Recruiting</strong></div></td>
    </tr>
    <?php

    $companyssel = mysql_query("SELECT * FROM `companys` order by `id` asc");
    while ($companys = mysql_fetch_array($companyssel)) {
    ?>
    <tr>
      <td><div align="center"><a href=district.php?view=<?php echo"$companys[id]"; ?> target="mainframe"><?php echo "$companys[name]"; ?></a></div></td>
      <td><div align="center"><?php echo "$companys[owner]"; ?></div></td>
      <td><div align="center"><?php echo "$companys[type]"; ?></div></td>
      <td><div align="center"><?php echo "$companys[members]"; ?></div></td>
      <td><div align="center"><?php echo "$companys[recruiting]"; ?></div></td>
    </tr>
    <?php }?>
  </table>
</center>
  <p>
    <?php
  if($stat[company_status] == 1){
  ?>
    <br>
  </p>
  <p>  Your currently in the company <?php echo "$stat[company_name]"; ?>. </p>
      <br><br>
  <?php } ?>
  <?php
if($stat[company_status] == 0){
?>

<p>  Your currently not in company.<br><br>
  To join a company click on its name or <br>
  Click <a href="create.php" target="mainframe"">here to create one. </a> </p>
<?php } ?>
<?php } ?>
[/code]

Thank you

JJ

Ps. Sorry about the large chunk of code i don't know which bit is wrong.
Link to comment
https://forums.phpfreaks.com/topic/7473-solved-mysql-not-showing/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.