Welcome Guest, Not a member yet? Register   Sign In
Calling img src and alt from database
#4

You seem to be doing it correctly, but it could be simplified.

PHP Code:
<img src="<?php echo base_url($accessories_item['imagesrc']); ?>" alt="<?php echo $accessories_item['imageAlt']; ?>" /> 

Although you may have already stored a / at the beginning of the file name in the db that CI might insert, giving you two // after the base url. Not sure if it gets trimmed out automatically or not.

Paul.
Reply


Messages In This Thread
Calling img src and alt from database - by alann - 10-16-2017, 02:23 AM
RE: Calling img src and alt from database - by PaulD - 10-16-2017, 10:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB