Exemple #1
0
function getBugsPrinted($db)
{
    // create a SQL query as a string
    $sql_query = "SELECT * FROM Bugs";
    // execute the SQL query
    $result = $db->query($sql_query);
    // iterate over $result object one $row at a time
    // use fetch_array() to return an associative array
    while ($row = $result->fetch_array()) {
        $a = $row['bugName'];
        $b = $row['bugSummary'];
        $c = $row['bugCategory'];
        // echo "<p>{$a}</p>";
        PrintBug($a, $b, $c);
    }
}
Exemple #2
0
}
fclose($myfile);
echo "<hr>";
//add data from addBugs.php page
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
    // loop through the superglobal POST array
    foreach ($_GET as $key => $value) {
        print "key: " . $key . " value: " . $value;
    }
    echo "<hr>";
}
//echo "you are here3! login page";
$a = $_GET['txtName'];
$b = $_GET['txtCat'];
$c = $_GET['txtSum'];
PrintBug($a, $b, $c);
?>
        <?php 
//get data entered by user on insert bug page";
$a = $_GET['txtName'];
$b = $_GET['txtSum'];
$c = $_GET['txtCat'];
//add data from addBugs.php page
if (isset($_GET['txtName'])) {
    //ADD DATA TO DB
    addBug($db1, $a, $b, $c);
}
//display all bugs
getBugsPrinted($db1);
?>