Editor php SQL Server DB table name created by another DB user

Editor php SQL Server DB table name created by another DB user

binexlinebinexline Posts: 27Questions: 10Answers: 0

Hi,

I use SQL Server and almost all the tables are made by dbo while this one table is made by user "admin" with table name "users". So I normally do "select * from admin.users" to get data, but when I try this in Editor php, I get below error..

SQLSTATE[42S02]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Invalid object name 'admin.users'.

Here's the code:

Editor::inst($db, 'admin.users')
    ->fields(
        Field::inst('ID'),
        Field::inst('PW'),
        Field::inst('name'),
        Field::inst('branch'),
        Field::inst('Type')
    )
    ->process($_POST)
    ->json();

How could I solve this issue...?:S Please help

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,238Questions: 1Answers: 10,418 Site admin
    Answer ✓

    When your user admin created the table, did it go into a different schema? (I'm guessing it went into an admin schema?

    Or does, the user you are connecting to the database with in PHP have access to the admin schema?

    Allan

  • binexlinebinexline Posts: 27Questions: 10Answers: 0

    Hi Allan,

    Thanks for your reply, yes it was in a different schema, but it's solved now.. ;)

    Thank you.

This discussion has been closed.