vmicchia Posted October 29, 2010 Share Posted October 29, 2010 What I want to do is create a table out of records from a table that shows an image and a radio button under the image (so I would imagine it would be in 2 rows). I want it to have 3 columns across. Here's what I have to get and output the results: $fabricsql = "SELECT * FROM Fabric f, Images i WHERE f.SKU = i.SKU"; //echo $fabricsql; $fabricResult = mysql_query($fabricsql); $i=0; while($fabricAssoc = mysql_fetch_assoc($fabricResult)){ //echo $fabricAssoc['SKU']. "+ ".$fabricAssoc['Name']; echo "<a href=\"\"><img src='../../".$fabricAssoc['ThumbPath']."' alt='".$fabricAssoc['Description']."' width='".$fabricAssoc['ThumbWidth']."' /></a><br /> <input type=\"radio\" name=\"fabricSelect\" value='".$fabricAssoc['SKU']."' id=\"RadioGroup1_".$i."\" /><br /><br />"; $i++; } Any help is much appreciated. I'm not even sure this is the best way to go about this so any suggestions are appreciated. Link to comment https://forums.phpfreaks.com/topic/217239-dynamically-creating-a-table/ Share on other sites More sharing options...
Ninjakreborn Posted October 29, 2010 Share Posted October 29, 2010 I would need to get more information. From what I can tell, what you want to look into are mapping tables. Mapping Table References http://www.wellho.net/solutions/mysql-many-to-many-table-mapping-pivot-tables.html Link to comment https://forums.phpfreaks.com/topic/217239-dynamically-creating-a-table/#findComment-1128157 Share on other sites More sharing options...
Pikachu2000 Posted October 29, 2010 Share Posted October 29, 2010 To be clear, you're talking about building an HTML table from with the contents of a database table. correct? Link to comment https://forums.phpfreaks.com/topic/217239-dynamically-creating-a-table/#findComment-1128210 Share on other sites More sharing options...
vmicchia Posted November 1, 2010 Author Share Posted November 1, 2010 Yes Pikachu200 that is exactly what I would like to do. I am sorry I was not more clear. I also want to apologize for not responding sooner I was away for the weekend with no internet access. I will check out that articles businessman332211 thank you for posting them. Link to comment https://forums.phpfreaks.com/topic/217239-dynamically-creating-a-table/#findComment-1128925 Share on other sites More sharing options...
vmicchia Posted November 1, 2010 Author Share Posted November 1, 2010 I would need to get more information. From what I can tell, what you want to look into are mapping tables. Mapping Table References http://www.wellho.net/solutions/mysql-many-to-many-table-mapping-pivot-tables.html I see where my original post was ambiguous as to what I wanted. Those a very helpful articles and I appreciate the read. However, it's not hat I was looking for. I am wanting to make HTML tables that are 3 columns wde but I am not sure how to make the width in the given while statement or really any. Link to comment https://forums.phpfreaks.com/topic/217239-dynamically-creating-a-table/#findComment-1129045 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.