Functions in DataBridge
List of All Functions supported by DataBridge Framework
| Function | Usage | How to use? |
|---|---|---|
DataBridge(); |
Initialize DataBridge | $db = new DataBridge(table_name, err_mode);// err_mode is optional and is set to 0 by default. |
addConditions(); |
Used to add Condition in the SQL Statement | $db->addCondition("name=YOUR_NAME"); |
addANDCondition(); |
Used to add Single "AND" Condition in the Statement | $db->addANDCondition("email=YOUR_EMAIL"); |
addORCondition(); |
Used to add Single "OR" Condition in the Statement | $db->addORCondition("email=YOUR_EMAIL"); |
getConditions(); |
Used to Display Current Conditions | print_r($db->getConditions); |
gettheColumns(); |
Used to define which columns to fetch | $db->gettheColumns("id,name,email"); |
addRowData(); |
Used to Insert Data into Column | $db->addRowData("email", "me@example.com"); |
updateRowData(); |
Used to mention which data to update | $db->updateRowData("column", "new_data"); |
orderBy(); |
To order the results |
|
setLimit(); |
To set the limit of results | $db->setLimit(5); // returns only 5 results |
insertRow(); |
To execute insert operation in the Database | $db->insertRow(); // inserts data into database |
getAllRows(); |
To fetch all rows matching the condition | $db->getAllRows(); // Not recommended |
getNextRow(); |
To fetch next row or one row at a time Returns array of columns |
$db->getNextRow(); // use in loop to fetch rows one by one |
getRowCount(); |
Get the count of total rows matching the conditions | $db->getRowCount(); |
getUniqueCountRow(); |
Get unique count of rows in a column Useful when column has duplicates |
$db->getUniqueCountRow("name");// Will return number of unique names |
updateRow(); |
Trigger function to execute the updates | $db->updateRow(); |