Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

DataObjectManager Module

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

mysql query of other database in a normal page


Reply

383 Views

Avatar
flei1982

6 October 2011 at 2:16am Community Member, 1 Post

hi.

i want display some results of an external database (mysql) in a silverstripe standard page

is there any idea how i can insert this php code ... (it is just an example)

<?php

$link = mysql_connect("localhost", "mysql_user", "mysql_password");
mysql_select_db("database", $link);

$result = mysql_query("SELECT * FROM table1", $link);
$num_rows = mysql_num_rows($result);

echo "$num_rows Rows\n";

?>

thx brgs rene