Hi there,
I am trying to fetch some results from the drupal database with this code in a panel, using the "new custom code" option within pages.
$result = mysql_query("SELECT renner,groen FROM `custom_content_type_alg_klassement` GROUP BY renner ORDER BY groen DESC LIMIT 3");
| Renner | Sprint Pnt |
|---|---|
print $row[0] |
print $row[1] |
mysql_close();
In the preview pane, I dont' receive any errors. But accessing the page, after adding an URL alias, I get tons of error lines saying:
warning: mysql_get_server_info() [function.mysql-get-server-info]: Access denied for user 'apache'@'localhost' (using password: NO) in /home/twce/domains/twce.nl/public_html/includes/database.mysql.inc on line 44.
What's the correct way to connect to the drupal database?
thanks!
Comments
Comment #1
merlinofchaos commentedDocumentation is a blessed thing:
http://api.drupal.org/api/group/database/6