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.
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.
It's always really really easy, and I can never work it out!
If so, try:
print " ".nl2br($a_row[a_field_name])." \n";
or:
print "";
print nl2br($a_row[a_field_name]);
print "\n";
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.
I've fixed it now.
The max I can get is 255 characters.
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?
Good luck.
I might be able to get somewhere now!
I'll have a go and see...
or die("SELECT Error: ".mysql_error());
$num_rows = mysql_num_rows($result);
print "There are $num_rows records.
";
print "
| $field | \n";
mysql_close($db);
?>
At the moment it's this. (minus the top)
I want to change the way it displays the data, change the layout of the table...