Current location: Hot Scripts Forums » Programming Languages » PHP » Problem with displaying data


Problem with displaying data

Reply
  #1 (permalink)  
Old 05-25-09, 05:09 AM
kavionly kavionly is offline
Newbie Coder
 
Join Date: Mar 2009
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
Problem with displaying data

Hi, i have a product name which is common for all product type.I have some problem with formatting, can anyone help me to solve this problem

Here is my HTML mock up

HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<table width="620" border="1">
  <tr>
    <td width="130">Product Name </td>
    <td width="143">Product Type</td>
   
  </tr>
  <tr>
    <td>Coated </td>
        <td>Silk</td>
  </tr>
  <tr>
    <td></td>
   
    <td>Gloss </td>
  </tr>
  <tr>
    <td></td>
    <td>Cast Coated </td>
  </tr>
  <tr>
    <td></td>
    <td>Matt </td>
  </tr>
  <tr>
    <td></td>
    <td> Part Mechanical </td>
  </tr>
  <tr>
    <td></td>
    <td> Gloss Digital </td>
  </tr>
  <tr>
    <td></td>
    <td> Silk Digital </td>
  </tr>
  <tr>
    <td></td>
    <td> Gloss One Sided </td>
  </tr>
</table>
</body>
</html>
Here is my code

PHP Code:

<?php
include "config.php";

$query"select jos_list.*,jos_list_categories.title as maincat from jos_list,jos_list_categories  where  jos_list.category_id=jos_list_categories.id and jos_list_categories.id='43'"

$result mysql_query($query);

echo 
"<table border=\"1\" align=\"center\">";
echo 
"<tr><th>Product Name</th>";
echo 
"<th>Produt Type</th></tr>";
while (
$row mysql_fetch_array($result))
{
    
$cat[$row['maincat']] = $row['maincat'] ;
  
    echo 
"<tr>";
    foreach(
$cat as $kk=>$vv)
     {
    echo 
'<td>'.$kk.'</td>';
    }
    echo 
"</td><td>";
    echo 
$row['title'];
    echo 
"</td></tr>";
}
echo 
"</table>";
?>

Last edited by kavionly; 05-25-09 at 05:36 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 05-25-09, 08:23 AM
mdhall's Avatar
mdhall mdhall is offline
Aspiring Coder
 
Join Date: Oct 2003
Posts: 510
Thanks: 1
Thanked 1 Time in 1 Post
What exactly is the problem you're having?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 05-25-09, 11:29 AM
kavionly kavionly is offline
Newbie Coder
 
Join Date: Mar 2009
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
Product Name is repeating, I would like to display like Mock up .
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with https and meta data The_Demon PHP 6 12-05-07 07:24 PM
code problem throws error matt001 ASP.NET 0 10-23-05 04:30 AM
show data from record problem Paladine PHP 7 02-03-04 02:06 PM


All times are GMT -5. The time now is 12:47 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.