CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 18th, 2012, 02:11 PM
ianhaney ianhaney is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 91 ianhaney User rank is Sergeant (500 - 2000 Reputation Level)ianhaney User rank is Sergeant (500 - 2000 Reputation Level)ianhaney User rank is Sergeant (500 - 2000 Reputation Level)ianhaney User rank is Sergeant (500 - 2000 Reputation Level)ianhaney User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 15 h 23 sec
Reputation Power: 11
PHP Coding help

Hi

I am having bit of trouble with PHP coding

I need the testimonials name to be at the top like the name one is in the link

http://irhwebsites.co.uk/html5%20think%20simple/testimonials.php

Below is the coding for the testimonials.php

PHP Code:
<?php mysql_connect("hostname""usernamename""password") or die(mysql_error()); mysql_select_db("dbname") or die(mysql_error()); $data mysql_query("SELECT * FROM tablename") or die(mysql_error()); Print "<table cellpadding=3 class='testimon'>"; while($testimonials mysql_fetch_array$data )) { Print "<tr>"; Print "<th>Name:</th> <td>&nbsp;".$testimonials['name'] . "</td></tr>"; Print "<tr><th>Testimonial:</th> <td>&nbsp;".$testimonials['testimonial'] . "<br><br></td></tr>"; } Print "</table>"?>


Any ideas

I tried setting a class in the php like <th class='testimonial'> but that didn't work

Reply With Quote
  #2  
Old December 18th, 2012, 02:21 PM
ManiacDan's Avatar
ManiacDan ManiacDan is offline
Likely to be eaten by a grue.
Dev Shed God 10th Plane (9500 - 9999 posts)
 
Join Date: Oct 2006
Location: Pennsylvania, USA
Posts: 9,791 ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)  Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 2 Months 3 Weeks 14 h 53 m 20 sec
Reputation Power: 6112
Please paste your code into the big white box, highlight it, and then click the white [PHP] icon.
__________________
HEY! YOU! Read the New User Guide and Forum Rules

"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

"The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.

Reply With Quote
  #3  
Old December 18th, 2012, 02:41 PM
ianhaney ianhaney is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 91 ianhaney User rank is Sergeant (500 - 2000 Reputation Level)ianhaney User rank is Sergeant (500 - 2000 Reputation Level)ianhaney User rank is Sergeant (500 - 2000 Reputation Level)ianhaney User rank is Sergeant (500 - 2000 Reputation Level)ianhaney User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 15 h 23 sec
Reputation Power: 11
The coding is below

PHP Code:
<?php mysql_connect("hostname""usernamename""password") or die(mysql_error()); mysql_select_db("dbname") or die(mysql_error()); $data mysql_query("SELECT * FROM tablename") or die(mysql_error()); Print "<table cellpadding=3 class='testimon'>"; while($testimonials mysql_fetch_array$data )) { Print "<tr>"; Print "<th>Name:</th> <td>&nbsp;".$testimonials['name'] . "</td></tr>"; Print "<tr><th>Testimonial:</th> <td>&nbsp;".$testimonials['testimonial'] . "<br><br></td></tr>"; } Print "</table>"?>

Reply With Quote
  #4  
Old December 18th, 2012, 02:43 PM
gw1500se gw1500se is online now
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jul 2003
Posts: 2,874 gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 1 Year 1 Week 5 Days 18 h 52 m 18 sec
Reputation Power: 581
You didn't need to repost, you could have just edited the original. However, you obviously did not follow ManiacDan's instructions.

1) Edit either post
2) Delete all PHP tags
3) Highlight just the code
4) Click the PHP icon
5) Submit
__________________
There are 10 kinds of people in the world. Those that understand binary and those that don't.

Reply With Quote
  #5  
