This topic is locked

SQL Query syntax

2/18/2008 6:34:56 PM
PHPRunner General questions
L
Lisa2006 author

Hi Support,
I have the following setup:
Table: posting

Fields: name, address, telephone, order_number, deleted_status, customer_unique_ref [primary key]
Table: mydetails

Fields: name, address, id [primary key]
I would like to amend the following SQL Query, so that when a user logs into posting_list.php table they are not able to see there own previously created records. They can only see other users records.
select `name`,

`address`,

`telephone`,

`order_number`,

`deleted_status`,

`customer_unique_ref`

From `posting` where deleted_status = 0
Thanks in advance
Lisa
</SPAN>

J
Jane 2/19/2008

Hi,
what security settings do you use on the Advanced security settings dialog no the Security tab? What field do you use as OwnerID in the posting table?

L
Lisa2006 author 2/19/2008

Hi,

what security settings do you use on the Advanced security settings dialog no the Security tab? What field do you use as OwnerID in the posting table?


On the posting table

Security dialog box:

  • username & password from database

    Table: mydetails

    Username: username

    Password: password
    Advanced Security Setting: User can see and edit other users data
    OwnerID = unique_customer_ref
    i.e.

    posting table:

    Record 1: mary, 0845 222 5555, 200, 0, 10

    Record 2: bob, 0845 333 6666, 201, 0, 10

    Record 3: jack, 0845 444 7777, 202, 0, 11
    mydetails table

    Record 1: fred, 5 test street, 10

    Record 1: john, 4 sample lane, 11
    Hope this helps
    Thanks
    Lisa

J
Jane 2/20/2008

Hi,
edit generated include/commonfunctions.php file for this purpose.

Here is a sample:

...

if($strTableName=="posting")

{

$ret=GetFullFieldName(GetTableOwnerID())."!=".make_db_value(GetTableOwnerID(),$ownerid);

}

...