0

mysql のテーブル travel_location 内のすべての場所を取得したい。これは私のコードです

$select = $this->_db_table->select()->from(travel_location, array('*'));

    $result = $this->_db_table->fetchAll($select);


    if(count($result) == 0) {
        throw new Exception('not found',404);
    }

    while ($row1 = mysql_fetch_array($result)){
        $user_object = new Api_Model_User($row1);

        $count = 1;

        $json = array($json[$count] = array(
        'travel_location_id' => $user_object->travel_location_id,
        'city_id' => $user_object->city_id,
        'user_id' => $user_object->user_id,
        'location_name' => $user_object->location_name,
        'description' => $user_object->description,
        'longitude' => $user_object->longitude,
        'latitude' => $user_object->latitude,
        'created_time' => $user_object->created_time,
        'updated_time' => $user_object->updated_time));

        $count++;
    }

うまくいきません。$row1 = mysql_fetch_array($result) を出力すると false が返されるので、この行のせいで間違っていると思います。どうすれば修正できますか?

4

1 に答える 1