Jump to content

question please..


vinsux

Recommended Posts

hi there, i just wanna ask a question.. i'm making a poll using php right now..

 

may i ask if it's possible to set the width of a <td> in a table from the values from the database?..

 

also how can i count the total value of numbers in a database.

 

in my database, i have a number of votes from different names, how can i count them all? because i need it to get the percentage of the votes..

 

 

 

 

please help me thanks and god bless..

Link to comment
https://forums.phpfreaks.com/topic/275507-question-please/
Share on other sites

Your question is a littlee confusing because the answer seems painfully obvious. If you have a value from the database, just set the width to what you want. I have no idea how you plan to set the width based upon the value from the database. Do you want the value to be set to the actual value from the database or calculated based on that DB value?

 

Also, you can set the value in the actual HTML or within the Style sheet.

 

 

<table style="width: <?php echo $valueFromDB; ?>px">
Link to comment
https://forums.phpfreaks.com/topic/275507-question-please/#findComment-1417980
Share on other sites

 

Your question is a littlee confusing because the answer seems painfully obvious. If you have a value from the database, just set the width to what you want. I have no idea how you plan to set the width based upon the value from the database. Do you want the value to be set to the actual value from the database or calculated based on that DB value?

 

Also, you can set the value in the actual HTML or within the Style sheet.

 

 

<table style="width: <?php echo $valueFromDB; ?>px">

 

^

that sample code is what i'm looking for, but i tried that code and it's not working...

 

sorry for my bad english..

Link to comment
https://forums.phpfreaks.com/topic/275507-question-please/#findComment-1417985
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.