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

Ranganathan
3,2382 gold badges19 silver badges38 bronze badges
asked Oct 29, 2019 at 0:53

1 Answer 1

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.

answered Oct 29, 2019 at 3:33

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.