Image link in Mysql
Posted: Mon Aug 25, 2003 6:01 pm
Hi,
Working on a quiz script, wanted to add images to certain questions that need an image to clarify things. So, not all questions have images associated with them.
in the db(mysql) I added a field in the questions table and called it image, in this field I put the link to the images ex: /images/figure1.gif
My problem is that I'm unable to come up with the proper mysql query nor that I'm able to make the if statement present the image if there's one in the certain question row for example.
if($image){
echo "/images/$image";}
the mysql query, I don't know whether I shoould fetch row, num rows or what?
A quick run code would be very appreciated as I exausted everything. Nothing on the net, and certainly I'm new to this.
Thanks.
Working on a quiz script, wanted to add images to certain questions that need an image to clarify things. So, not all questions have images associated with them.
in the db(mysql) I added a field in the questions table and called it image, in this field I put the link to the images ex: /images/figure1.gif
My problem is that I'm unable to come up with the proper mysql query nor that I'm able to make the if statement present the image if there's one in the certain question row for example.
if($image){
echo "/images/$image";}
the mysql query, I don't know whether I shoould fetch row, num rows or what?
A quick run code would be very appreciated as I exausted everything. Nothing on the net, and certainly I'm new to this.
Thanks.