Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Displaying a table contentes


string

Recommended Posts

Hi everyone,

 

I'm really a newbie on this. I'm having some hard toime tring to display the result of a multirow select on the center part of the index.php

 

i've lookging for some code so i can place the result on the center part of the index.php.

 

Thnks everyone !!

 

 

here is the code:

 

$sql = 'SELECT a.box_number, b.sender,b.tracking,b.deliverybox '

. ' FROM mailbox a, maildata b'

. ' WHERE a.customers_id = b.customers_id AND a.box_number = b.mailbox AND a.customers_id = '. (int)$customer_id ;

 

 

 

$customer_query=tep_db_query($sql);

$num_rows=tep_db_num_rows($customer_query);

 

if ($num_rows == 0) {

// do nothing as no user is logged

/*echo "Sorry, we have no records";*/

:'( } else {

 

 

echo "<TABLE ALIGN=\"CENTER\" BORDER=\"1\">";

echo "<TR><TH>Sender</TH><TH>Tracking Num.</TH><TH>Delivery Box</TH></TR>";/

 

// We carry out the table population using a 'while' loop

 

while ($row= tep_db_fetch_array($customer_query))

{

$id=$row["sender"];

$var_1=$row["tracking"];

$var_2=$row["deliverybox"];

 

// We display the results under the correct headings

 

 

echo "<TR><TD>$id</TD><TD>$var_1</TD><TD>$var_2</TD></TR>";

 

}

 

}// End else while

 

mysql_free_result($customer_query);

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...