Mysql_query w3schools

Câu lệnh MySQL sau đây sẽ trả về các “cate_id” duy nhất, dưới dạng danh sách các chuỗi được phân tách bằng dấu phân cách được chỉ định '' [dấu cách] theo thứ tự tăng dần cho mỗi nhóm 'pub_id' từ bảng book_mast. Có thể thay đổi thứ tự giảm dần, sử dụng tùy chọn 'DESC' thay vì 'ASC' ở cuối câu lệnh chọn

Tôi đang cố viết if trong truy vấn mysql. Dựa trên. http. // nhà phát triển. mysql. com/doc/refman/5. 0/. bản tường trình. htmlTôi đã nghĩ ra điều này, nhưng không có niềm vui

mysql_query["UPDATE skew_trkg_slave IF observations_needed = observations_completed THEN SET minor_cycle_completed = '1';WHERE " . $skew_trkg_slave_where . ""] or die[mysql_error[]];

Tôi gần đến mức nào?

Được chỉnh sửa vào ngày 24 tháng 12 năm 2011 bởi niche

Liên kết để bình luậnChia sẻ trên các trang web khác

Nhiều tùy chọn chia sẻ hơn

chỉ là một vài anh chàng

Đăng ngày 23 tháng 12 năm 2011

chỉ là một vài anh chàng

  • người điều hành
    • 31. 6k
  • Vị trí. Phượng hoàng
  • Ngôn ngữ. Tập trung vào PHP và JavaScript

    • Chia sẻ

Đăng ngày 23 tháng 12 năm 2011

Tham chiếu bạn đã liên kết đến là dành cho các hàm, không phải truy vấn SQL. Đây là cho các truy vấn. http. // nhà phát triển. mysql. com/doc/refman/5. 0/vi/chức năng luồng điều khiển. html#function_if Câu lệnh if trả về một giá trị, vì vậy giá trị đó sẽ là giá trị để trường cập nhật. e. g. CẬP NHẬT bảng SET trường = IF[. ] Ở ĐÂU

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];
   }

________số 8

   function transaction[$q_array]{
         $retval = 1;

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

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

mysql_query là gì?

mysql_query[] gửi truy vấn đến cơ sở dữ liệu hiện đang hoạt động trên máy chủ được liên kết với mã định danh liên kết đã chỉ định . Nếu link_identifier không được chỉ định, liên kết được mở lần cuối sẽ được giả định. Nếu không có liên kết nào được mở, hàm sẽ cố gắng thiết lập một liên kết như thể mysql_connect[] được gọi mà không có đối số và sử dụng liên kết đó.

Tại sao chúng tôi sử dụng mysql_query trong PHP?

mysql_query[] gửi một truy vấn duy nhất [không hỗ trợ nhiều truy vấn] tới cơ sở dữ liệu hiện đang hoạt động trên máy chủ được liên kết với mã nhận dạng liên kết đã chỉ định .

mysqli_query[] là gì?

Hàm mysqli_query[] chấp nhận một giá trị chuỗi đại diện cho truy vấn dưới dạng một trong các tham số và thực thi/thực hiện truy vấn đã cho trên cơ sở dữ liệu

Làm cách nào để lấy dữ liệu từ mysqli_query?

Tìm nạp dữ liệu bằng PHP Script . Hàm này nhận hai tham số và trả về TRUE nếu thành công hoặc FALSE nếu thất bại. PHP uses mysqli query[] or mysql_query[] function to select records from a MySQL table. This function takes two parameters and returns TRUE on success or FALSE on failure.

Chủ Đề