Hi Guys,
I'm currently having a problem for which I have no doubt there is a ridiculously easy solution. But I'm afraid I appear to be lacking the terminology to find it with any searches.
I currently have seven divs acting as links on my site, they are labelled a, b, c, d, e, f, g. I have a buttons table in my database that contains an id column (corresponding to their character designation) and a picture_link column (containing the url of the image that should be used as the div background.
I can retrieve the records from the database using this code
mysql_query("SELECT id, pic_link FROM buttons")
or die(mysql_error());
but I am struggling to implement them into the site. This is how I would like it to work.
<div class="image_holder" style="background-image: url($picture_link Where ID=a);">
Image 1
</div>
<div class="image_holder" style="background-image: url($picture_link Where ID=b);">
Image 2
</div>
etc.
Any help you could provide would, as always, be massively appreciated.
Thanks,