0

example myconnect.php

<?php
$servername = "localhost";
$username = "";
$password = "";
try {
    $conn = new PDO("mysql:host=$servername;dbname=meigee", $username, $password);
    //set the PDO error mode to exception
    $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    echo "Connected successfully";
} catch(PDOException $e) {
    echo "Connection failed: " . $e->getMessage();
}
echo "<br>";
echo "PHP on Magento";
?>

how to upload file mycon.php? Magento1.9.4.3

0

I would suggest that you create a shell script in order to leverage the "Magento way" of coding

You may follow this tutorial

https://inchoo.net/magento/php-shell-scripts-for-magento/

Using shell scripts you would be able to use Magento classes inside of your custom shell PHP script.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.