Web Hosting Vodahost    

Home Take The Royal Tour! Order Now Features Prices
Go Back   Web Hosting > VodaHost Web Hosting Support > mySQL & PHP

Notices

mySQL & PHP Discussions, information and help with mySQL and PHP.

Reply
 
Thread Tools
  #1  
Old 06-03-2009, 09:38 PM
Rob (SA)'s Avatar
Major
 
Join Date: Nov 2006
Location: Centurion, South Africa
Posts: 483
Question Change text size of data from MySQL database

Hi Folks,

Please help me with this - I need to change the text sizes and colour but do not know where to insert this information.

You can see what is currently happening at www.gnjgf.co.za/entryformmysql.php

!------------------------------------------------------------------->
<! THIS SECTION FETCHES THE INFORMATION FROM THE TABLE >
<!------------------------------------------------------------------->

<?php
while($row=mysql_fetch_array($result)){
echo "</td><td>";
echo $row['name'];
echo "</td><td>";
echo $row['surname'];
echo "</td><td>";
echo $row['my_handicap_is'];
echo "</td><td>";
echo $row['i_wish_to_play'];
echo "</td></tr>";
}
echo "</table>";
?>
__________________
Kind Regards
Rob
www.gnjgf.co.za
www.oryan-projects.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2  
Old 06-03-2009, 09:51 PM
Watdaflip's Avatar
Major General
 
Join Date: Sep 2005
Location: Cincinnati, Ohio
Posts: 2,151
Default Re: Change text size of data from MySQL database

It depends on how your going to change the formatting, if you are going to use css I would do something like

<?php
while($row=mysql_fetch_array($result)){
echo '<tr><td class="name">';
echo $row['name'];
echo '</td><td class="surname">';
echo $row['surname'];
echo '</td><td class="handicap">';
echo $row['my_handicap_is'];
echo '</td><td class="wish_to_play">';
echo $row['i_wish_to_play'];
echo '</td></tr>';
}
echo '</table>';
?>

Also note the blue text. You had a closing tag for a column instead of the opening tag for the row.

For the actual formatting you would then add this between your head tags

<style type="text/css">
.name {
color: #0000FF;
font-size: 12px;
}

.surname {
color: #0000FF;
font-size: 12px;
}

.handicap {
color: #0000FF;
font-size: 12px;
}

.wish_to_play {
color: #0000FF;
font-size: 12px;
}
</style>
__________________

Register/Login Script
Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old 06-03-2009, 11:32 PM
Rob (SA)'s Avatar
Major
 
Join Date: Nov 2006
Location: Centurion, South Africa
Posts: 483
Default Re: Change text size of data from MySQL database

Hi,

Thanks for the reply but unfortunatly no impact to making the changes.
__________________
Kind Regards
Rob
www.gnjgf.co.za
www.oryan-projects.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old 06-03-2009, 11:43 PM
Rob (SA)'s Avatar
Major
 
Join Date: Nov 2006
Location: Centurion, South Africa
Posts: 483
Question Re: Change text size of data from MySQL database

Hi Me again,

Sorry it was finger problems on my side.

Looking much better - thank you.

Next port of call is to set the width of the last column in order that the text does not wrap or seems to wrap onto the next line.
__________________
Kind Regards
Rob
www.gnjgf.co.za
www.oryan-projects.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old 06-03-2009, 11:45 PM
Watdaflip's Avatar
Major General
 
Join Date: Sep 2005
Location: Cincinnati, Ohio
Posts: 2,151
Default Re: Change text size of data from MySQL database

In your column header you can just change the <td> tags to look like

<td width="400">{column_title}</td>

Changing 400 to the number of pixels you want the width to be
__________________

Register/Login Script
Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old 06-03-2009, 11:56 PM
Rob (SA)'s Avatar
Major
 
Join Date: Nov 2006
Location: Centurion, South Africa
Posts: 483
Default Re: Change text size of data from MySQL database

Thanks for the prompt reply.

I do not know where my column headers are.

I have a section in that looks like this:

<!------------------------------------------------------------------->
<! THIS SECTION CHANGES WHAT THE TABLE LOOKS LIKE >
<!------------------------------------------------------------------->

<table border=3 width="35%" cellspacing=0 style="background-color:#F0F8FF;" >
<!------------------------------------------------------------------->
<! THIS SECTION CHANGES THE MAIN HEADING >
<!------------------------------------------------------------------->

<caption><b><font style="font-size:12px" color="#00008B" face="Arial">
TOURNAMENT ENTRIES</font><b><caption>

