100 users online (1 members and 99 guests)  

  Results 1 to 2 of 2


  1. Almost Done, Need DIV expert for one thing    Forum: Myspace Forum
    Replies: 1
  2. 78 rpm records    Forum: General Discussion
    Replies: 2
  3. Whats teh next best thing??    Forum: General Discussion
    Replies: 1
  4. Deleting records    Forum: PHP Forum
    Replies: 5
  1. #1
    minds_gifts's Avatar
    New User

    Join Date
    Apr 2003

    Displaying records on a template like thing

    Hi everybody,

    I'm new to this board and of course to php, very first post here:
    I'm trying to display the records from a table and i'm successful too.But, i dont want to display them in a table format - but in some pretty good way.
    I've attached the attachment as an image like how i want to display.So, each record shld fit in a nice template like thing.How should i modify my code to show something like that, is it really hard??

    Thanks one and all.

    Also, I would like to show my code which i've so far:

    PHP Code:

    // Lets create our MySQL connection 

    // Lets select our database 

    // Lets select our record fields from our database table and check for results 

    $sql="SELECT  introtext,zipcode,image,telephone,email,description FROM tbl_personals ORDER BY id"

    // We have no results 

    if ($num_rows == 0) { 
    "Sorry, we have no records"
        } else { 

    // We have  results so create a table to display them 

    echo "<TABLE ALIGN=\"CENTER\" BORDER=\"1\">"
    //echo "<TR><TH>Var 1 values</TH><TH>Var 2 values</TH></TR>";    

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

    while ($row=mysql_fetch_array($mysql_result)) 

    // We display the results under the correct headings 

    echo "<TR><TD>$var_1</TD><TD>$var_2</TD><TD>$var_3</TD><TD>$var_4</TD><TD>$var_5</TD><TD>$var_6</TD></TR>"

    // End else while 

    //We close the MySQL connection 




  2. #2
    QuietDean's Avatar

    Join Date
    Oct 2000
    Bournemouth, UK
    Creating a proper template system is not 'hard' as such, but it is a lot of work. You will need a full tutorial, this one is good -


    Otherwise, you can continue what you are doing, layout your database results using HTML in the php code. However, you may want to think about exclusively using CSS for your styling and layout, that way you can let CSS be your template system..
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

Tags for this Thread