I am creating a shopping cart and have a mysql database which contains a field called itemId
itemId is the id of an item in the form of a number 1 thru 50
There are some images on the server in the images folder named in the form:
1.png 2.png etc...
I wish to insert an image into the php page according to the item being viewed and need the php code to do so.
So that the HTML code ends up something like this:
<img src="images/3.png">
Something along the lines of
<img src="images/\$itemId\.png">
(which is probably wrong) perhaps.
Any ideas, please?
itemId is the id of an item in the form of a number 1 thru 50
There are some images on the server in the images folder named in the form:
1.png 2.png etc...
I wish to insert an image into the php page according to the item being viewed and need the php code to do so.
So that the HTML code ends up something like this:
<img src="images/3.png">
Something along the lines of
<img src="images/\$itemId\.png">
(which is probably wrong) perhaps.
Any ideas, please?