SunQuest
 
           MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old December 31st, 2003, 03:53 PM
NewTune NewTune is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 6 NewTune User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Dynamic Tables with MySQL data

Hey there guys and girls.

One day I woke up and wanted to make a php-news system.
So I went to work and I got as far that I managed to get it working. I got a admin page, so that I can delete posts and also add new stuff.
I was also able to echo the news;

PHP Code:
<?
include("dbconnect.php");
$getnews mysql_query("select * from news ORDER BY id DESC");
while(
$r=mysql_fetch_array($getnews)){
extract($r);
echo(
"<b>$title on $date</b><BR>
<BR>$news<br>"
);

}
?>


But now I want to make it somewhat fancier.. so I thought.. hey, why not try putting each news item in a different table?!
So I started trying some stuff.. but I didn't get it to work..

This is the table I want to use;

PHP Code:
<table width="550" border="0" align="center" cellpadding="0" cellspacing="0">
  <
tr>
    <
td width="25"> <img border="0" src="balk_links_afboog.gif" width="25" height="25"></td>
    <
td width="500" valign="middle" background="bgpatroon_top_table.gif"><p align="center">$Title<b><font face="Tahoma" size="2">

    </
font></b></td>
    <
td width="25">
      <
p align="right"> <img border="0" src="balk_rechter_afboog.gif" width="25" height="25"></td>
  </
tr>
  <
tr>
    <
td background="balk_linkspatroon.gif"></td>
    <
td valign="bottom" bgcolor="#F5F9FC">
      <
p align="left">$news</td>
    <
td background="balk_rechterpatroon.gif">
      <
p align="right"></td>
  </
tr>
  <
tr>
    <
td> <img border="0" src="balk_links_afboog_down.gif" width="25" height="25"></td>
    <
td align="center" valign="middle" background="bgpatroon_down_table.gif"><p align="center"><font size="1">$date:</font></td>
    <
td>
      <
p align="right"> <img border="0" src="balk_rechter_afboog_down.gif" width="25" height="25"></td>
  </
tr>
</
table


So how do I make it that it also generates new tables?
Some help is much appriciated cus I'm rather new to this php stuff.

I hope you can help me out.

Greetz NewTune

Reply With Quote
  #2  
Old December 31st, 2003, 04:00 PM
Bruski Bruski is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Toronto, Canada
Posts: 192 Bruski User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
in your while statement when you are pulling the information from your databse put this table in....

Reply With Quote
  #3  
Old December 31st, 2003, 04:32 PM
Mike_r Mike_r is offline
ExoCrew
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 68 Mike_r User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Well, thats all of HTML, make a page first in HTML using the text editor you use, or Dreamweaver etc... and then just insert it into the script.
__________________
ExoHelpDesk
ExoCrew Free Services

Reply With Quote
  #4  
Old December 31st, 2003, 05:45 PM
NewTune NewTune is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 6 NewTune User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for the help you guys, I'm going to try it out real soon
Btw Happy New Year all

Reply With Quote
  #5  
Old January 5th, 2004, 04:56 PM
NewTune NewTune is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 6 NewTune User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
OKe, I've been working on it and I got it working for about 75%...
here is the code I got;

PHP Code:
<? include("dbconnect.php");
$result mysql_query("select * from news ORDER BY id DESC");
while(
$bla mysql_fetch_object($result)) {

  
$id $bla -> id;
  
$title $bla -> title;
  
$news $bla -> news;
  
$date $bla -> date;

  echo 
"
  <div align='left'></div>
  <table width='550' border='0' align='left' cellpadding='0' cellspacing='0' class='nieuwcss'>
    <tr>
      <td width='25'> <img border='0' src='balk_links_afboog.gif' width='25' height='25'></td>
      <td width='500' valign='middle' background='bgpatroon_top_table.gif'><p align='center'>$title</td>
      <td width='25'>
        <p align='right'> <img border='0' src='balk_rechter_afboog.gif' width='25' height='25'></td>
    </tr>
    <tr>
      <td background='balk_linkspatroon.gif'></td>
      <td valign='bottom' bgcolor='#F5F9FC'>
        <p align='left'>$news</td>
      <td background='balk_rechterpatroon.gif'>
        <p align='right'></td>
    </tr>
    <tr>
      <td> <img border='0' src='balk_links_afboog_down.gif' width='25' height='25'></td>
      <td align='center' valign='middle' background='bgpatroon_down_table.gif'><p align='center'>$date</td>
      <td>
        <p align='right'> <img border='0' src='balk_rechter_afboog_down.gif' width='25' height='25'></td>
    </tr>
  </table>
  <br>
  <br>
    "
;
}
?>


http://members.lycos.nl/internetdum.../index2_new.php

That's what I'm getting
I wanted it to display all the newstables and make a new one for each of the news items..
Any1 know what I did wrong?

Reply With Quote
  #6  
Old January 5th, 2004, 05:58 PM
Bruski Bruski is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Toronto, Canada
Posts: 192 Bruski User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
i get a page not found =]

Reply With Quote
  #7  
Old January 5th, 2004, 06:04 PM
NewTune NewTune is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 6 NewTune User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
yeah I couldn't have it that it wasn't working.. sorry bout that.. I fixed it and it works now

PHP Code:
<div align='left'></div


Was giving problems :/
Thanks for your help yall!!

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > Dynamic Tables with MySQL data


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway