Menu
in the following peice of code is a pdo sql query. im wondering which should be used to work with the data just to echo it out say, a foreach loop or a while loop. if both are possible can you please give me an example of each. thanks
[CODE]
$sql = “SELECT * FROM table WHERE column1 = :foo and column2 – :bar”;
$stmt = $connect->prepare($sql);
$result = $stmt->execute(array(
‘:foo’ = $_GET[“foo”],
‘:bar’ = $_GET[“bar”}
));