diff --git a/db_details.php3 b/db_details.php3 index 24ae107ba..cbfded0b9 100755 --- a/db_details.php3 +++ b/db_details.php3 @@ -78,13 +78,14 @@ if($cfgBookmark['db'] && $cfgBookmark['table']) if(($bookmark_list=list_bookmarks($db, $cfgBookmark)) && count($bookmark_list)>0) { echo "$strOr $strBookmarkQuery:
\n"; - echo "\n"; echo "\n"; while(list($key,$value)=each($bookmark_list)) { echo "\n"; } echo "\n"; - echo "".$strBookmarkView; + echo "".$strBookmarkView; + echo "".$strDelete; echo "
\n"; } } diff --git a/lib.inc.php3 b/lib.inc.php3 index 60e73edb6..370c6e1b0 100755 --- a/lib.inc.php3 +++ b/lib.inc.php3 @@ -54,7 +54,7 @@ function show_table_navigation($pos_next, $pos_prev, $dt_result) { ( isset($SelectNumRows) && $pos + $sessionMaxRows < $SelectNumRows && mysql_num_rows($dt_result) >= $sessionMaxRows ? "true" : "false" ); ?>" action= + "\"sql.php3?server=$server&lang=$lang&db=$db&table=$table&sql_query=%s&sql_order=%s&pos=%d&sessionMaxRows=%d&goto=%s\"", urlencode($sql_query),urlencode($sql_order),$SelectNumRows - $sessionMaxRows, $sessionMaxRows, (isset($goto) ? $goto : ''));?> >" > @@ -718,7 +718,7 @@ function get_bookmarks_param() { } function list_bookmarks($db, $cfgBookmark) { - $query="SELECT label, query FROM ".$cfgBookmark['db'].".".$cfgBookmark['table']." WHERE dbase='$db'"; + $query="SELECT label, id FROM ".$cfgBookmark['db'].".".$cfgBookmark['table']." WHERE dbase='$db'"; $result=mysql_db_query($cfgBookmark['db'], $query); if($result>0 && mysql_num_rows($result)>0) @@ -735,6 +735,19 @@ function list_bookmarks($db, $cfgBookmark) { return false; } +function query_bookmarks($db, $cfgBookmark, $id) { + $query="SELECT query FROM ".$cfgBookmark['db'].".".$cfgBookmark['table']." WHERE dbase='$db' AND id='$id'"; + $result=mysql_db_query($cfgBookmark['db'], $query); + $bookmark_query=mysql_result($result,0,"query"); + + return $bookmark_query; +} + +function delete_bookmarks($db, $cfgBookmark, $id) { + $query="DELETE FROM ".$cfgBookmark['db'].".".$cfgBookmark['table']." WHERE id='$id'"; + $result=mysql_db_query($cfgBookmark['db'], $query); +} + $cfgBookmark=get_bookmarks_param(); } // $__LIB_INC__