Fatal error: Cannot use object of type stdClass as array in /var/www/html/mydbr......

(19 posts) (2 voices)

Tags:

No tags yet.

  1. mfiorentino, Member

    Hi,
    i have add this line in user/default.php

    <?php
    // This is used to override values in defaults.php at main level.

    $mydbr_defaults['page_title'] = 'myDBR Own';
    $mydbr_defaults['remote_server']['debug_result'] = true;

    /*
    Debug flag to determine server cookie problems.
    Enabling this may expose your database login information so use with caution

    $mydbr_defaults['debug_cookie'] = true;
    */

    but result always is:
    Fatal error: Cannot use object of type stdClass as array in /var/www/html/mydbr.tuttogroup.com/apps/showReport.php on line 3659

    I have last update and result sould be a simple table with 2 columns (not JSON)

    thanks

  2. myDBR Team, Key Master

    What is the exact myDBR version and the build you are running?

    --
    myDBR Team

  3. mfiorentino, Member

    myDBR 5.1.0 (build 3650)

  4. myDBR Team, Key Master

    Please run the updater and try again (the remote_server / debug_result -option was added in build 3651).

    --
    myDBR Team

  5. mfiorentino, Member

    Call:
    http://mydbrmadrid.tuttogroup.com/report.php?r=sp_DBR_remote_Vendedor&h=4238f990c1af32d737009a37fd034a360ababc88&lang=en_US&export=json&json_force_object=0

    Result:
    string(101) "{"type":"ERROR","title":"There was an error in the report execution","detail":"No access privileges"}"

    thanks

  6. myDBR Team, Key Master

    That would mean that you have not granted access to the remote report (sp_DBR_remote_Vendedo) for the user accessing the report (the user defined in the Remote servers).

    We'll add better error message for this one.

    Btw, when you declare datatypes for columns, there is no advantage of using the "size" number in integer columns. Columns defined as int, int(5) and int(11) are exactly the same column definitions. The "size" number in these integer columns are only used in mysql command line when used with ZEROFILL option.

    --
    myDBR Team

  7. mfiorentino, Member

    Thanks,
    i don't understand how i can give privilege to stored procedure. I executed:
    GRANT EXECUTE ON PROCEDURE myDB.spName TO 'TestUser'@'localhost';
    but don't work.
    if i use sp_DBR_remote_first work good but all stored procedure that i create have same privilege error

    thanks

  8. myDBR Team, Key Master

    The remote server functionality connects to the remote server using the username and the password that you define in the Remote server configuration screen and runs the report in the remote server as normal user. So, you need to give user (the remote one) access to the report as you do with local users.

    Go to report's 'Edit Report'-screen and there you can define who (users/groups) can run the particular report. Add the remote user to the users who can run the report. No need to do anything in the SQL level (no GRANT EXECUTE's).

    After that you can remove the debug-flag.
    --
    myDBR Team

  9. mfiorentino, Member

    hello I did the following test:
    I have a remote call that works perfectly, pointing to sp_DBR_remote_first ... it works .... if I create another stored procedure for example: sp_DBR_remote_second equal to the other gives me access problems ... and so if I create others...
    CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_DBR_remote_first`()
    BEGIN
    select id_users,apellido
    from tpv_dev.users;
    END
    *********************************
    CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_DBR_remote_second`()
    BEGIN
    select id_users,apellido
    from tpv_dev.users;
    END

    the first call work, the second no...error privilege
    both work locally

    thanks

  10. myDBR Team, Key Master

    When you say "both work locally" do you mean they work as myDBR reports or if you call them through mysql command line?

    Have you added the procedures as reports in remote server and have you granted the access to the user used in remote connection through the myDBR 'Edit report' UI?

    --
    myDBR Team

  11. mfiorentino, Member

    The Both: as myDBR reports and if i you call them through mysql command line

    Yes

    sp_DBR_remote_first work from the remote and sp_DBR_remote_second NO. It's same button just change:
    select 'dbr.remote.prepare', 'Server_Madrid', 'remote_data_tmpVendedor', 'sp_DBR_remote_second';
    sp_DBR_remote_second and sp_DBR_remote_first have same code

    CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_DBR_call_remoteVendedor`()
    BEGIN

    drop temporary table if exists remote_data_tmpVendedor;
    create temporary table remote_data_tmpVendedor (
    id_users int,
    apellido varchar(50)
    );
    select 'dbr.remote.prepare', 'Server_Madrid', 'remote_data_tmpVendedor', 'sp_DBR_remote_second';
    select 'dbr.remote.call', 'sp_DBR_show_remoteVendedor';

    thanks

    END

  12. myDBR Team, Key Master

    1. Have you added the procedure as a report in myDBR? Can you run the report as a report by clicking the report from the report list (instead through mysql command line).
    2. Have you added the remote user as user who can run the report in myDBR?


    The process:
    • You first create the stored procedure (with whatever tool you like)
    • You attach the stored procedure as a report in myDBR
    • You select the users and groups who have access to the report via the myDBR UI (not command line and not myDBR Query Browser)


    To test things, you can login to the remote server's myDBR using the username and password you provide in the "Remote servers". You should see the report in question listed in the reports (in whichever folder you have put it).
    --
    myDBR Team

  13. mfiorentino, Member

    yes i do it

    can i send you a video?where?

    thanks

  14. myDBR Team, Key Master

    A support ticket opened for this one for faster problem solving. Please check your email.

    --
    myDBR Team

  15. myDBR Team, Key Master

    You have created the procedure, but you have not added the procedure as a report in remote server and given access rights to your remote server user.

    --
    myDBR Team

  16. mfiorentino, Member

    how can i do it?
    can you write me please the procedure?

    thanks

  17. myDBR Team, Key Master

    Your procedure is fine (assuming you created it in the remote server). After you have created the procedure, you need to attach it as a report to myDBR and give the remote user access rights to it insde myDBR (in remote server).

    Log into myDBR in the remote server and follow the steps described in the documentation.

    --
    myDBR Team

  18. mfiorentino, Member

    thanks


Reply

You must log in to post.