Old December 18th, 2012, 02:49 PM
AndrewSW's Avatar
AndrewSW AndrewSW is offline
JavaScript is not spelt java
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2011
Location: Landan, England
Posts: 743 AndrewSW User rank is First Lieutenant (10000 - 20000 Reputation Level)AndrewSW User rank is First Lieutenant (10000 - 20000 Reputation Level)AndrewSW User rank is First Lieutenant (10000 - 20000 Reputation Level)AndrewSW User rank is First Lieutenant (10000 - 20000 Reputation Level)AndrewSW User rank is First Lieutenant (10000 - 20000 Reputation Level)AndrewSW User rank is First Lieutenant (10000 - 20000 Reputation Level)AndrewSW User rank is First Lieutenant (10000 - 20000 Reputation Level)AndrewSW User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 2 Weeks 1 Day 22 h 56 m
Reputation Power: 164
Quote:
I need the testimonials name to be at the top like the name one is in the link

http://irhwebsites.co.uk/html5%20think%20simple/testimonials.php

I do not understand what this means and your code still needs to be shown correctly - not on one line.

Reply With Quote
  #6  
Old December 18th, 2012, 02:56 PM
ianhaney ianhaney is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 91 ianhaney User rank is Sergeant (500 - 2000 Reputation Level)ianhaney User rank is Sergeant (500 - 2000 Reputation Level)ianhaney User rank is Sergeant (500 - 2000 Reputation Level)ianhaney User rank is Sergeant (500 - 2000 Reputation Level)ianhaney User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 15 h 23 sec
Reputation Power: 11
That's what I did, I deleted the PHP tags and then highlighted the PHP coding and clicked the PHP icon and a popup box appeared and pasted in the php coding in the pop up box

Reply With Quote
  #7  
Old December 18th, 2012, 03:04 PM
ianhaney ianhaney is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 91 ianhaney User rank is Sergeant (500 - 2000 Reputation Level)ianhaney User rank is Sergeant (500 - 2000 Reputation Level)ianhaney User rank is Sergeant (500 - 2000 Reputation Level)ianhaney User rank is Sergeant (500 - 2000 Reputation Level)ianhaney User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 15 h 23 sec
Reputation Power: 11
I am pasting the coding in here but is just putting it all one line when I click the white php icon

Reply With Quote
  #8  
Old December 18th, 2012, 03:05 PM
Triple_Nothing Triple_Nothing is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 294 Triple_Nothing User rank is Corporal (100 - 500 Reputation Level)Triple_Nothing User rank is Corporal (100 - 500 Reputation Level)Triple_Nothing User rank is Corporal (100 - 500 Reputation Level)Triple_Nothing User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 3 Days 8 h 6 m 9 sec
Reputation Power: 5
Ah, I think I got ya. For this I believe you would want to look into CSS and alignment.

Reply With Quote
  #9  
Old December 18th, 2012, 03:08 PM
ianhaney ianhaney is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 91 ianhaney User rank is Sergeant (500 - 2000 Reputation Level)ianhaney User rank is Sergeant (500 - 2000 Reputation Level)ianhaney User rank is Sergeant (500 - 2000 Reputation Level)ianhaney User rank is Sergeant (500 - 2000 Reputation Level)ianhaney User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 15 h 23 sec
Reputation Power: 11
Ok will have a look and see but when I looked at the css for the table and th etc was not sure what to change

The css for the table is below

Code:
table {
border-collapse: collapse;
}

th, td {
border: 0px solid: #000000;
}

td {
border: 0px solid: #000000;
}

tr {
border: 0px solid: #000000;
}
}

Reply With Quote
  #10  
Old December 18th, 2012, 03:12 PM
Triple_Nothing Triple_Nothing is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 294 Triple_Nothing User rank is Corporal (100 - 500 Reputation Level)Triple_Nothing User rank is Corporal (100 - 500 Reputation Level)Triple_Nothing User rank is Corporal (100 - 500 Reputation Level)Triple_Nothing User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 3 Days 8 h 6 m 9 sec
Reputation Power: 5
I wouldn't edit any tables tags for this. I would create your own name/id and set your desired settings. As far as your search for alignment, you will be looking for vertical alignment for up/down, and not horizontal.

Reply With Quote
  #11  
