mysql_get +

3 posts by 2 authors in: Forums > CMS Builder
Last Post: May 30, 2012   (RSS)

By Perchpole - May 30, 2012

Hello,

I've just realised that mysql_get does not return uploads.

I need to look-up an image associated with a record - something like this...

<?php $type = mysql_get('typetable', $record['type']); ?>
<?php $typeIcon = $type['icon'][0] ?>

<img src="<?php echo $typeIcon['urlPath'] ?>" />

etc...


This doesn't work so I'd like find a way that does using code that's as simple and efficient as mysql_get.

What's the next step up?

:0)

Perch

Re: [Perchpole] mysql_get +

By Jason - May 30, 2012 - edited: May 30, 2012

Hi Perch,

You'll need to use a second function to get the uploads for that record. You could use the getUploadRecords() function like this:

$type = mysql_get("typetable", $record['type']);
$icons = getUploadRecords('typetable', 'icon', $type['num']);


This will make $icons an array of all the icon uploads in the $type record.

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/