•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 422,936 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,528 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 169 | Replies: 4
![]() |
•
•
Join Date: May 2008
Location: Hyderabad,India
Posts: 89
Reputation:
Rep Power: 1
Solved Threads: 0
Hi,
I wanted to display data which is in my db.The format of displaying must be in a div, in that div 3 columns & each column must have 10 rows.Am using this:
which is displaying it in a single line. I used even for loop which is displaying again in the single line.What way can be used to print in the above format?
I wanted to display data which is in my db.The format of displaying must be in a div, in that div 3 columns & each column must have 10 rows.Am using this:
while($data = mysql_fetch_array($result)) {
echo $query;
echo ' <tr> <td colspan="3" > <a href="'.$data['MedName'].'" >' . $data['dispname'].' </a> </td>';
echo'</tr>';
} Suhasini
•
•
Join Date: Jun 2007
Location: Valley Center, Kansas
Posts: 554
Reputation:
Rep Power: 3
Solved Threads: 57
here is something i typed up a few weeks ago. it should work.
$table = '<table id="module" class="module" border="0" cellspacing="0" cellpadding="5">';
$cols = 3;
$per_column = 10;
$col = 1;
$table .= '<tr>';
$table .= '<td>';
$table .= '<table id="module" class="module" border="0" cellspacing="0" cellpadding="5">';
$i = 0;
while ($row = $p->fetchAssoc($query)) {
$table .= '<tr>';
$table .= '<td><a href="' . $row['MedName'] . '">' . $row['dispname'] . '</a></td>';
$table .= '</tr>';
if ($i == ($per_column*$col)) {
$table .= '</table>';
$table .= '</td>';
$table .= '<td>';
$table .= '<table id="module" class="module" border="0" cellspacing="0" cellpadding="5">';
$col++;
}
$i++;
}
$table .= '</table>';
$table .= '</td>';
$table .= '</tr>';
$table .= '</table>';
echo $table; Last edited by kkeith29 : Jun 4th, 2008 at 3:30 am.
•
•
Join Date: May 2008
Location: Hyderabad,India
Posts: 89
Reputation:
Rep Power: 1
Solved Threads: 0
what is $p here
while ($row = $p->fetchAssoc($query))
Suhasini
•
•
Join Date: Jun 2007
Location: Valley Center, Kansas
Posts: 554
Reputation:
Rep Power: 3
Solved Threads: 57
•
•
Join Date: May 2008
Location: Hyderabad,India
Posts: 89
Reputation:
Rep Power: 1
Solved Threads: 0
Its Working.But have small problem, I have 4 buttons Home Categories Brand Store in a row.When I click each button the text display.Here if catogery is clicked that is in the same row but remaining 3 buttons are moving down.when it is clicked again..they are going back to normal position.Why is it like that?
Suhasini
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
access advice broadband business classification code combo crime cult of the dead cow daniweb data data protection data transfer database drive dropdownlist encryption europe forensic forensics gadget google government hacking hard hardware help hitachi hp industrial espionage information internet linux mobile module net news payment services privacy protection reuse search security spot storage terabyte tutorials and more tv web wikipedia
- Data from mysql in a 3 columns table (PHP)
- Winsock C++ help: receiving data (C++)
- Help me about JSP problem... (JSP)
- Hash Table display problem (C++)
- Cartesian Product Problem (Oracle)
- problem in VB.NET? (VB.NET)
- Problem with displaying data.. (PHP)
- Displaying Data in C programmming (C)
Other Threads in the PHP Forum
- Previous Thread: Sending data to a form using hyperlink
- Next Thread: Display forms results


Linear Mode