Jump to content

Help with creating provisioning module


Ehsanmot

Recommended Posts

Hi

I'm creating a new provisioning module that can edit an external database just after a payment of a client received.

For example when a client purchased a service, this module create a row with the username, password and email of the client in an external database.

i know how to connect to an external database but i don't know how to do other things...

please help me and sorry for my bad english.

this is my code for this module:

 

<?php
$servername11 = "localhost";
$username11 = "databaseusername";
$password11 = "databasepass";
$dbname11 = "databasename";

// Create connection
$conn = new mysqli($servername11, $username11, $password11, $dbname11);
// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);

$sql = "INSERT INTO nn_users (username, email, password)
VALUES ('????', '????', '????')";


if ($conn->query($sql) === TRUE) {
    echo "Record updated successfully";
} else {
    echo "Error updating record: " . $conn->error;
}

$conn->close();
?>

Link to comment
Share on other sites

  • 2 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated