Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting HTML table rowspan from $numrows in MySql 1

Status
Not open for further replies.

ZOR

Technical User
Joined
Jan 30, 2002
Messages
2,963
Location
GB
I have an HTML table which grows in rows from records being added in MySql database. Is there a way to use my $numrows figure in the MySql query to enter a rowspan(" ") number, as one of the table columns contains a picture. Thanks
 
I have just tried putting in a very much higher number value of rowspan, and the table opens up okay and gives no errors, will I come unstuck later (providing records do not exceed number of rows) Maybe its an HTML question but I will try here first with PHP bit. Thanks
 
Thanks sleipnir. I have got a value in variable $num from mysql_numrows($result), but cannot find syntax/way for the Rowspan="" to accept it. Regards.
 
It would seem to me that if $num contains the value, then a print statement including:

print '..... rowspan="'. $num . '" ....';

will output the string you need quite nicely.



Want the best answers? Ask the best questions! TANSTAAFL!
 
Thanks, you are correct, only thing is I have tried every permutation to put that in this line:

<td rowspan="300" width="17%" align="center" bgcolor="#FFFFFF">

I tried:

rowspan=$num
rowspan="$num"
rowspan=$num;
rowspan=<? $num ?>
rowspan=<? $num; ?>
rowspan=<? "$num" ?>
rowspan=<? "$num; ?>
rowspan=<? ..............................

Gaddoing!!

Regards
 
If $num contains the value 300, then the print statement:


print '<td rowspan="' . $num . '" width="17%" align="center" bgcolor="#FFFFFF">';


Will output:

<td rowspan="300" width="17%" align="center" bgcolor="#FFFFFF">



Want the best answers? Ask the best questions! TANSTAAFL!
 
Many thanks, have a star. Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top