Query, execute, fetch... all queries?

  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8397
  • Loc: USA

Post 3+ Months Ago

In my SQL database access wrapper, I'm making a count of all SQL queries ran. What I have a problem with is counting correctly all the queries...

Right now I count query(), execute and fetch as a query (although I'm not sure I need to).

Reason I'm not sure if I need to count fetch() as a query is because I have it like this.
PHP Code: [ Select ]
$sql = "SELECT `user_id` FROM `cms_users` WHERE `user_name` = 'UserName'";
 
$stmt = $mysqli->stmt_init();
 
$result = $mysqli->query($sql);
 
// code for retrieving
 
$row = $result->fetch();
  1. $sql = "SELECT `user_id` FROM `cms_users` WHERE `user_name` = 'UserName'";
  2.  
  3. $stmt = $mysqli->stmt_init();
  4.  
  5. $result = $mysqli->query($sql);
  6.  
  7. // code for retrieving
  8.  
  9. $row = $result->fetch();

(Code most likely won't work as is)

All these functions to retrieve data using one query. So, I'm guessing only the query() is query? Or is fetch too? What about bind_params?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 92 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.