帮我函数getListCategory()

时间:2011-06-30 01:44:33

标签: php mysql

function getCategoryList()
{
    global $conn;
    $result = @mysql_query("Select * From categories", $conn);
    $ret = array();
    while($row = mysql_fetch_assoc($result))
    {
        $ret[] = $row;
    }
    return $ret;
}

=> output = null 虽然数据库不为null(例如:category(1,laptop,500)) 我认为$ ret [] = $ row; 帮助我

1 个答案:

答案 0 :(得分:0)

您有 @mysql_query(

放弃 @

$result = mysql_query("Select * From categories", $conn);