<?
//First Create A Database Named be_perfect and Run the SQL String in DatabaseClsConnection.txt File.
include "ClsConnection.cls.php";
//For Automatic Connection According to Class Variables.
$ObjConnection=new ClsConnection();
//For User Defined Connection
$HostName="mycompany.com";
$UserName="aminul";
$Password="aminulsumon@yahoo.com";
$DatabaseName="be_perfect";
$ObjConnection->UserDefineConnection($HostName,$UserName,$Password,$DatabaseName);
//Check "Student" Table Existance (Return True if Exists otherwise False).
$DatabaseTableName="Student";
$ObjConnection->DataBaseTableExists($DatabaseTableName);
//Build Select Query
$TableName="Student";
$Condition="StMarks>40";
$OrderByCol="StId";
$SelQuery=$ObjConnection->BuildSelectQuery($TableName,$Condition="",$OrderByCol="");
echo $SelQuery;
//Build Update Query
$DatabaseTableName="Student";
$UpdateFieldsAndValues=array("StRoll"=>"33",
"StMarks"=>"59");
$UpdateCondition="StId=3";
$UpdateQuery=$ObjConnection->BuildUpdateQuery($DatabaseTableName,$UpdateFieldsAndValues,$UpdateCondition);
echo $UpdateQuery;
//Build Delete Query
$TableName="Student";
$Condition="StId=2";
$DeleteQuery=$ObjConnection->BuildDeleteQuery($TableName,$Condition="")
echo $DeleteQuery;
//Delete A Single File
$ImageName="aminul.jpg";
$FolderLocation="all_image";
$SuccessMessage="File Successfully Deleted.";
$FailureMessage="Image Can't Deleted.";
$DelFile=$ObjConnection->DeleteFile($ImageName,$FolderLocation,$SuccessMessage,$FailureMessage);
echo $DelFile;
//Delete All Files within Folder: all_image
$ImageName="";
$FolderLocation="all_image";
$SuccessMessage="File Successfully Deleted.";
$FailureMessage="Image Can't Deleted.";
$DelFile=$ObjConnection->DeleteFile($ImageName,$FolderLocation,$SuccessMessage,$FailureMessage);
echo $DelFile;
?>
|