balkan7 Posted January 7, 2008 Share Posted January 7, 2008 where i worng ? <?php if ($imgname != "") ? $result = dbquery("UPDATE ".$db_prefix."news SET news_subject='$news_subject', news_cat='$news_cat', news_picture='$imgname', news_news='$body', news_extended='$body2', news_breaks='$news_breaks',".($news_start_date != 0 ? " news_datestamp='$news_start_date'," : "")." news_start='$news_start_date', news_end='$news_end_date', news_visibility='$news_visibility', news_sticky='$news_sticky', news_allow_comments='$news_comments', news_allow_ratings='$news_ratings' WHERE news_id='$news_id'"); : $result = dbquery("UPDATE ".$db_prefix."news SET news_subject='$news_subject', news_cat='$news_cat', news_news='$body', news_extended='$body2', news_breaks='$news_breaks',".($news_start_date != 0 ? " news_datestamp='$news_start_date'," : "")." news_start='$news_start_date', news_end='$news_end_date', news_visibility='$news_visibility', news_sticky='$news_sticky', news_allow_comments='$news_comments', news_allow_ratings='$news_ratings' WHERE news_id='$news_id'");?> Link to comment https://forums.phpfreaks.com/topic/84887-solved-parse-error-parse-error-unexpected/ Share on other sites More sharing options...
sasa Posted January 7, 2008 Share Posted January 7, 2008 try <?php $result = ($imgname != "") ? dbquery("UPDATE ".$db_prefix."news SET news_subject='$news_subject', news_cat='$news_cat', news_picture='$imgname', news_news='$body', news_extended='$body2', news_breaks='$news_breaks',".($news_start_date != 0 ? " news_datestamp='$news_start_date'," : "")." news_start='$news_start_date', news_end='$news_end_date', news_visibility='$news_visibility', news_sticky='$news_sticky', news_allow_comments='$news_comments', news_allow_ratings='$news_ratings' WHERE news_id='$news_id'") : dbquery("UPDATE ".$db_prefix."news SET news_subject='$news_subject', news_cat='$news_cat', news_news='$body', news_extended='$body2', news_breaks='$news_breaks',".($news_start_date != 0 ? " news_datestamp='$news_start_date'," : "")." news_start='$news_start_date', news_end='$news_end_date', news_visibility='$news_visibility', news_sticky='$news_sticky', news_allow_comments='$news_comments', news_allow_ratings='$news_ratings' WHERE news_id='$news_id'");?> Link to comment https://forums.phpfreaks.com/topic/84887-solved-parse-error-parse-error-unexpected/#findComment-432750 Share on other sites More sharing options...
revraz Posted January 7, 2008 Share Posted January 7, 2008 Can't use IF and ? together, it's one or the other. Link to comment https://forums.phpfreaks.com/topic/84887-solved-parse-error-parse-error-unexpected/#findComment-432753 Share on other sites More sharing options...
balkan7 Posted January 7, 2008 Author Share Posted January 7, 2008 try <?php $result = ($imgname != "") ? dbquery("UPDATE ".$db_prefix."news SET news_subject='$news_subject', news_cat='$news_cat', news_picture='$imgname', news_news='$body', news_extended='$body2', news_breaks='$news_breaks',".($news_start_date != 0 ? " news_datestamp='$news_start_date'," : "")." news_start='$news_start_date', news_end='$news_end_date', news_visibility='$news_visibility', news_sticky='$news_sticky', news_allow_comments='$news_comments', news_allow_ratings='$news_ratings' WHERE news_id='$news_id'") : dbquery("UPDATE ".$db_prefix."news SET news_subject='$news_subject', news_cat='$news_cat', news_news='$body', news_extended='$body2', news_breaks='$news_breaks',".($news_start_date != 0 ? " news_datestamp='$news_start_date'," : "")." news_start='$news_start_date', news_end='$news_end_date', news_visibility='$news_visibility', news_sticky='$news_sticky', news_allow_comments='$news_comments', news_allow_ratings='$news_ratings' WHERE news_id='$news_id'");?> this working one thank you ! Link to comment https://forums.phpfreaks.com/topic/84887-solved-parse-error-parse-error-unexpected/#findComment-432761 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.