Kiểm tra xem kết quả truy vấn có trống không php

mysql_query doesnt support multiple queries, a way round this is to use innodb and transactions

this db class/function will accept an array of arrays of querys, it will auto check every line for affected rows in db, if one is 0 it will rollback and return false, else it will commit and return true, the call to the function is simple and is easy to read etc
----------

class MySQLDB
{
   private $connection;          // The MySQL database connection

   /* Class constructor */
   function MySQLDB[]{
      /* Make connection to database */
      $this->connection = mysql_connect[DB_SERVER, DB_USER, DB_PASS] or die[mysql_error[]];
      mysql_select_db[DB_NAME, $this->connection] or die[mysql_error[]];
   }

   /* Transactions functions */

   function begin[]{
      $null = mysql_query["START TRANSACTION", $this->connection];
      return mysql_query["BEGIN", $this->connection];
   }

   function commit[]{
      return mysql_query["COMMIT", $this->connection];
   }

   function rollback[]{
      return mysql_query["ROLLBACK", $this->connection];
   }

________số 8

      $this->begin[];

this db class/function will accept an array of arrays of querys, it will auto check every line for affected rows in db, if one is 0 it will rollback and return false, else it will commit and return true, the call to the function is simple and is easy to read etc
----------
0

this db class/function will accept an array of arrays of querys, it will auto check every line for affected rows in db, if one is 0 it will rollback and return false, else it will commit and return true, the call to the function is simple and is easy to read etc
----------
1

this db class/function will accept an array of arrays of querys, it will auto check every line for affected rows in db, if one is 0 it will rollback and return false, else it will commit and return true, the call to the function is simple and is easy to read etc
----------
2

this db class/function will accept an array of arrays of querys, it will auto check every line for affected rows in db, if one is 0 it will rollback and return false, else it will commit and return true, the call to the function is simple and is easy to read etc
----------
3

this db class/function will accept an array of arrays of querys, it will auto check every line for affected rows in db, if one is 0 it will rollback and return false, else it will commit and return true, the call to the function is simple and is easy to read etc
----------
4

this db class/function will accept an array of arrays of querys, it will auto check every line for affected rows in db, if one is 0 it will rollback and return false, else it will commit and return true, the call to the function is simple and is easy to read etc
----------
5

this db class/function will accept an array of arrays of querys, it will auto check every line for affected rows in db, if one is 0 it will rollback and return false, else it will commit and return true, the call to the function is simple and is easy to read etc
----------
6

this db class/function will accept an array of arrays of querys, it will auto check every line for affected rows in db, if one is 0 it will rollback and return false, else it will commit and return true, the call to the function is simple and is easy to read etc
----------
7

this db class/function will accept an array of arrays of querys, it will auto check every line for affected rows in db, if one is 0 it will rollback and return false, else it will commit and return true, the call to the function is simple and is easy to read etc
----------
8

this db class/function will accept an array of arrays of querys, it will auto check every line for affected rows in db, if one is 0 it will rollback and return false, else it will commit and return true, the call to the function is simple and is easy to read etc
----------
9

class MySQLDB
{
   private $connection;          // The MySQL database connection
0

class MySQLDB
{
   private $connection;          // The MySQL database connection
1

class MySQLDB
{
   private $connection;          // The MySQL database connection
2

class MySQLDB
{
   private $connection;          // The MySQL database connection
3

class MySQLDB
{
   private $connection;          // The MySQL database connection
4

Chủ Đề