I need an app based (session independent) counter that gives me the order of the queries that are done to server. Does PDO (or MySQL) has an internal counter for that? If it does not have how a can I get the order of the queries without writing to db or using the file system.
What I do right now is
construct my PDO object :
$dbpdo = new PDO("mysql:host=$db_host;dbname=$db_name", $db_username, $db_password, array(PDO::ATTR_PERSISTENT => true)); $dbpdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $dbpdo->setAttribute(PDO::ATTR_TIMEOUT, 30); $dbpdo->query("SET NAMES utf8");
Do the query:
$q = $dbpdo->prepare($sql); $q-> execute($arr);
I need the order number of the query (app based).