Hi all. I have started this week to learn the Drupal 7. It is very interesting. But I am not getting that how to connect to mysql database and to fetch from it. I searched for many tutorials related, but I found none of them useful. Can anybody help me with this?
7 Replies - 7284 Views - Last Post: 18 February 2011 - 03:57 AM
#1
Drupal: How to connect to mysql database and fetch data in drupal
Posted 11 February 2011 - 05:40 AM
Replies To: Drupal: How to connect to mysql database and fetch data in drupal
#2
Re: Drupal: How to connect to mysql database and fetch data in drupal
Posted 11 February 2011 - 08:39 AM
There should be some type of config file that you must edit to enter the connection details for your database such as Wordpress does and phpbb
im not familiar with drupal but im guessing thats how its done?
im not familiar with drupal but im guessing thats how its done?
#3
Re: Drupal: How to connect to mysql database and fetch data in drupal
Posted 11 February 2011 - 09:49 PM
I want to know the exact file where the connection statements and sql query should written.
#4
Re: Drupal: How to connect to mysql database and fetch data in drupal
Posted 14 February 2011 - 07:31 PM
let me look into it real quick
This post has been edited by Sadin56: 14 February 2011 - 07:32 PM
#5
Re: Drupal: How to connect to mysql database and fetch data in drupal
Posted 14 February 2011 - 08:00 PM
jagadish_c, on 11 February 2011 - 09:49 PM, said:
I want to know the exact file where the connection statements and sql query should written.
The connection and SQL information does not need to be edited manually.
Download your version of Drupal from Drupal.org.
Then extract the downloaded files onto your server or upload them (depending if your hosting locally or online)
And if you goto the directory on your server where drupal was stored for the frist time an installation guide/setup page will appear follow all step in the guide then your site should be up and running
The connection details are entered during the setup via the installer
#6
Re: Drupal: How to connect to mysql database and fetch data in drupal
Posted 14 February 2011 - 08:53 PM
Assuming you're talking about working with SQL within Drupal's framework for a module you're writing yourself, you should give this and this a look to get you started with module development. If you're talking about getting it to connect overall, then Sadin56 is correct. Drupal is designed that to add custom functionality, you would create a module as opposed to altering its base code yourself.
#7
Re: Drupal: How to connect to mysql database and fetch data in drupal
Posted 15 February 2011 - 07:01 AM
Valek, on 14 February 2011 - 08:53 PM, said:
Assuming you're talking about working with SQL within Drupal's framework for a module you're writing yourself, you should give this and this a look to get you started with module development. If you're talking about getting it to connect overall, then Sadin56 is correct. Drupal is designed that to add custom functionality, you would create a module as opposed to altering its base code yourself.
Thank you for posting this i hadnt even considered that
This post has been edited by Sadin56: 15 February 2011 - 07:01 AM
#8
Re: Drupal: How to connect to mysql database and fetch data in drupal
Posted 18 February 2011 - 03:57 AM
Valek, on 14 February 2011 - 08:53 PM, said:
You have assumed right.
Sadin56, on 14 February 2011 - 08:00 PM, said:
jagadish_c, on 11 February 2011 - 09:49 PM, said:
I want to know the exact file where the connection statements and sql query should written.
The connection and SQL information does not need to be edited manually.
Download your version of Drupal from Drupal.org.
Then extract the downloaded files onto your server or upload them (depending if your hosting locally or online)
And if you goto the directory on your server where drupal was stored for the frist time an installation guide/setup page will appear follow all step in the guide then your site should be up and running
The connection details are entered during the setup via the installer
Thanks for your quick reply Sadin.
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote




|