Professional Web Applications Themes

How to make different "sections" in a db - MySQL

I am a php/mySQL newbie and I wonder if someone could give some advice: - my final aim is to build a database to which quite a large group of different co-workers should have access. - I would like to use some system of authentication / individual passwords - Each co-worker should have the opportunity to add data. However (here's the snag) as far as changing data in the db is concerned, each co-worker should only have the possibility to change the data that HE HIMSELF entered earlier. So data entered by others should be shielded off. Does anyone have ...

  1. #1

    Default How to make different "sections" in a db

    I am a php/mySQL newbie and I wonder if someone could give some advice:



    - my final aim is to build a database to which quite a large group of
    different co-workers should have access.

    - I would like to use some system of authentication / individual passwords

    - Each co-worker should have the opportunity to add data. However (here's
    the snag) as far as changing data in the db is concerned, each co-worker
    should only have the possibility to change the data that HE HIMSELF entered
    earlier. So data entered by others should be shielded off.



    Does anyone have any suggestions how I should tackle this problem?

    Or does anyone know links to sites where this matter is described in
    comprehensible newbie-terms?

    Or - even more ideal - does anyone know about scripts that work in this way?



    Thanks in advance for thinking about thus question,

    Herbert



    Herbert Guest

  2. #2

    Default Re: How to make different "sections" in a db

    Herbert wrote:
    > I am a php/mySQL newbie and I wonder if someone could give some advice:
    >
    >
    >
    > - my final aim is to build a database to which quite a large group of
    > different co-workers should have access.
    >
    > - I would like to use some system of authentication / individual passwords
    >
    > - Each co-worker should have the opportunity to add data. However (here's
    > the snag) as far as changing data in the db is concerned, each co-worker
    > should only have the possibility to change the data that HE HIMSELF entered
    > earlier. So data entered by others should be shielded off.
    >
    >
    >
    > Does anyone have any suggestions how I should tackle this problem?
    >
    > Or does anyone know links to sites where this matter is described in
    > comprehensible newbie-terms?
    >
    > Or - even more ideal - does anyone know about scripts that work in this way?
    >
    >
    >
    > Thanks in advance for thinking about thus question,
    >
    > Herbert
    >
    >
    >
    Herbert,

    Probably done easier in an application. Just have one password for the
    application and keep a table of userids and passwords. When someone enters a
    new record, attach their userid to that record. When they go to edit, validate
    the current userid with the one in the record.

    The other way you *could* do it is with views (MySQl 5+). But you'd have to
    give each person their own MySQL login, grant SELECT and INSERT access to the
    tables, create a view and grant UPDATE access to the view. You'll still have to
    keep the userid in the record and limit the view to only those rows with the
    appropriate userid. And you'd have to repeat this for every person.

    It can be done (with MySQL 5+), but MySQL and other RDB's generally don't do
    this granularity very well.


    --
    ==================
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    [email]jstucklexattglobal.net[/email]
    ==================
    Jerry Stuckle Guest

  3. #3

    Default Re: How to make different "sections" in a db

    I think Jerry covered it above but just to elaborate:

    your table could look like this (not normalized):

    table1
    | id | entry | created_by |
    | 1 | hello | John |
    | 2 | hi | Paul |
    | 3 | wotcha | George |
    | 4 | bye | Ringo |

    then in php you could use a statement like this (abridged) to generate
    the query;

    update table1 set entry = '$value' where id = $row_id and
    last_modified_by = '$user'

    This would only allow row 4 (for instance) to be modified if the system
    was satisfied that the user was Ringo.

    Herbert wrote:
    > I am a php/mySQL newbie and I wonder if someone could give some advice:
    >
    >
    >
    > - my final aim is to build a database to which quite a large group of
    > different co-workers should have access.
    >
    > - I would like to use some system of authentication / individual passwords
    >
    > - Each co-worker should have the opportunity to add data. However (here's
    > the snag) as far as changing data in the db is concerned, each co-worker
    > should only have the possibility to change the data that HE HIMSELF entered
    > earlier. So data entered by others should be shielded off.
    >
    >
    >
    > Does anyone have any suggestions how I should tackle this problem?
    >
    > Or does anyone know links to sites where this matter is described in
    > comprehensible newbie-terms?
    >
    > Or - even more ideal - does anyone know about scripts that work in this way?
    >
    >
    >
    > Thanks in advance for thinking about thus question,
    >
    > Herbert
    strawberry Guest

  4. #4

    Default Re: How to make different "sections" in a db

    strawberry wrote:
    > I think Jerry covered it above but just to elaborate:
    >
    > your table could look like this (not normalized):
    >
    > table1
    >> id | entry | created_by |
    >> 1 | hello | John |
    >> 2 | hi | Paul |
    >> 3 | wotcha | George |
    >> 4 | bye | Ringo |
    >
    > then in php you could use a statement like this (abridged) to generate
    > the query;
    >
    > update table1 set entry = '$value' where id = $row_id and
    > last_modified_by = '$user'
    I think you meant created_by = '$user'
    >
    > This would only allow row 4 (for instance) to be modified if the
    > system was satisfied that the user was Ringo.
    >
    > Herbert wrote:
    >> I am a php/mySQL newbie and I wonder if someone could give some
    >> advice:
    >>
    >>
    >>
    >> - my final aim is to build a database to which quite a large group of
    >> different co-workers should have access.
    >>
    >> - I would like to use some system of authentication / individual
    >> passwords
    >>
    >> - Each co-worker should have the opportunity to add data. However
    >> (here's the snag) as far as changing data in the db is concerned,
    >> each co-worker should only have the possibility to change the data
    >> that HE HIMSELF entered earlier. So data entered by others should be
    >> shielded off.
    >>
    >>
    >>
    >> Does anyone have any suggestions how I should tackle this problem?
    >>
    >> Or does anyone know links to sites where this matter is described in
    >> comprehensible newbie-terms?
    >>
    >> Or - even more ideal - does anyone know about scripts that work in
    >> this way?
    >>
    >>
    >>
    >> Thanks in advance for thinking about thus question,
    >>
    >> Herbert


    Paul Lautman Guest

  5. #5

    Default Re: How to make different "sections" in a db

    yep, that's right - forgot to change the query

    Paul Lautman wrote:
    > strawberry wrote:
    > > I think Jerry covered it above but just to elaborate:
    > >
    > > your table could look like this (not normalized):
    > >
    > > table1
    > >> id | entry | created_by |
    > >> 1 | hello | John |
    > >> 2 | hi | Paul |
    > >> 3 | wotcha | George |
    > >> 4 | bye | Ringo |
    > >
    > > then in php you could use a statement like this (abridged) to generate
    > > the query;
    > >
    > > update table1 set entry = '$value' where id = $row_id and
    > > last_modified_by = '$user'
    > I think you meant created_by = '$user'
    > >
    > > This would only allow row 4 (for instance) to be modified if the
    > > system was satisfied that the user was Ringo.
    > >
    > > Herbert wrote:
    > >> I am a php/mySQL newbie and I wonder if someone could give some
    > >> advice:
    > >>
    > >>
    > >>
    > >> - my final aim is to build a database to which quite a large group of
    > >> different co-workers should have access.
    > >>
    > >> - I would like to use some system of authentication / individual
    > >> passwords
    > >>
    > >> - Each co-worker should have the opportunity to add data. However
    > >> (here's the snag) as far as changing data in the db is concerned,
    > >> each co-worker should only have the possibility to change the data
    > >> that HE HIMSELF entered earlier. So data entered by others should be
    > >> shielded off.
    > >>
    > >>
    > >>
    > >> Does anyone have any suggestions how I should tackle this problem?
    > >>
    > >> Or does anyone know links to sites where this matter is described in
    > >> comprehensible newbie-terms?
    > >>
    > >> Or - even more ideal - does anyone know about scripts that work in
    > >> this way?
    > >>
    > >>
    > >>
    > >> Thanks in advance for thinking about thus question,
    > >>
    > >> Herbert
    strawberry Guest

  6. #6

    Default Re: How to make different "sections" in a db

    Thanks a lot folks!

    Herbert


    "strawberry" <zac.carey> schreef in bericht
    news:1150247051.880346.5950f6g2000cwb.googlegroup s.com...
    > yep, that's right - forgot to change the query
    >
    > Paul Lautman wrote:
    > > strawberry wrote:
    > > > I think Jerry covered it above but just to elaborate:
    > > >
    > > > your table could look like this (not normalized):
    > > >
    > > > table1
    > > >> id | entry | created_by |
    > > >> 1 | hello | John |
    > > >> 2 | hi | Paul |
    > > >> 3 | wotcha | George |
    > > >> 4 | bye | Ringo |
    > > >
    > > > then in php you could use a statement like this (abridged) to generate
    > > > the query;
    > > >
    > > > update table1 set entry = '$value' where id = $row_id and
    > > > last_modified_by = '$user'
    > > I think you meant created_by = '$user'
    > > >
    > > > This would only allow row 4 (for instance) to be modified if the
    > > > system was satisfied that the user was Ringo.
    > > >
    > > > Herbert wrote:
    > > >> I am a php/mySQL newbie and I wonder if someone could give some
    > > >> advice:
    > > >>
    > > >>
    > > >>
    > > >> - my final aim is to build a database to which quite a large group of
    > > >> different co-workers should have access.
    > > >>
    > > >> - I would like to use some system of authentication / individual
    > > >> passwords
    > > >>
    > > >> - Each co-worker should have the opportunity to add data. However
    > > >> (here's the snag) as far as changing data in the db is concerned,
    > > >> each co-worker should only have the possibility to change the data
    > > >> that HE HIMSELF entered earlier. So data entered by others should be
    > > >> shielded off.
    > > >>
    > > >>
    > > >>
    > > >> Does anyone have any suggestions how I should tackle this problem?
    > > >>
    > > >> Or does anyone know links to sites where this matter is described in
    > > >> comprehensible newbie-terms?
    > > >>
    > > >> Or - even more ideal - does anyone know about scripts that work in
    > > >> this way?
    > > >>
    > > >>
    > > >>
    > > >> Thanks in advance for thinking about thus question,
    > > >>
    > > >> Herbert
    >

    Herbert Guest

Similar Threads

  1. #33400 [Opn->Csd]: make "make" a dendency of "make test"
    By tony2001@php.net in forum PHP Bugs
    Replies: 0
    Last Post: November 11th, 01:54 AM
  2. How to make "Print page" and "Print Chapter" buttons
    By Jaco_J_Cloete@adobeforums.com in forum Adobe Acrobat Macintosh
    Replies: 0
    Last Post: July 20th, 12:05 PM
  3. Replies: 1
    Last Post: February 25th, 03:59 PM
  4. "Start" "Program" "Menu" list is empty
    By Pete in forum Windows XP/2000/ME
    Replies: 2
    Last Post: July 10th, 10:42 PM
  5. How to make the "search text" feature work with non "txt" file
    By Sharon F in forum Windows XP/2000/ME
    Replies: 0
    Last Post: June 30th, 07:43 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139