Posted by: slvramesh on: September 1, 2010
When you going to add or edit path / menu in your site, it is necessary to check the menu are already taken by the site, other wise it will conflict.
When you create internal menu the drupal system automatically check with you site. but when you create external or via coding the below code will help to validate the path already taken or not.
All the internal or external menus are stored in the table “menu_router”.
/*
* Find the path is available
* Parameter menu path
* return TRUE if menu exists else return FALSE
*/
function is_path_exists($path) {
return (db_fetch_array(db_query("SELECT * FROM {menu_router} where path = '%s' ", $path))) ? TRUE : FALSE;
}