php - Serialize function not working inside query -



php - Serialize function not working inside query -

hi have update query using select statement. query update table row using select statement(select statement returns multiple rows). query working fine without serialize function. want separate text in column , display result in proper format. used serialize function query not running now. want separate text column still fine me. because want display result in proper format in php.thank you. here code:

if(($param['news'])==4){

$sql="update dashboard_widget_users set configuration = ( select group_concat(distinct ad_news_texte.headline) autodo.ad_news_texte inner bring together autodo.ad_news_oe on ad_news_texte.news_id = ad_news_oe.id_ad_news inner bring together autodo.ad_news on ad_news_oe.id_ad_news = ad_news.id ad_news.datum_archiv between curdate( ) - interval dayofweek( curdate( ) ) +28 day , curdate( ) ) dsnr_yw_user =12 , dsnr_dashboard_widget =2"; } elseif(($param['news'])==6){ $sql="update dashboard_widget_users set configuration = ( select group_concat(distinct ad_news_texte.headline) autodo.ad_news_texte inner bring together autodo.ad_news_oe on ad_news_texte.news_id = ad_news_oe.id_ad_news inner bring together autodo.ad_news on ad_news_oe.id_ad_news = ad_news.id ad_news.datum_archiv between curdate( ) - interval dayofweek( curdate( ) ) +42 day , curdate( ) ) dsnr_yw_user =12 , dsnr_dashboard_widget =2"; } elseif(($param['news'])==10){ $sql="update dashboard_widget_users set configuration=( select group_concat(distinct ad_news_texte.headline) autodo.ad_news_texte inner bring together autodo.ad_news_oe on ad_news_texte.news_id = ad_news_oe.id_ad_news inner bring together autodo.ad_news on ad_news_oe.id_ad_news = ad_news.id ad_news.datum_archiv between curdate( ) - interval dayofweek( curdate( ) ) +70 day , curdate( ) ) dsnr_yw_user =12 , dsnr_dashboard_widget =2"; } $sql_select=mysql_query($sql) ; while ($row = mysql_fetch_array($sql_select)) { $config=serialize($row['configuration']); $update="update dashboard_widget_users w set w.configuration=\"".mysql_real_escape_string(serialize($config))."\" w.dsnr_yw_user =12 , w.dsnr_dashboard_widget=2 "; $update_news=mysql_query($update, $myconnection); }

result of update query without serialize function. can see multiple rows using select statement stored within single row using update statement. want echo above result in proper separated format in php. used serialize function store result database , utilize unserialize function result in proper format :

neu: angebote nur noch mit kundennamen druckbar!, new: offers printable client names!, autodo! update: neue suchkriterien in der fahrzeugsuche!,autodo! update: new search criteria in vehicle search! ,export topused navigator autoscout , mascus,nur offline autodo! update:neue funktionen in der fahrzeugsuche für ihre homepage!,autodo! news: neue pflichtfelder für neuwagen bei mobile.de!,neues suchkriterium: recall campaign,new search criterion: recall campaign,autodo! news: neue pflichtfelder für neuwagen bei autoscout24.de!,new intercompany prices delivery schmitz cargobull russia.,autodo! startet durch.

php mysql serialization

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -