$match) { $field = array( "field" => str_replace("``", "`", $match[2]) . $match[3], "type" => $match[4], //! type aliases "length" => $match[5], //! replace \' by '', replace "" by '' "unsigned" => ($match[6] ? "unsigned" : ""), // zerofill ignored "null" => true, ); if (strcasecmp("out", substr($match[1], -3)) == 0) { $out[$i] = "@" . idf_escape($field["field"]) . " AS " . idf_escape($field["field"]); } if (!$match[1] || strcasecmp("in", substr($match[1], 0, 2)) == 0) { $in[] = $i; } $params[$i] = $field; } if ($_POST) { $call = array(); foreach ($params as $key => $field) { if (in_array($key, $in)) { $val = process_input($key, $field); if (isset($out[$key])) { mysql_query("SET @" . idf_escape($field["field"]) . " = " . $val); } } $call[] = (isset($out[$key]) ? "@" . idf_escape($field["field"]) : $val); } $result = mysql_query((isset($_GET["callf"]) ? "SELECT" : "CALL") . " " . idf_escape($_GET["call"]) . "(" . implode(", ", $call) . ")"); if (!$result) { $error = mysql_error(); } elseif ($result === true) { $message = lang('Routine has been called, %d row(s) affected.', mysql_affected_rows()); if (!$out) { redirect(substr($SELF, 0, -1), $message); } } } page_header(lang('Call') . ": " . htmlspecialchars($_GET["call"])); if ($_POST) { if (!$result) { echo "
" . lang('Error during calling') . ": " . htmlspecialchars($error) . "
\n"; } else { if ($result == true) { echo " \n"; } else { select($result); } if ($out) { select(mysql_query("SELECT " . implode(", ", $out))); } } } ?>