GetDotted Domains

Viewing Thread:
"MySQL - Displaying data in a table..."

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Fri 22/08/03 at 16:57
Regular
Posts: 787
There you go Mod.

Just as you asked!

Anyway.

Does anyone know about MySQL and displaying the data in a table?

I've got a basic script to display it like this (http://www.phi11ip.com/mysql/display.php) but I want to be able to display it out of the rows and something like it shows at the bottom of the page...

Does anybody know how to do anything like this? If you can give me the general idea of what to do with a small example or a link to one I should be able to modify it and get it working...

Thanks.
Fri 22/08/03 at 18:00
Regular
"Chavez, just hush.."
Posts: 11,080
I think I've got on the way now to getting what I want.

http://www.phi11ip.com/mysql/display3.php

Plus, what does ÷ do? ÷÷÷÷÷÷÷÷÷ why can't I do that combination?

\t

There, that.

What does it do?
Fri 22/08/03 at 18:13
Regular
"Chavez, just hush.."
Posts: 11,080
How do you set a field to have an unlimited size?

The max I can get is 255 characters.
Fri 22/08/03 at 21:30
Regular
"Chavez, just hush.."
Posts: 11,080
Don't worry. (Not that you were!)

I've fixed it now.
Fri 22/08/03 at 23:09
Regular
"Chavez, just hush.."
Posts: 11,080
Next question.

Here is the code that I use to display the text.

----

$result = mysql_query( "SELECT * FROM text ORDER BY id DESC LIMIT 7;" )

or die("SELECT Error: ".mysql_error());

# Loop through each row of data.

while ($a_row = mysql_fetch_array($result)) {

PRINT STUFF

----

This is the main part of it, I've found that I need to use this $text = nl2br($text) to get it to show line breaks correctly.

I know I've gotta change the variables (to something) but I don't know where to put it, or do I have to put it in when I submit the data?

Thanks.
Sat 23/08/03 at 12:06
Regular
"It goes so quickly"
Posts: 4,083
I take it you mean using the nl2br(); function on the information grabbed from the database?

If so, try:
print " ".nl2br($a_row[a_field_name])." \n";

or:
print "";
print nl2br($a_row[a_field_name]);
print "
\n";
Sat 23/08/03 at 14:13
Regular
"Chavez, just hush.."
Posts: 11,080
OK, I'll give it a try!

It's always really really easy, and I can never work it out!
Sat 23/08/03 at 15:22
Regular
"Vote for Me!"
Posts: 62
I hate you.

I really do.

:cp
Sat 23/08/03 at 15:51
Regular
"Vote for Me!"
Posts: 62
Whoops!
Sat 23/08/03 at 16:48
Regular
"It goes so quickly"
Posts: 4,083
phi11ip wrote:
> It's always really really easy, and I can never work it out!

Its only easy when you know how. You can't expect to know everything though, can you?

Have you got it all working as intended yet?
Sat 23/08/03 at 16:55
Regular
"Chavez, just hush.."
Posts: 11,080
Yup, got it working now.

Thanks.

Now I can try and use this to, well, do some other thing that I've got in mind.

I know how to do it, just not how. If that makes sense!

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Simple, yet effective...
This is perfect, so simple yet effective, couldnt believe that I could build a web site, have alrealdy recommended you to friends. Brilliant.
Con
My website looks tremendous!
Fantastic site, easy to follow, simple guides... impressed with whole package. My website looks tremendous. You don't need to be a rocket scientist to set this up, Freeola helps you step-by-step.
Susan

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre
Feedback Close Feedback

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.