get image name from image field database in flexicontent

More
10 years 6 months ago #51516 by rafah
Hi,

Couldnt reply.The result was coming as an array.So I converted it.Now its coming.Thank you.

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #51955 by rafah
HI,


Please help.Still I am stuck with the same problem.When I print_r,then I am getting the following result.

a:7:{s:12:"originalname";s:19:"banner---copy-1.jpg";s:3:"alt";s:0:"";s:5:"title";s:0:"";s:4:"desc";s:0:"";s:12:"existingname";s:0:"";s:6:"delete";b:0;s:6:"remove";b:0;}

How to get image name and image path from this??

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #51958 by ggppdk
Hello

execute:

unserialize() on it:
Code:
$image_data = unserialize($myvalue);


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #51959 by rafah
Hi,
I am getting this error
Notice: Array to string conversion in line 21
Array


This is my code
$qry="select value from xrlwc_flexicontent_fields_item_relations where field_id=37 and item_id=".$itemid;
$db->setQuery($qry);
$value = $db->loadResult();
echo unserialize($value);

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #51966 by ggppdk
Hello

$value after unserializing is an array:

array('originalname']=>'...', 'alt'=>'...', 'title']=>'...', ETC);



the PHP 'echo' only prints strings



you can use:
echo "<pre>";
print_r($value);
echo "</pre>";

to print an array


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #51968 by rafah
Hi,

Thanks a lot.Now array is showing correctly.But I only want to display image name.How to do this?

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.812 seconds
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Save