Old December 18th, 2012, 03:16 PM
ianhaney ianhaney is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 91 ianhaney User rank is Sergeant (500 - 2000 Reputation Level)ianhaney User rank is Sergeant (500 - 2000 Reputation Level)ianhaney User rank is Sergeant (500 - 2000 Reputation Level)ianhaney User rank is Sergeant (500 - 2000 Reputation Level)ianhaney User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 15 h 23 sec
Reputation Power: 11
How do I create a class or id in php coding

<?php mysql_connect("hostname", "usernamename", "password") or die(mysql_error()); mysql_select_db("dbname") or die(mysql_error()); $data = mysql_query("SELECT * FROM tablename") or die(mysql_error()); Print "<table cellpadding=3 class='testimon'>"; while($testimonials = mysql_fetch_array( $data )) { Print "<tr>"; Print "<th>Name:</th> <td>&nbsp;".$testimonials['name'] . "</td></tr>"; Print "<tr><th>Testimonial:</th> <td>&nbsp;".$testimonials['testimonial'] . "<br><br></td></tr>"; } Print "</table>"; ?>

Reply With Quote
  #12  
Old December 18th, 2012, 03:19 PM
Triple_Nothing Triple_Nothing is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 294 Triple_Nothing User rank is Corporal (100 - 500 Reputation Level)Triple_Nothing User rank is Corporal (100 - 500 Reputation Level)Triple_Nothing User rank is Corporal (100 - 500 Reputation Level)Triple_Nothing User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 3 Days 8 h 6 m 9 sec
Reputation Power: 5
This has nothing to do with PHP. This is between HTML and CSS. Sorry. :-/


Note: When you paste coding here, copy from original document and paste in same box you type the rest of your stuff in. Then highlight that code you just pasted, and click the CODE/PHP tag link.

Last edited by Triple_Nothing : December 18th, 2012 at 03:21 PM.

Reply With Quote
  #13  
Old December 18th, 2012, 03:26 PM
ianhaney ianhaney is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 91 ianhaney User rank is Sergeant (500 - 2000 Reputation Level)ianhaney User rank is Sergeant (500 - 2000 Reputation Level)ianhaney User rank is Sergeant (500 - 2000 Reputation Level)ianhaney User rank is Sergeant (500 - 2000 Reputation Level)ianhaney User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 15 h 23 sec
Reputation Power: 11
ok so if I do a class to the th like the following

Code:
<th class="testimonial">


will that work yeah and in the css do I add it like the following

Code:
th.testimonial


is that right

Reply With Quote
  #14  
Old December 18th, 2012, 03:35 PM
AndrewSW's Avatar
AndrewSW AndrewSW is offline
JavaScript is not spelt java
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2011
Location: Landan, England
Posts: 743 AndrewSW User rank is First Lieutenant (10000 - 20000 Reputation Level)AndrewSW User rank is First Lieutenant (10000 - 20000 Reputation Level)AndrewSW User rank is First Lieutenant (10000 - 20000 Reputation Level)AndrewSW User rank is First Lieutenant (10000 - 20000 Reputation Level)AndrewSW User rank is First Lieutenant (10000 - 20000 Reputation Level)AndrewSW User rank is First Lieutenant (10000 - 20000 Reputation Level)AndrewSW User rank is First Lieutenant (10000 - 20000 Reputation Level)AndrewSW User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 2 Weeks 1 Day 22 h 56 m
Reputation Power: 164
Yes, that is correct.

BTW you have a spare } at the end of your previous CSS code.

Reply With Quote
  #15  
Old December 18th, 2012, 03:36 PM
ianhaney ianhaney is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 91 ianhaney User rank is Sergeant (500 - 2000 Reputation Level)ianhaney User rank is Sergeant (500 - 2000 Reputation Level)ianhaney User rank is Sergeant (500 - 2000 Reputation Level)ianhaney User rank is Sergeant (500 - 2000 Reputation Level)ianhaney User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 15 h 23 sec
Reputation Power: 11
Oh yeah thank you for spotting that, that extra } can't help

I will try adding the class and let you know, hopefully will work

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > Positioning an element [was: PHP Coding help]

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap