Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

Hello everyone I want to display data from MySQL in php to list view . I am creating a classified ads website in php. I only have to display the fields results in listview like

olx.com.pk/rawalpindi

share|improve this question

closed as off-topic by S.L. Barth, Sajeetharan, Shankar Damodaran, hon2a, gnat Dec 21 '14 at 14:31

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example." – S.L. Barth, Sajeetharan, Shankar Damodaran
If this question can be reworded to fit the rules in the help center, please edit the question.

1  
Welcome to Stackoverflow Syed. You should improve your question by showing what you've done so far. YOur question is too broad and looks more like a "please program that for me request". You should make it more specific. –  try-catch-finally Dec 21 '14 at 11:25
    
Brother thanks I have done all programming. I will post it after sometime. Because I have finished my things. –  Syed Käshäñ Ñïzâmî Dec 21 '14 at 11:27

1 Answer 1

up vote 0 down vote accepted

You can use <table> or <div> for your listview :

<table>
   <thead>
      <th></th>
      <th></th>
   </thead>
   <tbody>
   <?php
      $query = mysql_query();
      while($row = mysql_fetch_array($query)){
         echo "<tr>$row['index1']</tr>";
         echo "<tr>$row['index2']</tr>";
   ?>
   </tbody>
</table>
share|improve this answer
    
Thanks man i have done it. I will show you. but i am in another problem. tell me how to apply border to table row which is in while loop –  Syed Käshäñ Ñïzâmî Dec 25 '14 at 9:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.