Skip to content

Commit

Permalink
Added project_get_id_by_name().
Browse files Browse the repository at this point in the history
git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@3005 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
vboctor committed Sep 27, 2004
1 parent f3fe2bd commit 2d43952
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion core/project_api.php
Expand Up @@ -6,7 +6,7 @@
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Id: project_api.php,v 1.60 2004-09-22 10:03:42 bpfennigschmidt Exp $
# $Id: project_api.php,v 1.61 2004-09-27 12:45:15 vboctor Exp $
# --------------------------------------------------------

$t_core_dir = dirname( __FILE__ ).DIRECTORY_SEPARATOR;
Expand Down Expand Up @@ -329,6 +329,23 @@ function project_update( $p_project_id, $p_name, $p_description, $p_status, $p_v
# Data Access
#===================================

# --------------------
# Get the id of the project with the specified name
function project_get_id_by_name( $p_project_name ) {
$c_project_name = db_prepare_string( $p_project_name );

$t_project_table = config_get( 'mantis_project_table' );

$query = "SELECT id FROM $t_project_table WHERE name = '$c_project_name'";
$t_result = db_query( $query, 1 );

if ( db_num_rows( $t_result ) == 0 ) {
return 0;
} else {
return db_result( $t_result );
}
}

# --------------------
# Return the row describing the given project
function project_get_row( $p_project_id ) {
Expand Down

0 comments on commit 2d43952

Please sign in to comment.