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 October 27th, 2004, 06:51 PM
Deshi Deshi is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 2 Deshi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Showing Database in tables

Hi, I am fairly new to MySQL and need some help.
I have created the database, the input form and the insert process. I just need help on the displaying part of it. As you can see http://www.pixeldimension.viperhosting.net/view.php there it ll comes up ok. The only thing i want changed is that the data is all in one table. On my current table it creates a new table for every entry.
PHP Code:
<?
$username
="(username)";
$password="(password)";
$database="(database)";
mysql_connect(localhost,$username,$password);
@
mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM contacts";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
echo 
"<b><center>Contacts</center></b><br><br>";
$i=0;
while (
$i $num) {
$name=mysql_result($result,$i,"name");
$age=mysql_result($result,$i,"age");
$website=mysql_result($result,$i,"website");
$email=mysql_result($result,$i,"email");
$msn=mysql_result($result,$i,"msn");
$ip=mysql_result($result,$i,"ip");
echo 
"<table border=\"1\" bordercolor=\"#000000\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">";
echo 
"<tr><td>Name</td>
<td>Age</td>
<td>Website</td>
<td>Email</td>
<td>MSN</td>
<td>IP</td>
</tr>
<tr>
<td>$name</td>
<td>$age</td>
<td>$website</td>
<td>$email</td>
<td>$msn</td>
<td>$ip</td>
</tr>
 
"
;
echo 
"</table>";
$i++;
}
?>


If anyone knows how i can do this please reply...that would be great.

Thanks
- Deshi

Reply With Quote
  #2  
Old October 28th, 2004, 03:38 AM
Deshi Deshi is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 2 Deshi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Sorry nevermind about this support request. I have just figured it out :P

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > Showing Database in tables


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 1 hosted by Hostway