Beispiel #1
0
/**
*Function to return all the Manufacturer in the database
*/
function getManufacturers()
{
    include "manufacturer.php";
    $myManu = new Manufacturer();
    $row = $myManu->viewManufacturers();
    if (!$row) {
        echo '{"result": 0, "message": "You have no Manufacturer in the database"}';
        return;
    }
    echo '{"result": 1, "manufacturer": [';
    while ($row) {
        echo json_encode($row);
        $row = $myManu->fetch();
        if ($row) {
            echo ',';
        }
    }
    echo "]}";
    return;
}