Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-19-2007, 01:09 PM
Junior Member
 
Join Date: Aug 2007
Posts: 3
Default Database check if exist

I have the following problem. I have a database with the following tables users and roles. I want to check if the role is in use by a user if this is true than the role can not be removed and this must be visual to the user by the words "In gebruik" (dutch for "in use"). My layout of my tables is this:

The users table:
Id
username
password
real_name
role ---------> this is the Id of the role table
e-mail

The roles table:
Id
name
access

I have created the following files for the database communication:

users.php
PHP Code:
class Users extends Zend_Db_Table_Abstract
{
    protected 
$_name 'users';
    protected 
$_primary 'id';

roles.php
PHP Code:
class Roles extends Zend_Db_Table_Abstract
{
    protected 
$_name 'roles';
    protected 
$_primary 'id';

I hope that someone can help me because I'm really stuck here.

Thank you,

Ivo

Last edited by ivotrompert : 08-19-2007 at 01:23 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 02:58 AM.