' . "\n"; echo ' ' . $strRoutines . '' . "\n"; echo ''; echo sprintf('', $strName, $strType, $strRoutineReturnType); $ct=0; $delimiter = '//'; foreach ($routines as $routine) { // information_schema (at least in MySQL 5.0.45) // does not return the routine parameters // so we rely on PMA_DBI_get_definition() which // uses SHOW CREATE $definition = 'DROP ' . $routine['ROUTINE_TYPE'] . ' ' . PMA_backquote($routine['SPECIFIC_NAME']) . $delimiter . "\n" . PMA_DBI_get_definition($db, $routine['ROUTINE_TYPE'], $routine['SPECIFIC_NAME']) . "\n"; //if ($routine['ROUTINE_TYPE'] == 'PROCEDURE') { // $sqlUseProc = 'CALL ' . $routine['SPECIFIC_NAME'] . '()'; //} else { // $sqlUseProc = 'SELECT ' . $routine['SPECIFIC_NAME'] . '()'; /* this won't get us far: to really use the function i'd need to know how many parameters the function needs and then create something to ask for them. As i don't see this directly in the table i am afraid that requires parsing the ROUTINE_DEFINITION and i don't really need that now so i simply don't offer a method for running the function*/ //} if ($routine['ROUTINE_TYPE'] == 'PROCEDURE') { $sqlDropProc = 'DROP PROCEDURE ' . PMA_backquote($routine['SPECIFIC_NAME']); } else { $sqlDropProc = 'DROP FUNCTION ' . PMA_backquote($routine['SPECIFIC_NAME']); } echo sprintf('', ($ct%2 == 0) ? 'even' : 'odd', $routine['ROUTINE_NAME'], ! empty($definition) ? PMA_linkOrButton('db_sql.php?' . $url_query . '&sql_query=' . urlencode($definition) . '&show_query=1&delimiter=' . urlencode($delimiter), $titles['Structure']) : ' ', '' . $titles['Drop'] . '', $routine['ROUTINE_TYPE'], $routine['DTD_IDENTIFIER']); $ct++; } echo '
%s     %s %s
%s %s %s %s %s
'; echo '' . "\n"; echo '' . "\n"; } ?>