Exemple #1
0
function get_tecnica($dbconn)
{
    $query = "SELECT * FROM tecnica ORDER by id ASC";
    $query_response = $dbconn->query($query);
    $counter = 0;
    $tecnica = [];
    while ($row = $query_response->fetch_assoc()) {
        $tecnica[$counter]['id'] = $row['id'];
        $tecnica[$counter]['nome'] = $row['nome'];
        //get associated images
        $tecnica[$counter]['img'] = get_img($dbconn, 'tecnica', $tecnica[$counter]['id']);
        $tecnica[$counter]['detalhes'] = get_detalhes($dbconn, $tecnica[$counter]['id']);
        $counter++;
        //proxima medicao da tabela SQL
    }
    return $tecnica;
}
Exemple #2
0
function get_tecnica($dbconn)
{
    $query = "SELECT * FROM requilib_website.tecnica ORDER by id ASC";
    $query_response = mysql_query($query, $dbconn) or die(mysql_error());
    $counter = 0;
    $tecnica = [];
    while ($row = mysql_fetch_array($query_response)) {
        $tecnica[$counter]['id'] = $row['id'];
        $tecnica[$counter]['nome'] = $row['nome'];
        //get associated images
        $tecnica[$counter]['img'] = get_img($dbconn, 'tecnica', $tecnica[$counter]['id']);
        $tecnica[$counter]['detalhes'] = get_detalhes($dbconn, $tecnica[$counter]['id']);
        $counter++;
        //proxima medicao da tabela SQL
    }
    echo json_encode(utf8ize($tecnica));
    return $tecnica;
}
Exemple #3
0
function get_tecnica($dbconn)
{
    $query = "SELECT * FROM tecnica ORDER by id ASC";
    $query_response = pg_query($dbconn, $query);
    $counter = 0;
    $tecnica = [];
    while ($row = @pg_fetch_array($query_response, $counter, PGSQL_BOTH)) {
        $tecnica[$counter]['id'] = $row['id'];
        $tecnica[$counter]['nome'] = $row['nome'];
        //get associated images
        $tecnica[$counter]['img'] = get_img($dbconn, 'tecnica', $tecnica[$counter]['id']);
        $tecnica[$counter]['detalhes'] = get_detalhes($dbconn, $tecnica[$counter]['id']);
        $counter++;
        //proxima medicao da tabela SQL
        if ($counter == pg_num_rows($query_response)) {
            break;
            //para a execução do ciclo para que não haja erro quando $counter>numero de linhas na tabela
        }
    }
    echo json_encode($tecnica);
    return $tecnica;
}