I've got another problem. With fDatabase, I can connect to the table "patient" just fine. fORM tells me the table "patient" doesn't exist. I've tried "dbo.Patient" in fORM with the same result. I note in the error message that fORM seems to be able to figure out that PatientID is the name of the primary key.
This is the output
AbelBethCharlieDanielElizabethFionaGeorgeHarryIgnatiusJacobKarenLeslieMarionNickOscarPeterQureshiRomeoSallyTerenceUlyssesVictorWilliamXavierYosemiteZaharaAliceBeatriceCallyDowhop Fatal error: Uncaught exception 'fProgrammerException' with message 'The table specified, patient, does not exist in the database' in E:\\Websites\\INFOSYS280\\flourish\\fSchema.php:2329
Stack trace:
#0 E:\\Websites\\INFOSYS280\\flourish\\fORMDatabase.php(1144): fSchema->getColumnInfo('patient', 'PatientID', 'placeholder')
#1 E:\\Websites\\INFOSYS280\\flourish\\fORMDatabase.php(482): fORMDatabase::makeCondition(Object(fSchema), 'Patient', 'PatientID', '=', 'p01')
#2 E:\\Websites\\INFOSYS280\\flourish\\fActiveRecord.php(1869): fORMDatabase::addPrimaryKeyWhereParams(Object(fSchema), Array, 'Patient', 'Patient', Array, Array)
#3 E:\\Websites\\INFOSYS280\\flourish\\fActiveRecord.php(1168): fActiveRecord->load()
#4 E:\\Websites\\INFOSYS280\\LabWork\\aehchua\\testflourish.php(26): fActiveRecord->__construct('p01')
#5 {main} thrown in E:\\Websites\\INFOSYS280\\flourish\\fSchema.php on line 2329
This is the code
<?php
ini_set("error_reporting",E_ALL);
ini_set("display_errors",1);
include_once $_SERVER['DOCUMENT_ROOT'] . "/flourish/toinclude.php";
class Patient extends fActiveRecord
{
protected function configure()
{
}
}
$connstr="ISOMTEACHING5\\INFOSYS280";
$conninfo=array("Database"=>"hospitalSQL");
$testdb=new fDatabase("mssql", "hospitalSQL","mytest","",$connstr,61495);
$result=$testdb->query("Select PatientName from Patient");
foreach ($result as $row)
echo $row["PatientName"];
//echo "It is working";
fORMDatabase::attach(new fDatabase("mssql", "hospitalSQL","mytest","",$connstr,61495));
fORM::mapClassToTable("Patient","Patient");
$mypatient = new Patient("p01");
echo $mypatient->PatientName;
?>}}}