How can i get image title and alt from database by mysql query as i am preparing my custom image sitemap.
but i got stuck when i saw entry like
+--------+------------+-------+-------------------------------+-----------------------------------------------------------------------------+
| nid | date | fid | field_featured_news_image_fid | field_own_image_data |
+--------+------------+-------+-------------------------------+-----------------------------------------------------------------------------+
| 171059 | 1352374000 | NULL | NULL | NULL |
| 170530 | 1351768197 | 19203 | 19202 | a:2:{s:3:"alt";s:16:" apparel exports";s:5:"title";s:0:"";} |
| 170167 | 1351332298 | 18873 | 18872 | a:2:{s:3:"alt";s:32:" handicraft products27102012.jpg";s:5:"title";s:0:"";} |
+--------+------------+-------+-------------------------------+-----------------------------------------------------------------------------+

here i am confused how to get alt from this entry as i have used before urlencode($result->field_own_image_data['alt']);
But this not work for me.And i can not use node_load because it is out side of drupal directory.
All suggestion are welcome.

Comments

You need

You need http://php.net/manual/en/function.unserialize.php. It will reconstruct

a:2:{s:3:"alt";s:16:" apparel exports";s:5:"title";s:0:"";}

into

array(
  "alt" => " apparel exports",
  "title" => "",
)

Thanks

Thanks Drave Robber for help.

nobody click here