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


402 Views

Avatar
flei1982

Community Member, 1 Post

6 October 2011 at 2:16am

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