adminerevo/call.inc.php
jakubvrana bf12723f5d Prepare for call
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@78 7c3ca157-0c34-0410-bff1-cbf682f78f5c
2007-07-09 07:29:02 +00:00

39 lines
1.1 KiB
PHP

<?php
mysql_result(mysql_query("SHOW CREATE " . ($_GET["type"] == "FUNCTION" ? "FUNCTION" : "PROCEDURE")), 0, 2);
if ($_POST) {
if (isset($_GET["function"])) {
} else {
}
$result = mysql_query("CALL " . idf_escape($_GET["call"])); //! params
if ($result === true) {
redirect(substr($SELF, 0, -1), lang('Routine has been called, %d row(s) affected.', mysql_affected_rows()));
} elseif (!$result) {
$error = mysql_error();
}
}
page_header(lang('Call') . ": " . htmlspecialchars($_GET["call"]));
if ($_POST) {
if (!$result) {
echo "<p class='error'>" . lang('Error during calling') . ": " . htmlspecialchars($error) . "</p>\n";
} else {
select($result);
}
}
?>
<form action="" method="post">
<?php
if ($params) {
echo "<table border='0' cellspacing='0' cellpadding='2'>\n";
foreach ($params as $key => $val) {
echo "<tr><th>" . htmlspecialchars($key) . "</th><td>" . input("param[]", $val["type"]) . "</td></tr>\n";
}
echo "</table>\n";
}
?>
<p><input type="hidden" name="token" value="<?php echo $token; ?>" /><input type="submit" value="<?php echo lang('Call'); ?>" /></p>
</form>