473,624 Members | 2,160 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Question about displaying MySQLl data

L C
Hello,

Could someone point in the correct direction with regards to displaying my
data in "nicer" format. I have figured out ( with the tutorials on the web,
and the O'Reilly PHP & MySQL book) how to store, retrieve, manipulate, and
display my data using PHP. But when I do display, it is the block format.
I can't seem to find a tutorial that gets into a "prettier" type of display.

Is this a HTML issue?

I am a newbie to this stuff

Any help or direction is much appreciated.

Larry C
Jun 14 '07 #1
5 1727
L C wrote:
But when I do display, it is the block format.
What do you exactly mean by this? Are you outputting paragraphs of text with
no line breaks? (hint: http://php.net/nl2br)

--
----------------------------------
Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

http://acm.asoc.fi.upm.es/~mr/
Proudly running Debian Linux with 2.6.20-1-amd64 kernel, KDE 3.5.7, and PHP
5.2.3-1 generating this signature.
Uptime: 16:42:36 up 13 days, 22:44, 3 users, load average: 1.77, 1.27,
1.22

Jun 14 '07 #2
L C

"Iván Sánchez Ortega" <ivansanchez-alg@rroba-escomposlinux.-.punto.-.org>
wrote in message news:f4******** **@hercules.coh p1...
L C wrote:
But when I do display, it is the block format.

What do you exactly mean by this? Are you outputting paragraphs of text
with
no line breaks? (hint: http://php.net/nl2br)

--
----------------------------------
Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

http://acm.asoc.fi.upm.es/~mr/
Proudly running Debian Linux with 2.6.20-1-amd64 kernel, KDE 3.5.7, and
PHP
5.2.3-1 generating this signature.
Uptime: 16:42:36 up 13 days, 22:44, 3 users, load average: 1.77, 1.27,
1.22
I am outputting tables. The stuff I am doing is for a golf league. If I
output scores it comes out like this.

member_id week hole_1 hole_2 hole_3 hole_4 hole_5 hole_6 hole_7 hole_8
hole_9 total
13 4 6 4 6 5 6 4 5 4 5 45
12 4 7 5 5 5 7 5 5 4 4 47
21 4 6 4 5 5 8 7 6 6 4 51
14 4 5 4 7 5 8 4 7 4 4 48
19 4 6 6 5 4 8 5 6 4 5 49
20 4 4 5 8 5 7 5 6 3 3 48

I am trying to get it to look better

Larry C
Jun 14 '07 #3
L C wrote:
I am outputting tables. The stuff I am doing is for a golf league. If I
output scores it comes out like this.
Loop through the results (RTFM!), outputting "<table>", "<tr>" and "<td>"
where appropiate.

--
----------------------------------
Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

http://acm.asoc.fi.upm.es/~mr/
Proudly running Debian Linux with 2.6.20-1-amd64 kernel, KDE 3.5.7, and PHP
5.2.3-1 generating this signature.
Uptime: 17:12:19 up 13 days, 23:14, 3 users, load average: 3.50, 2.67,
2.03

Jun 14 '07 #4
L C

"Iván Sánchez Ortega" <ivansanchez-alg@rroba-escomposlinux.-.punto.-.org>
wrote in message news:f4******** **@hercules.coh p1...
L C wrote:
I am outputting tables. The stuff I am doing is for a golf league. If
I
output scores it comes out like this.

Loop through the results (RTFM!), outputting "<table>", "<tr>" and "<td>"
where appropiate.

--
----------------------------------
Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

http://acm.asoc.fi.upm.es/~mr/
Proudly running Debian Linux with 2.6.20-1-amd64 kernel, KDE 3.5.7, and
PHP
5.2.3-1 generating this signature.
Uptime: 17:12:19 up 13 days, 23:14, 3 users, load average: 3.50, 2.67,
2.03
RTFM?

Loop through the results (RTFM!), outputting "<table>", "<tr>" and "<td>"
where appropiate

Like This?

echo "<table border='1'><tr> ";
// printing table headers
for($i=0;
$i<$fields_num; $i++){ $field = mysql_fetch_fie ld($result);
echo "<td>{$fiel d->name}</td>";}echo "</tr>\n";
// printing table rows
while($row = mysql_fetch_row ($result)){ echo "<tr>";
// $row is array... foreach( .. ) puts every element
// of $row to $cell variable
foreach($row as $cell)
echo "<td>$cell</td>";
echo "</tr>\n";
}
mysql_free_resu lt($result);
?>
</body></html>

I have RTFMed my way to this point. A week ago I didn't have PHP, MySQL, or
IIS installed on my system. I didn't ask some generic question like: "How
do I get PHP". I asked what I thought was a relatively specific question
after searching the web for answers. I did search for PHP, MySQL, and
format. I got many hits about date formats. Unfortunately, unlike you, I
wasn't born knowing everything, I had to ask questions along the way. I am
sorry I bothered you with my question.

Jun 14 '07 #5
L C wrote:
"Iván Sánchez Ortega" <ivansanchez-alg@rroba-escomposlinux.-.punto.-.org>
wrote in message news:f4******** **@hercules.coh p1...
>L C wrote:
>>I am outputting tables. The stuff I am doing is for a golf league. If
I
>>output scores it comes out like this.
Loop through the results (RTFM!), outputting "<table>", "<tr>" and "<td>"
where appropiate.

--
----------------------------------
Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

http://acm.asoc.fi.upm.es/~mr/
Proudly running Debian Linux with 2.6.20-1-amd64 kernel, KDE 3.5.7, and
PHP
>5.2.3-1 generating this signature.
Uptime: 17:12:19 up 13 days, 23:14, 3 users, load average: 3.50, 2.67,
2.03

RTFM?

Loop through the results (RTFM!), outputting "<table>", "<tr>" and "<td>"
where appropiate

Like This?

echo "<table border='1'><tr> ";
// printing table headers
for($i=0;
$i<$fields_num; $i++){ $field = mysql_fetch_fie ld($result);
echo "<td>{$fiel d->name}</td>";}echo "</tr>\n";
// printing table rows
while($row = mysql_fetch_row ($result)){ echo "<tr>";
// $row is array... foreach( .. ) puts every element
// of $row to $cell variable
foreach($row as $cell)
echo "<td>$cell</td>";
echo "</tr>\n";
}
mysql_free_resu lt($result);
?>
</body></html>

I have RTFMed my way to this point. A week ago I didn't have PHP, MySQL, or
IIS installed on my system. I didn't ask some generic question like: "How
do I get PHP". I asked what I thought was a relatively specific question
after searching the web for answers. I did search for PHP, MySQL, and
format. I got many hits about date formats. Unfortunately, unlike you, I
wasn't born knowing everything, I had to ask questions along the way. I am
sorry I bothered you with my question.
Yes, that's the right idea, although you can clean it up a little, i.e.

echo "<table border='1'><tr> ";
// printing table headers

for($i=0; $i<$fields_num; $i++){
$field = mysql_fetch_fie ld($result);
echo "<td>{$fiel d->name}</td>";
}
echo "</tr>\n";

// printing table rows
while($row = mysql_fetch_row ($result)){
echo "<tr>";
// $row is array... foreach( .. ) puts every element
// of $row to $cell variable
foreach($row as $cell)
echo "<td>$cell</td>";
echo "</tr>\n";
}
mysql_free_resu lt($result);
?>

And yes, when you're new it's sometimes hard to get a handle on what you
need. I'd suggest visiting the bookstore and getting a decent book on
PHP and MySQl. While you're at it, you could look for one on HTML if
you feel a need.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Jun 14 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3016
by: Kamran | last post by:
Hi I have very little experience of C++, nevertheless I have been asked to write a gui using QT/QWT. I know that I should direct the question to the relevant mailing list and I have done that but I think my problem has to do with my lack of understandign of some issues in C++. There is a class in QWT called QwtPicker which allows one to make rubberbands and select part of the drawing canvas, very useful in zooming etc. Function...
5
2214
by: Robert | last post by:
Hello Accessors I have some reports created in Access that are very good for what they do. However, it seems to me that when you are displaying information you don't need to print out that a printer-friendly report is not the best way to go. So, I tried converting one of my Access reports to an Access form. I selected the continuous view to allow displaying multple records but when I went to define my sorting and grouping there was none...
2
4331
by: RAJ | last post by:
In our multi-tier application, we have several ASP.NET user controls which will update the same data source provided by middle tier logic. In this particular scenario we have one user control displaying the contents of the data source, whilst another control updates the datasource via a command buttons implementation of 'Click', an event raised in the 'Handle Postback Events' stage of the control execution life cycle (via the...
6
2198
by: Matt | last post by:
Premise: Inserting data into a database form a <textarea> and displaying this data through an HTML page. When inserting data into a database via a text area and then displaying this data any carriage return that was entered into the database was lost. I Created a function to replace a carriage return with a <BR>. I call this function when I display this data. If I enter text inside <> into a database and then display this data, any...
10
1808
by: chris.withers | last post by:
I have built a web portal and was considering adding a 'user mail' feature for users to message each other. I'm a bit uncertain on how to design the DB, so was wondering if there is a standard to do this. I was figuring perhaps a table storing all user messages (but this might become very large very fast?) or would a seperate db storing sent/saved/recieved etc messages be better? Any advice would be appreciated,
13
1794
by: pepito3 | last post by:
Hi. I have a question about PHP programming philosophy: Imagine a web of a shop with a table displaying the name of some products. There is a link "Buy" next to each product. I want that link to execute some PHP code, but I don't want the navigator to show another web. So imagine the file is product_list.php and the link is: <a href="add_product.php?code=...> Buy </a>. I want the code in add_product.php to be executed but I want the...
9
3167
by: davetelling | last post by:
I am not a programmer, I'm an engineer trying to make an interface to a product I'm designing. I have used C# to make a form that interrogates the unit via the serial port and receives the data. I want to be able to draw lines in a picturebox based upon certain data points I have received. I dragged a picturebox from the toolbar onto my form, but after having gone through the help files, looking online and trying a variety of things, I...
5
3019
by: temp2 | last post by:
Hello, I have an app that reads data params from a stream and updates controls accordingly. The stream reader is on a different thread than the main thread that created the controls. I fully realize it's not wise, and in some circumstances, not even possible to update the controls from the stream other than the main stream. I believe there are two recommended ways to handle this situation. 1. Use Invoke() to "call" an updater method...
0
2070
by: | last post by:
I have a question about spawning and displaying subordinate list controls within a list control. I'm also interested in feedback about the design of my search application. Lots of code is at the end of this message, but I will start with an overview of the problem. I've made a content management solution for my work with a decently structured relational database system. The CMS stores articles. The CMS also stores related items --...
0
8236
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8173
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7159
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5563
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4079
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2606
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1785
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1482
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.