Skip to Main Content

NoSQL Database

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Connect to NoSQL from PHP

Jassim RahmaJun 25 2017 — edited Jun 26 2017

Hi,

Is it possible to connect to Oracle NoSQL from PHP?

this is what I am currently using for MySQL so how can I use it for Oracle NoSQL..

<?php

  header("Content-Type: application/json");

  if (isset($_SERVER['HTTP_ORIGIN'])) {

    header("Access-Control-Allow-Origin: {$_SERVER['HTTP_ORIGIN']}");

    header('Access-Control-Allow-Credentials: true');

    header('Access-Control-Max-Age: 86400');    // cache for 1 day

  }

  $customer_id = $_GET["customer_id"];

  $mysql_host = "mysql:host=mysql.mydomain.com;dbname=my_db";

  $mysql_user = "my_user";

  $mysql_password = "my_password";

  $mysql_options = array

  (

  PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',

  );

  // $mysql_connection;

  $mysql_connection = new PDO($mysql_host, $mysql_user, $mysql_password, $mysql_options);

  $mysql_connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

  $mysql_query = $mysql_connection->prepare('CALL sp_populate_customer_addresses(:param_customer)');

  $mysql_query->bindParam(':param_customer', $customer_id, PDO::PARAM_STR);

  $mysql_query->execute();

?>

Thanks,

Jassim

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 24 2017
Added on Jun 25 2017
1 comment
1,118 views