Go Back   SitePoint Forums > Forum Index > Program Your Site > PHP
Newsletter FAQ Members List Calendar Mark Forums Read

New to SitePoint Forums? Register here for free!

SitePoint Sponsor
 
Reply
 
Thread Tools Display Modes
Old Dec 20, 2005, 04:44   #1
Mike A
SitePoint Member
 
Join Date: Oct 2005
Posts: 7
Messy looking database tables

I have started to populate a database table with some recipes, but for some reason the tables 'look' very messy when you for example do a 'select * from table'

The information is formatted fine when displayed on the browser, but for some reason it just seems wrong to have such a messy layout in the db, especially when there's going to be hundreds of rows. I have attached a screen shot of what it looks like.

Any tips to tidying up my db most appreciated

Mike
Attached Images
File Type: gif dbscreen.gif (14.8 KB, 23 views)
Mike A is offline   Reply With Quote
Old Dec 20, 2005, 05:46   #2
r937
SQL Consultant
silver trophybronze trophy
SitePoint Award Recipient
 
r937's Avatar
 
Join Date: Jul 2002
Location: Toronto, Canada
Posts: 31,026
please show us the results of SHOW CREATE TABLE tablename
r937 is online now   Reply With Quote
Old Dec 20, 2005, 07:04   #3
longneck
reads the Community Crier
silver trophybronze trophy
SitePoint Award Recipient
 
longneck's Avatar
 
Join Date: Feb 2004
Location: Tampa, FL (US)
Posts: 9,896
it's "messy" simply because you have so many columns and console windows don't scroll horizontally. try using \G instead of ;
longneck is offline   Reply With Quote
Old Dec 20, 2005, 07:10   #4
Mike A
SitePoint Member
 
Join Date: Oct 2005
Posts: 7
attached is a screen shot of the 'show create table recipes'

cheers
Attached Images
File Type: gif dbscreen.gif (12.1 KB, 17 views)
Mike A is offline   Reply With Quote
Old Dec 21, 2005, 11:55   #5
Mike A
SitePoint Member
 
Join Date: Oct 2005
Posts: 7
hello again

i dont suppose anyone could look at the last screenshot i made of the show create table syntax?

is there really no way to make a table with lots of columns and text smart and formatted, like an html table would be?
Mike A is offline   Reply With Quote
Old Dec 21, 2005, 12:15   #6
longneck
reads the Community Crier
silver trophybronze trophy
SitePoint Award Recipient
 
longneck's Avatar
 
Join Date: Feb 2004
Location: Tampa, FL (US)
Posts: 9,896
yes, use PHP to put it in an html table. the mysql client is not designed for pretty output. it's designed for administration and development.
longneck is offline   Reply With Quote
Old Jan 5, 2006, 04:53   #7
Chri
SitePoint Evangelist
 
Join Date: May 2005
Posts: 418
Newbie creates database, but...

.. where are those tables that mysql created? How do I edit them? I want to put the text below the pic, but I can't find the table code that corresponds in any of the php files. Did I do this wrong?


http://www.lavernechristopher.us/lav...tings_view.php
Chri is offline   Reply With Quote
Old Jan 5, 2006, 05:00   #8
r937
SQL Consultant
silver trophybronze trophy
SitePoint Award Recipient
 
r937's Avatar
 
Join Date: Jul 2002
Location: Toronto, Canada
Posts: 31,026
SHOW TABLES FROM mysql
SHOW TABLES FROM yourdatabase
r937 is online now   Reply With Quote
Old Jan 5, 2006, 05:05   #9
Chri
SitePoint Evangelist
 
Join Date: May 2005
Posts: 418
Originally Posted by longneck
use PHP to put it in an html table. the mysql client is not designed for pretty output. it's designed for administration and development.


I'M READING THROUGH THE FORUMS TO FIND OUT HOW TO DO THIS. SHOW ME? I need to separate the two fields somehow. Pic above, text below.
http://www.lavernechristopher.us/la...ntings_view.php
Chri is offline   Reply With Quote
Old Jan 5, 2006, 05:19   #10
r937
SQL Consultant
silver trophybronze trophy
SitePoint Award Recipient
 
r937's Avatar
 
Join Date: Jul 2002
Location: Toronto, Canada
Posts: 31,026
then you'll want the php forum, no?

i'll move this thread for you
r937 is online now   Reply With Quote
Old Jan 5, 2006, 05:20   #11
Chri
SitePoint Evangelist
 
Join Date: May 2005
Posts: 418
Are you sure?
Chri is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread | Next Thread »

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Sponsored Links
 
Forum Jump


All times are GMT -7. The time now is 18:40.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright 1998-2009, SitePoint Pty Ltd. All Rights Reserved