<!------------------------------------------------------------------->
<!--------THIS SECTION CHANGES THE ACTUAL COLUMN HEADINGS------------>
<!------------------------------------------------------------------->

<tr>
<th><b><font style="font-size:11px" color="#00008B" face="Arial">NAME</font></b></th>
<th><b><font style="font-size:11px" color="#00008B" face="Arial">SURNAME</font></b></th>
<th><b><font style="font-size:11px" color="#00008B" face="Arial">HANDICAP</font></b></th>
<th><b><font style="font-size:11px" color="#00008B" face="Arial">TOURNAMENT</font></b></th>
</tr>
__________________
Kind Regards
Rob
www.gnjgf.co.za
www.oryan-projects.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old 06-04-2009, 12:08 AM
Rob (SA)'s Avatar
Major
 
Join Date: Nov 2006
Location: Centurion, South Africa
Posts: 483
Thumbs up Re: Change text size of data from MySQL database

Hi,

Progressing slowly but in the right direction.

The value seen below as 35% only needs to be ammended to a higher value say 85% and this widens the table.

It seems so simple when one knows how.

Thanks for your support
__________________
Kind Regards
Rob
www.gnjgf.co.za
www.oryan-projects.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old 06-04-2009, 12:16 AM
Rob (SA)'s Avatar
Major
 
Join Date: Nov 2006
Location: Centurion, South Africa
Posts: 483
Question Re: Change text size of data from MySQL database

Hi,

New question on same page.
  1. Can I use a script to sort the last column?
  2. Can I dump this page to an excel file in using a button?
__________________
Kind Regards
Rob
www.gnjgf.co.za
www.oryan-projects.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old 06-04-2009, 01:09 AM
Watdaflip's Avatar
Major General
 
Join Date: Sep 2005
Location: Cincinnati, Ohio
Posts: 2,151
Default Re: Change text size of data from MySQL database

<th> tags can use the width attribute as well.

The 35% table width makes it take only 35% of the available width (this would be the page width unless the table is wrappped in another element which has a width set).

You can set the 35% to something larger, or remove the width="35%" from the <table> tag and only define the width in the the <th> tags

You can use php to sort the results on the page request, or javascript to do sorting with the loaded data.

To dump the table's data into an excel file by exporting it in phpmyadmin
__________________

Register/Login Script
Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old 06-04-2009, 06:58 AM
Rob (SA)'s Avatar
Major
 
Join Date: Nov 2006
Location: Centurion, South Africa
Posts: 483
Question Re: Change text size of data from MySQL database

Hi,

So then if I am not misunderstood I can insert the <td>. . . . </td) btween the <th> marks and I should get the result I am looking for regarding my column widths ?

My thought behind the sorting is to allow the table to sort into tournaments at a set time and date.

This will mean that a date will be specified on the entry form as well as the time and the entry form page will close at that time and the sort will happen similtaneously.

If there are 5 tournaments it will do the same.

The dump is possible via phpadmin and the sorting can also be done there - I am just looking at automating this process and that way there is less traffic by admin people to the backend of this process.

Thanks again for the help
__________________
Kind Regards
Rob
www.gnjgf.co.za
www.oryan-projects.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old 06-04-2009, 08:53 PM
Rob (SA)'s Avatar
Major
 
Join Date: Nov 2006
Location: Centurion, South Africa
Posts: 483
Question Re: Change text size of data from MySQL database

Hi,

Well the progress is till good.

Using Phpadmin I have managed to get the page to sort as I wanted and the overall look is promising.

Is there anyone who can help me with the other remaining issues
__________________
Kind Regards
Rob
www.gnjgf.co.za
www.oryan-projects.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #12  
Old 06-04-2009, 09:23 PM
Watdaflip's Avatar
Major General
 
Join Date: Sep 2005
Location: Cincinnati, Ohio
Posts: 2,151
Default Re: Change text size of data from MySQL database

You wouldn't added a <td></td> tag inside a <th></th>, I was just saying the inner properties such as <td width="300"> also work in a <th> tag, so you just need to make it

<th width="#width#">

changing #width# to either a number in pixels or percent
__________________

Register/Login Script
Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #13  
Old 07-12-2009, 08:28 AM
Rob (SA)'s Avatar
Major
 
Join Date: Nov 2006
Location: Centurion, South Africa
Posts: 483
Question Re: Change text size of data from MySQL database

Hi,

Please let us know what this is?
__________________
Kind Regards
Rob
www.gnjgf.co.za
www.oryan-projects.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT +1. The time now is 12:17 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC7
2005-2009 VodaHost Web Hosting Your Perfect Web Host - All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203