<?php
$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB");
/* check connection */
if (!$link) {
printf("Connect failed: %s\n", maxdb_connect_error());
exit();
}
maxdb_report (MAXDB_REPORT_OFF);
maxdb_query($link,"DROP DBPROC test_proc");
maxdb_report (MAXDB_REPORT_ERROR);
$query = "create dbproc test_proc (INOUT e_text char(72)) AS select * from SYSDBA.DUAL; fetch into :e_text;";
maxdb_query($link, $query);
/* Performing SQL query */
$stmt = maxdb_prepare ($link, "CALL test_proc (?)");
if (!$stmt) {
printf ("Prepare failed: %s\n", maxdb_error($link));
}
maxdb_stmt_bind_param($stmt, 's', $result);
maxdb_stmt_execute($stmt);
printf ("%s\n", $result);
maxdb_stmt_close ($stmt);
?>