我最后的回声语句肯定是错误的,我把它放进去只是为了展示我想要做什么,我只是想把这三个变量称为之前设置的。这样做的正确方法是什么?
$table_id = 'mynewtable';
$query = "SELECT id,name,price FROM $table_id";
$result_set= mysql_query($query);
$id = "SELECT id FROM $table_id";
$name = "SELECT name FROM $table_id";
$price = "SELECT price FROM $table_id";
if ($result_set){
$record= mysql_fetch_row($result_set);
$idrecord= mysql_fetch_row($id);
$namerecord= mysql_fetch_row($name);
$pricerecord= mysql_fetch_row($price);
foreach ( $record as $value){
echo "<td><tr> $idrecord $namerecord $pricerecord </tr></td>";
}
}