我不知道如何解释它因为我是一个PHP菜鸟,但我想在$ meta ['track'] ['中回复标题(我想从数据库中选择)标题']
<?php
$meta['neuwsarch']['title'] = "Title";
$meta['neuwsarch']['keywords'] = "key, key2, key3";
$meta['neuwsarch']['description'] = "description";
$data = mysql_query("SELECT title FROM news WHERE seo='".$seo."' AND ID='".$ID."'");
$news = mysql_fetch_assoc($data) ;
$meta['news']['title'] = "ECHO TITLE IN HERE";
$meta['news']['keywords'] = "kwd1, kwd2, kwd3";
$meta['news']['description'] = "trackert";
?>
答案 0 :(得分:0)
echo只是在屏幕上显示一个值或字符串。因此,如果您想在屏幕上显示$ news ['title']的值,请使用echo $ news ['title']。
您要做的是从SQL查询中为数组元素$ meta ['news'] ['title']指定值'title',您可以这样做:
$meta['news']['title'] = $news['title'];
答案 1 :(得分:0)
您可能希望迭代MySQL返回的结果集。
您可以在while循环中使用最后3行来迭代mysql_fetch_array()
返回的结果。
然后,开始使用PDO或MySQLi。
答案 2 :(得分:0)
我已修复它,我刚刚将其添加到行顶部:
$ID = intval ($_GET['ID']);
$seo =($_GET['seo']);
并使用了这个:
$meta['news']['title'] = $news['title'];
感谢答案的人!