Jump to content

Dynamically creating a table


vmicchia

Recommended Posts

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
Share on other sites

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.