get url id in php and display result in html -
get url id in php and display result in html -
hi have written code in order news id url , display news result id stored in mysql. dont know doing wrong. getting output. have test query running fine in mysql.i doing little misatke not able identif may syntax or quotation somewhere. thanks. here url:
http://autodo/admin/news.php?id=2043
here code:
<?php $id=$_get['id']; $sql=" select distinct ad_news.datum, ad_news_texte.text, ad_news_texte.headline, ad_news_texte.id autodo.ad_news_texte, autodo.ad_news ad_news_texte.id =".$id." grouping ad_news_texte.text, ad_news_texte.headline, ad_news_texte.id"; echo $sql_select=mysql_query($sql); if($row = mysql_fetch_assoc($sql_select)){ $news_id= $row['id']; $news_datum= $row['datum']; $news_text= $row['text']; $news_headline= $row['headline']; ?> <div class="welcome-rahmen lng togglenews" id="<?= $news_id ?> "> <p class="welcome-breadcrump"><?= $news_datum ?></p> <p class="welcome-subheadline"><?= $news_headline ?></p> <div class="newstext"> <?= $news_text ?> </div> </div> <? } ?>
you should concatenate $id , sql string .
for example:
$sql=" select distinct ad_news.datum, ad_news_texte.text, ad_news_texte.headline, ad_news_texte.id autodo.ad_news_texte, autodo.ad_news ad_news_texte.id =".$id." grouping ad_news_texte.text, ad_news_texte.headline, ad_news_texte.id";
php html mysql url
Comments
Post a Comment