This is a PHP application to access the MySqlDataBase having inbuilt safety check for sql injection and cache management
CLASS TO ACCESS THE DATABASE.THE STEPS OF USING THIS CLASS IS DESCRIBED BELOW
1>DEFINE THE DATABASE DETAILS IN THE DATABASE.PHP FILE,WHICH BASICALLY CONTAINS SOME CONSTANTS VALUS LIKE DATABASE NAME,ADDRESS,DATABASE USER NAME AND PASSWORD
2>INCLUDE THE MYSQLIMPULSE FOLDER IN YOUR PROJECT WHERE YOU NEED TO ACCESS THE DATABASE
3>CREATE AN INSTANCE OF THE CLASS MYSQLIMPULSE AS FOLLOWS $_MYSQLIMPULSE=new MySqlImpulse();
4>EXAMPLE OF INSERT QUERY $QUERY="INSERT INTO TBL VALUES('?',?,'?')"; $DATAARRAY=ARRAY('AAA',10,'BB'); $RESULT=$_MYSQLIMPULSE->executeQuery($QUERY,$DATAARRY); RESULT IS A BOOLEAN RESULT, THE DATA WILL BE AUTOMETICALLY CHECKED FOR SQL INJECTION ALL DATA THAT CONTAINS HTML TAGS WILL BE REMOVED,TO PREVENT THIS USE executeDirectQuery($QUERY,$DATAARRAY) INSTEAD OF executeQuery($QUERY,$DATAARRAY)
5>EXAMPLE OF SELECT QUERY $QUERY="SELECT FROM TBL WHERE ID='?'"; $DATAARRAY=array("XX"); $RESULT=$_MYSQLIMPULSE->executeQuery($QUERY,$DATAARRY); THE OUT PUT WILL BE A MULTI DIMENTIONAL ARRAY AS FOLLOWS $RESULT[0] WILL BE THE FIRST ROW FETCHED FROM THE DATABASE $RESULT[1] WILL BE THE SECOND ROW FETCHED FROM THE DATABASE
YOU CAN USE THE COUNT FUNCTION OF ARRAY IN PHP TO GET THE NUMBER OF ROWS IN THE OUTPUT RESULT
SPECIAL FEATURES OF THIS CLASS 1>YOU DO NOT NEED TO TAKE HEADECH OF SQL INJECTION,THERE ARE INBUILT FUNCTION IN THE CLASS TO PREVENT SQL INJECTION 2>YOU DONOT NEED TO CREATE OR DESTROY DATABASE CONNECTION,THIS CLASS WILL AUTOMETICALLY CREATE CONNECTION AND DESTRY THEM AS SOON AS REQURMENT FINISHED