function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ram2forceram2force 

How to access database from my sites.

How to access database from my sites.

 

Actually I want to create a database in cloud platform. Then store some values.

 

Then get the values from my sites whenever i need.....is it possible.....

 

If possible how to do this....Please give step by step procedures and details..............for that can which language i want to use to access database from site.....can i use PHP......

 

Plz Help me.....

Best Answer chosen by Admin (Salesforce Developers) 
bob_buzzardbob_buzzard

There's no reason that you can't do this using Force.com sites.  You could either use standard objects such as account (though you'd want to user person accounts I'd suggest) or custom objects.  

 

Objects such as accounts are stored in the salesforce database - you can access them through SOQL queries in Apex code.  You can make these objects available via Sites using Visualforce pages and Apex controllers. 

All Answers

paul-lmipaul-lmi

Apex doesn't have IP-level connectivity options, so, as long as your cloud DB supports web services/API interaction, you'd be doing it via that approach.  No, you cannot use PHP in Force.com Sites.  If you want PHP, you'd need to roll your own server(s).

ram2forceram2force

Thank you....As I am newbie to programming....could  You explain Ellaborately.....

 

I will not use Any other domain or third party database.....My question is how to create Database in cloud itself....and how to use that database in my sites....

 

Actually My need is , user enters to my site...and see a person details by click on his name....How to do this....Shall i want database for this...or can i use Accounts object  in the site itself......How to do this....Plz help..........

 

I am eagerly waiting for your reply...........

bob_buzzardbob_buzzard

There's no reason that you can't do this using Force.com sites.  You could either use standard objects such as account (though you'd want to user person accounts I'd suggest) or custom objects.  

 

Objects such as accounts are stored in the salesforce database - you can access them through SOQL queries in Apex code.  You can make these objects available via Sites using Visualforce pages and Apex controllers. 

This was selected as the best answer
new2forcenew2force

the main thing not to forget while using SFDC is no database  configuration. what u save wil directly go to cloud database with our SFDC account.

 

  in site VF pages, use SOQL queries and bring data.

for example, when a user login into the account

 

you have to capture his/her User Id and bring either Contact Id or Account ID.

 

Using that Id, query ur data using SOQL query  like

 

Account acc=[select name,phone,address from Account where Id = : accountId];

 

populate that data in the VF page boxes by assigning the values u retieved to the page boxes