Это мой основной код PHP, который используется в Magento.
$model_moodle = mysql_connect("localhost","root","123456")
or die("Unable to connect to MySQL");
//select a database to work with
$selected = mysql_select_db("moodle",$model_moodle)
or die("Could not select moodle");
//execute the SQL query and return records
$result = mysql_query("SELECT id FROM mdl_course where shortname ='".$data."'");
//fetch tha data from the database
while ($row = mysql_fetch_array($result)) {
$course_id = $row['id'];//display the results
}
//echo "Cource id is=".$course_id;
//close the connection
mysql_close($model_moodle);
Мне нужно использовать этот код, но с использованием подключения к внешней базе данных Magento.
Я использую базу данных Moodle в Magento. но мне нужен код для Magento.