Jump to content

Output specific row data


Shamrox

Recommended Posts

I've got a standard web page outputting data about a client. one side lists all the contacts for the company that I'm doing with a standard repeat region.

I'd like to output a specific row to a different section of the  page, but not sure how to call a specific row (i.e.  row 1,2 and 3)

 

Thanks in advance.

Link to comment
Share on other sites

Right now I have

 

Query:

$colname_rs_contactdis = "-1";
if (isset($_GET['clientid'])) {
  $colname_rs_contactdis = $_GET['clientid'];
}
mysql_select_db($database_spectrum, $spectrum);
$query_rs_contactdis = sprintf("SELECT * FROM spec_contacts WHERE companyid = %s ORDER BY `level` ASC", GetSQLValueString($colname_rs_contactdis, "int"));
$rs_contactdis = mysql_query($query_rs_contactdis, $spectrum) or die(mysql_error());
$row_rs_contactdis = mysql_fetch_assoc($rs_contactdis);
$totalRows_rs_contactdis = mysql_num_rows($rs_contactdis);

$colname_rs_clientdis = "-1";
if (isset($_GET['clientid'])) {
  $colname_rs_clientdis = $_GET['clientid'];
}

 

<?php do { ?>
      <table width='100%' border='0' id="contacttable"> 
        <tr>
            <td nowrap='nowrap'> </td>                </tr>
        <tr>
          <td nowrap='nowrap'><?php echo $row_rs_contactdis['firstname']; ?> <?php echo $row_rs_contactdis['lastname']; ?></td>		
            </tr>
        <tr>
          <td nowrap='nowrap'>P: <?php echo $row_rs_contactdis['phone']; ?>  Ext <?php echo $row_rs_contactdis['extension']; ?></td>		
            </tr>
        <tr>
          <td nowrap='nowrap'>F: <?php echo $row_rs_contactdis['fax']; ?></td>                
            </tr>
        <tr>
          <td nowrap='nowrap'><?php echo $row_rs_contactdis['email']; ?></td>                
            </tr>
        <tr>
          <td nowrap='nowrap'><?php echo $row_rs_contactdis['address1']; ?></td>                
            </tr>
        <tr>
          <td nowrap='nowrap'><?php echo $row_rs_contactdis['address2']; ?></td>                
            </tr>
        <tr>
          <td nowrap='nowrap'><?php echo $row_rs_contactdis['city']; ?>, <?php echo $row_rs_contactdis['state']; ?> <?php echo $row_rs_contactdis['zip']; ?></td>                
            </tr>
        </table>
                <?php } while ($row_rs_contactdis = mysql_fetch_assoc($rs_contactdis)); ?>	

 

This is what displays all the contacts for a given client.

I want to now take just the first, second and third contact and display the name elsewhere on the page. Not sure how to extract just those rows.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.