I'm a newbiee to Drupal and I just installed one on our server. I was wondering if there was any way to achieve the following via drupal?
We have a mysql database storing a bunch of scientific data and I have a cron script querying the database and making html tables of key data. Is there a way how this content (the resulting html pages) can be integrated and managed via drupal? Especially the link structure etc.?
On Thu, Jul 23, 2009 at 12:45 AM, Rahul Nabar rpnabar@gmail.com wrote:
We have a mysql database storing a bunch of scientific data and I have a cron script querying the database and making html tables of key data. Is there a way how this content (the resulting html pages) can be integrated and managed via drupal? Especially the link structure etc.?
It is very difficult to answer with this minimal information.
On Wed, Jul 22, 2009 at 2:21 PM, sivaji j.gsivaji2009@gmail.com wrote:
On Thu, Jul 23, 2009 at 12:45 AM, Rahul Nabar rpnabar@gmail.com wrote:
We have a mysql database storing a bunch of scientific data and I have a cron script querying the database and making html tables of key data. Is there a way how this content (the resulting html pages) can be integrated and managed via drupal? Especially the link structure etc.?
It is very difficult to answer with this minimal information.
Sorry if I was terse. I'll try to do better:
I have data in a mysql database. In order to present this I (or rather a cron script) usually run on the command line something like:
echo 'SELECT * FROM footable' | mysql -h foo.bar.edu -u foouser -p --html bar_db > temp.html
Then a webpage.php file adds some more headers, css styling etc. and presents this page. Something like:
http://files.getdropbox.com/u/118481/mqsql_html.jpg
Unfortunately there are several such "autogenerated" pages and it is hard to keep track of up-to-date menus, links etc. I was wondering if this was facilitated by Drupal. Maybe even if Drupal was the right tool for this job at all.
On Thu, Jul 23, 2009 at 1:41 AM, Rahul Nabar rpnabar@gmail.com wrote:
Unfortunately there are several such "autogenerated" pages and it is hard to keep track of up-to-date menus, links etc. I was wondering if this was facilitated by Drupal. Maybe even if Drupal was the right tool for this job at all.
I would use a simple PHP framework like CodeIgniter for this purpose.
Drupal is often used to build kind of websites listed in this link http://webjackalope.com/16-different-clones-you-can-build-with-drupal/
Again i would say that it is very difficult to suggest something without understanding the complete requirements. Hope this will help you.
Rahul,
I've done something similar quite a few times using Drupal. The guts of my code are:
function scoreboard_menu() {
$items = array();
$items['scoreboard'] = array(
'title' => t('My Scoreboard'),
'description' => t('Scoreboard'),
'page callback' => 'scoreboard_main_page',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
);
return $items;
}
function scoreboard_main_page() {
$output = ''; $table = array(); $header = array( ); $date = date('Y-m-d');
db_set_active('customdb'); $results = db_query('SELECT * FROM WHERE filter LIKE "%s%%" GROUP BY groupfield ORDER BY orderfield DESC', $date); db_set_active();
while ($line = db_fetch_object($results)) { $table[] = $line; }
$output .= theme('table', $header, $table, array('class' => 'scoreboard-table')); return $output; }
Just make sure you have your database settings in your settings.php. Seems to work for me for simple tasks
On Wed, Jul 22, 2009 at 1:11 PM, Rahul Nabarrpnabar@gmail.com wrote:
On Wed, Jul 22, 2009 at 2:21 PM, sivaji j.gsivaji2009@gmail.com wrote:
On Thu, Jul 23, 2009 at 12:45 AM, Rahul Nabar rpnabar@gmail.com wrote:
We have a mysql database storing a bunch of scientific data and I have a cron script querying the database and making html tables of key data. Is there a way how this content (the resulting html pages) can be integrated and managed via drupal? Especially the link structure etc.?
It is very difficult to answer with this minimal information.
Sorry if I was terse. I'll try to do better:
I have data in a mysql database. In order to present this I (or rather a cron script) usually run on the command line something like:
echo 'SELECT * FROM footable' | mysql -h foo.bar.edu -u foouser -p --html bar_db > temp.html
Then a webpage.php file adds some more headers, css styling etc. and presents this page. Something like:
http://files.getdropbox.com/u/118481/mqsql_html.jpg
Unfortunately there are several such "autogenerated" pages and it is hard to keep track of up-to-date menus, links etc. I was wondering if this was facilitated by Drupal. Maybe even if Drupal was the right tool for this job at all.
-- Rahul -- [ Drupal support list | http://lists.drupal.org/ ]
On Tue, Jul 28, 2009 at 12:31 AM, Craig Gardnercraig.s.gardner@gmail.com wrote:
Rahul,
I've done something similar quite a few times using Drupal. The guts of my code are:
function scoreboard_menu() {
Thanks Craig! I am going to give that a shot!