Stand v. 31.08.2011
<?php
/**
* @author Bettina Schwarzer
* @copyright 2011
*
* TEST mit stmt-Klasse mysqli
*/
include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
$dbc = new dbconnection();
echo "TEST mit stmt-Klasse mysqli<br />\n";
$stmt = $dbc -> stmtinit(); // jetzt wird das $stmt-Objekt erstellt
if (is_object($stmt))
{
$stmt -> prepare ("SELECT * FROM Vertrag WHERE contract_ID < ? ");
$stmt -> bind_param('i',$id);
$id=12;
$stmt -> execute();
$stmt -> store_result();
$stmt -> bind_result($c_ID, $cname, $cs, $cl, $vtyp_ID, $cbegin, $cend, $cmon, $cfile, $cbem);
if ($anz = $stmt -> num_rows)
{
echo "$anz Verträge gefunden<br />\n";
echo "<table>\n";
while ($stmt -> fetch())
{
echo "<tr><td>$c_ID</td>
<td>$cname</td>
<td>$cl</td>
<td>$vtyp_ID</td>
<td>$cbegin</td>
<td>$cend</td>
<td>$cmon</td>
<td>$cfile</td>
<td>$cbem</td></tr>\n";
}
echo "</table>\n";
}
$stmt -> close();
}
?>