Array ( [0] => stdClass Object ( [id] => 2 [title] => ni ha [links] => http://www.i8081.cn [checked] => 1 [content] => fsdfdsfdsfdsfsd [sx] => 2 ) [1] => stdClass Object ( [id] => 1 [title] => 测试添加 [links] => http://www.i8081.cn [checked] => 2 [content] => 测试添加测试添加测试添加 [sx] => 3 ) [2] => stdClass Object ( [id] => 3 [title] => wo de shi [links] => http://www.i8081.cn [checked] => 1 [content] => dsfdsfsfdsf [sx] => 3 ) [3] => stdClass Object ( [id] => 4 [title] => 我的测试 [links] => http://www.lzweilan.com [checked] => 2 [content] => 测试内容和 [sx] => 55 ) [4] => stdClass Object ( [id] => 5 [title] => 我的测试 [links] => http://www.lzweilan.com [checked] => 2 [content] => 测试内容和 [sx] => 55 ) )
function query($sql)
{
$this->_construct();
$result_array = array();
$i=0;
$query_result=mysql_query($sql,$this->connection);
while ($row=mysql_fetch_object($query_result))
{ $result_array[$i++]=$row;
}
$this->_destruct();
/* print_r($result_array); */
return $result_array;
}
程序调用
$db = new data_class;
$sql="Select * FROM about Order BY sx";
$db->query($sql) 高手帮我看看弄,我以前是做。net开发的,从网上找了很多资料都没有弄清楚,大家帮忙看看
$array_all = Array ( [0] => stdClass Object ( [id] => 2 [title] => ni ha [links] => http://www.i8081.cn [checked] => 1 [content] => fsdfdsfdsfdsfsd [sx] => 2 ) [1] => stdClass Object ( [id] => 1 [title] => 测试添加 [links] => http://www.i8081.cn [checked] => 2 [content] => 测试添加测试添加测试添加 [sx] => 3 ) [2] => stdClass Object ( [id] => 3 [title] => wo de shi [links] => http://www.i8081.cn [checked] => 1 [content] => dsfdsfsfdsf [sx] => 3 ) [3] => stdClass Object ( [id] => 4 [title] => 我的测试 [links] => http://www.lzweilan.com [checked] => 2 [content] => 测试内容和 [sx] => 55 ) [4] => stdClass Object ( [id] => 5 [title] => 我的测试 [links] => http://www.lzweilan.com [checked] => 2 [content] => 测试内容和 [sx] => 55 ) );foreach ($array as $key=>$array_value){
echo "$array_value['id']";
echo "$array_value['title']";
echo "$array_value['links']";
echo "$array_value['content']";
}//单独调用$number = $array_all[数字序号]['id'];
$arr_id = $array_all[数字序号]['title'];……
echo 输出要么不加引号,要么给变量加两个点
<tr>
<td width="20%" >id</td>
<td>顺序</td>
<td>上移</td>
<td>下移</td>
<td>标题</td>
<td>详细</td>
<td>审核</td>
<td>删除</td>
</tr>
<?php
$db = new data_class;
$sql="Select * FROM about Order BY sx";
$array_all = $db->query($sql)
/* for($i=0;$i<count($db->query($sql));$i++)
{ */
foreach($array as $key=>$array_all )
{
?>
<tr>
<td><?php echo $array_value['id']; ?></td>
<td></td>
<td> </td>
<td> </td>
<td></td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<?php
}
?>
</table>
还是不行呀!!!
foreach ($array_all as $key=>$array_value)
{
echo $array_value['id'];
}
echo "$value['id']";
echo "$value['title']";
echo "$value['links']";
echo "$value['content']";
}这样应该可以潢足你的