We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21970
    • 12 Posts
    Hi all,

    I just upgraded our development site to MODx 1.0.4 with AjaxSearch 1.9.0.

    How can I prevent AjaxSearch to fail on a pages with a second DB connection? On those pages we’re receiving the following error.

    « MODx Parse Error »
    MODx encountered the following error while attempting to parse the requested resource:
    « PHP Parse Error »
     
    PHP error debug
      Error: 	mysql_get_server_info() [function.mysql-get-server-info]: Access denied for user 'nobody'@'localhost' (using password: NO)	 
      Error type/ Nr.: 	Warning - 2	 
      File: 	/is/htdocs/wpXXXXX/www/development/assets/snippets/ajaxSearch/classes/ajaxSearchUtil.class.inc.php	 
      Line: 	41	 
      Line 41 source: 	$header = "AjaxSearch " . $version . " - Php" . phpversion() . " - MySql " . mysql_get_server_info(); 	 
     
    Parser timing
      MySQL: 	0,0075 s	(60 Requests)
      PHP: 	0,5546 s	 
      Total: 	0,5622 s
    



    In the default template we’re using:
    [!AjaxSearch? &ajaxSearch=`0` &landingPage=`5` &language=`german`!]
    


    and the landing Page:
    [!AjaxSearch? &ajaxSearch=`0` &showInputForm=`0` &extract=`1` &order=`pagetitle DESC` &rank=`` &parents=`11,21,25,29,33` &depth=`2` &language=`german`!]
    


    With MODx 1.0.0 and AjaxSearch 1.8.5 it worked like charm.
      • 5811
      • 1,717 Posts

      How can I prevent AjaxSearch to fail on a pages with a second DB connection?

      By creating a user with the appropriate user rights to be able to do a mysql_server_info request.

      You got
      PHP error debug
      Error: mysql_get_server_info() [function.mysql-get-server-info]: Access denied for user ’nobody’@’localhost’ (using password: NO)
      Error type/ Nr.: Warning - 2
      File: /is/htdocs/wpXXXXX/www/development/assets/snippets/ajaxSearch/classes/ajaxSearchUtil.class.inc.php
      Line: 41
      Line 41 source: $header = "AjaxSearch " . $version . " - Php" . phpversion() . " - MySql " . mysql_get_server_info();
      It appears the application is trying to login without a password, "... Access denied for user ’nobody’@’localhost’ (using password: NO)
      Create a user with a password and this isssue should be fixed.
        • 21970
        • 12 Posts
        Thanks for your support,

        we’re using a snippet and included
        $mydb= new DBAPI();
        $mydb->connect($host='localhost',$dbase='mydbname', $uid='mydbuser',$pwd='mydbpwd');
        

        like Jason shared the example in the topic
        http://modxcms.com/forums/index.php/topic,1618.msg10957.html#msg10957

        So the username and the password are already provided for the non-MODx DB and as I said, this was working in previous versions of AjaxSearch.

        It appears I have to get deeper in touch with the MODx DBAPI.

        Thank you
        Olaf