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
1 Answer 1
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
default