开发者

get data from sql and show on specific location

开发者 https://www.devze.com 2023-02-09 12:10 出处:网络
I m using the following query to get data from sql : $query = mysql_query($sql); while($row = mysql_fetch_array($q))

I m using the following query to get data from sql :

$query = mysql_query($sql);

while($row = mysql_fetch_array($q))
  {
  $url = ''.$row['a'].'&nbsp;'.$row['b'].'&nbsp开发者_Go百科;'.$row['c'].'&nbsp;'.$row['d'].'<br>';
  }

now i want to do replace {URL} (that is writen in html file ) with data from sql

$mtheme = str_replace("{URL}",$url,$mtheme);

echo $mtheme;

the problem i that it shows only last row


$url .= ''.$row['a'].'&nbsp;'.$row['b'].'&nbsp;'.$row['c'].'&nbsp;'.$row['d'].'<br>';
0

精彩评论

暂无评论...
验证码 换一张
取 消