• Mongo Database to WordPress MySQL database script

    ShikhaTan Member

    Hi I got a script which rely on mongo database to retrieve user info, but I want to connect it to my wordpress database which is MySQL can someone help me change the connection from mongo to mysql please

    selectDB($db);
    $collection = $db->mxitusers;
    $visitor = $_SERVER['HTTP_X_MXIT_USERID_R'];
    if ($visitor == '') {
     $visitor = "Web user";
    }
    $document = array("mxitid" => $visitor);
    $collection->insert($document);
    /* Instantiate the Mxit API */
    $key = 'f00ff00fabcdabcdabcdg00f';
    $secret = 'deadfoofabcd12abcdgoof';
    $api = new MxitAPI($key, $secret);
    /* Set up the message */ $message = "Thanks for visiting!";
    $contains_markup = 'false';
    $app = "testappmxt";
    $access_token = NULL;
    while (is_null($access_token))
         { /* We are sending a message so request access to the message/send scope */ $api->get_app_token('message/send');
    $token = $api->get_token();
    $access_token = $token['access_token']; // Only attempt to send a message if we have a valid auth token
    if (!is_null($access_token))
      {
        $api->send_message($app, $visitor, $message, $contains_markup);
      }
    }
    
Viewing 0 reply threads
  • You must be logged in to reply to this topic.
en_USEnglish