Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jun 2005
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Tables in PHP (+MySQL)

    Hi,

    I'm new to php and mysql and i have a problem.
    I searched a tutorial about a news system which works fine.

    Now i have this php file (index.php):
    PHP Code:
    <?php
    include("config.php");
        
    $result mysql_query("SELECT * FROM news ORDER BY newsid DESC",$connect);
        while(
    $myrow mysql_fetch_assoc($result))
        {
            echo 
    $myrow['title'];
            echo 
    $myrow['dtime'];
            echo 
    $myrow['text1'];
            echo 
    "<br><a href=\"read_more.php?newsid=$myrow[newsid]\">Read More...</a>
            || <a href=\"edit_news.php?newsid=$myrow[newsid]\">Edit</a>
            || <a href=\"delete_news.php?newsid=$myrow[newsid]\">Delete</a><br><hr>"
    ;
        }
    ?>
    This php file makes a loop to get all the news there is in the sql table but i want it to insert in a table this one:
    Code:
    <table width="200" border="0" cellspacing="0" cellpadding="0">
      <tr bgcolor="#FFFFFF">
        <td width="10" height="20">&nbsp;</td>
        <td width="20" height="20"><div align="center"></div></td>
        <td width="100"><div align="left"></div></td>
        <td width="60"><div align="right"></div></td>
        <td width="10" height="20">&nbsp;</td>
      </tr>
      <tr bgcolor="#FFFFFF">
        <td width="10" height="20">&nbsp;</td>
        <td height="20" colspan="3">&nbsp;</td>
        <td width="10" height="20">&nbsp;</td>
      </tr>
    </table>
    i wanted this:

    the title in the first row of the table (120 width)
    the date/time in the first row of the table (60 width)
    the text and readmore/edit/delete in the second row of the table

    I tried to take that in the table but it didn't work, can anyone pls help me with this. Thank you

  • #2
    New Coder
    Join Date
    Jun 2005
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts
    nvm got it


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •