is this your attempt to connect to the original database (the source of data) or to the SuiteCRM database (the destination)?
If it’s the source, do you have a lot of complex data with relationships etc, or could you be better off just exporting a table to CSV and then importing?
I already have imported my csv files into my suitcrm database. Now I want to parse the data from the salesforce tables to the respective suitcrm db tables to see them with the relationships in the UI.
There is a lot of data to export from the database to suitcrm.
Here is an example of direct SQL access, in its simplest form:
if (!defined('sugarEntry') || !sugarEntry) die ('Not a Valid Entry Point!');
global $db;
$query = "SELECT lead_source, sales_stage as stage, amount as total, user_name as user
FROM opportunities
LEFT JOIN users ON users.id = opportunities.assigned_user_id
WHERE opportunities.deleted=0
";
$result=$db->query($query,true);
while( $row = $db->fetchByAssoc($result)) {
echo $row['stage'], ": ", $row['total'], '<br/>';
}
Please try to grab simple data from your input tables with this code, and see if it works.