Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,038

HOME > MySQL สอนเขียน Stored Procedure, View Table, Function, Trigger บน MySQL Database > ตอนที่ 19 : PHP เรียกใช้ Call MySQL Stored Procedure และการส่งค่า Parameters ด้วย mysqli


ตอนที่ 19 : PHP เรียกใช้ Call MySQL Stored Procedure และการส่งค่า Parameters ด้วย mysqli

ตอนที่ 19 : PHP เรียกใช้ Call MySQL Stored Procedure และการส่งค่า Parameters ด้วย mysqli ในหัวข้อนี้เราจะมาเรียนรู้วิธีการเรียกใช้งาน Stored Procedure ของ MySQL Database ด้วย PHP ซึ่งในการเรียกใช้งาน Stored Procedure จะต้องใช้ function ของ mysqli หรือในฟังก์ชั่นรุ่นใหม่ ๆ เช่น PDO ส่วนการเรียกนั้น เราสามารถใช้คำสั่ง CALL procedure_name() ได้ทันที ถ้าหากมีค่า Parameters ก็จะต้องทำการ Pass ค่าไปกับ Query ด้วย หลังจากนั้นก็สามารถใช้คำสั่ง mysqli_query() ข้อมูลได้เลย พร้อมกับอ่านค่า Result ที่ Stored Procedure นั้นได้ส่งกลับมาให้

Call MySQL Stored Procedure
1.CALL procedure_name(agr1,agr2,...)

โครงสร้างของตาราง customer

Table : customer

Stored Procedure บน MySQL


Example 1 : การใช้ PHP เรียก Stored Procedure แบบ Query ข้อมูลออกมา

Stored Procedure Name : getCustomer()
1.DROP PROCEDURE IF EXISTS getCustomer;
2. 
3.DELIMITER //
4.CREATE PROCEDURE getCustomer(IN pCountryCode VARCHAR(2))
5.BEGIN
6.   SELECT * FROM customer WHERE COUNTRY_CODE = pCountryCode;
7.END //
8.DELIMITER ;

Code 1 : การเรียกผ่าน CALL
01.<html>
02.<head>
03.<title>ThaiCreate.Com PHP & MySQL (mysqli)</title>
04.</head>
05.<body>
06.<?php
07.    ini_set('display_errors', 1);
08.    error_reporting(~0);
09. 
10.    $serverName = "localhost";
11.    $userName = "root";
12.    $userPassword = "root";
13.    $dbName = "mydatabase";
14. 
15.    $conn = mysqli_connect($serverName,$userName,$userPassword,$dbName);
16. 
17.    $sql = "CALL getCustomer('US')";
18. 
19.    $query = mysqli_query($conn,$sql);
20. 
21.?>
22.<table width="600" border="1">
23.  <tr>
24.    <th width="91"> <div align="center">CustomerID </div></th>
25.    <th width="98"> <div align="center">Name </div></th>
26.    <th width="198"> <div align="center">Email </div></th>
27.    <th width="97"> <div align="center">CountryCode </div></th>
28.    <th width="59"> <div align="center">Budget </div></th>
29.    <th width="71"> <div align="center">Used </div></th>
30.  </tr>
31.<?php
32.while($result=mysqli_fetch_array($query,MYSQLI_ASSOC))
33.{
34.?>
35.  <tr>
36.    <td><div align="center"><?php echo $result["CUSTOMER_ID"];?></div></td>
37.    <td><?php echo $result["NAME"];?></td>
38.    <td><?php echo $result["EMAIL"];?></td>
39.    <td><div align="center"><?php echo $result["COUNTRY_CODE"];?></div></td>
40.    <td align="right"><?php echo $result["BUDGET"];?></td>
41.    <td align="right"><?php echo $result["USED"];?></td>
42.  </tr>
43.<?php
44.}
45.?>
46.</table>
47.<?php
48.mysqli_close($conn);
49.?>
50.</body>
51.</html>

Result

Stored Procedure บน MySQL

ผลลัพธ์ทีไ่ด้ สามารถประยุกต์ใช้ได้กับการ Prepare Statement ของ mysqli ได้



Code 1 : การเรียกผ่าน CALL และการทำ Prepare Statement
01.<html>
02.<head>
03.<title>ThaiCreate.Com PHP & MySQL (mysqli)</title>
04.</head>
05.<body>
06.<?php
07.    ini_set('display_errors', 1);
08.    error_reporting(~0);
09. 
10.    $serverName = "localhost";
11.    $userName = "root";
12.    $userPassword = "root";
13.    $dbName = "mydatabase";
14. 
15.    $conn = mysqli_connect($serverName,$userName,$userPassword,$dbName);
16. 
17.    $strCountryCode = "US";
18.    $sql = "CALL getCustomer(?)";
19.    $stmt = $conn->prepare($sql);
20.    $stmt->bind_param('s', $strCountryCode); //   s - string, b - blob, i - int, etc
21. 
22.    $stmt ->execute();
23.    $result = $stmt->get_result();
24.?>
25.<table width="600" border="1">
26.  <tr>
27.    <th width="91"> <div align="center">CustomerID </div></th>
28.    <th width="98"> <div align="center">Name </div></th>
29.    <th width="198"> <div align="center">Email </div></th>
30.    <th width="97"> <div align="center">CountryCode </div></th>
31.    <th width="59"> <div align="center">Budget </div></th>
32.    <th width="71"> <div align="center">Used </div></th>
33.  </tr>
34.<?php
35.while($row = $result->fetch_assoc())
36.{
37.?>
38.  <tr>
39.    <td><div align="center"><?php echo $row["CUSTOMER_ID"];?></div></td>
40.    <td><?php echo $row["NAME"];?></td>
41.    <td><?php echo $row["EMAIL"];?></td>
42.    <td><div align="center"><?php echo $row["COUNTRY_CODE"];?></div></td>
43.    <td align="right"><?php echo $row["BUDGET"];?></td>
44.    <td align="right"><?php echo $row["USED"];?></td>
45.  </tr>
46.<?php
47.}
48.?>
49.</table>
50.<?php
51.mysqli_close($conn);
52.?>
53.</body>
54.</html>


Example 2 : การใช้ PHP เรียก Stored Procedure แบบ Query เพื่อ Insert ข้อมูล

Stored Procedure Name : insertCustomer()
01.DROP PROCEDURE IF EXISTS insertCustomer;
02. 
03.DELIMITER //
04.CREATE PROCEDURE insertCustomer(IN pCustomerID VARCHAR(4),
05.    IN pName VARCHAR(150),
06.    IN pEmail VARCHAR(150),
07.    IN pCountryCode VARCHAR(2),
08.    IN pBudget DECIMAL(18,2),
09.    IN pUsed DECIMAL(18,2))
10.BEGIN
11.   INSERT INTO customer (CUSTOMER_ID, NAME, EMAIL, COUNTRY_CODE, BUDGET, USED)
12.    VALUES (pCustomerID, pName, pEmail, pCountryCode, pBudget, pUsed);
13.END //
14.DELIMITER ;

add.php
01.<html>
02.<head>
03.<title>ThaiCreate.Com PHP & MySQL (mysqli)</title>
04.</head>
05.<body>
06.<form action="save.php" name="frmAdd" method="post">
07.<table width="284" border="1">
08.  <tr>
09.    <th width="120">CustomerID</th>
10.    <td width="238"><input type="text" name="txtCustomerID" size="5"></td>
11.    </tr>
12.  <tr>
13.    <th width="120">Name</th>
14.    <td><input type="text" name="txtName" size="20"></td>
15.    </tr>
16.  <tr>
17.    <th width="120">Email</th>
18.    <td><input type="text" name="txtEmail" size="20"></td>
19.    </tr>
20.  <tr>
21.    <th width="120">CountryCode</th>
22.    <td><input type="text" name="txtCountryCode" size="2"></td>
23.    </tr>
24.  <tr>
25.    <th width="120">Budget</th>
26.    <td><input type="text" name="txtBudget" size="5"></td>
27.    </tr>
28.  <tr>
29.    <th width="120">Used</th>
30.    <td><input type="text" name="txtUsed" size="5"></td>
31.    </tr>
32.  </table>
33.  <input type="submit" name="submit" value="submit">
34.</form>
35.</body>
36.</html>

save.php
01.<html>
02.<head>
03.<title>ThaiCreate.Com PHP & MySQL (mysqli)</title>
04.</head>
05.<body>
06.<?php
07.    ini_set('display_errors', 1);
08.    error_reporting(~0);
09. 
10.    $serverName = "localhost";
11.    $userName = "root";
12.    $userPassword = "root";
13.    $dbName = "mydatabase";
14. 
15.    $conn = mysqli_connect($serverName,$userName,$userPassword,$dbName);
16. 
17.    $strCustomerID = $_POST["txtCustomerID"];
18.    $strName = $_POST["txtName"];
19.    $strEmail = $_POST["txtEmail"];
20.    $strCountryCode = $_POST["txtCountryCode"];
21.    $strBudget = $_POST["txtBudget"];
22.    $strUsed = $_POST["txtUsed"];
23. 
24.    $sql = "CALL insertCustomer('$strCustomerID', '$strName', '$strEmail', '$strCountryCode', '$strBudget', '$strUsed')";
25. 
26.    $query = mysqli_query($conn,$sql);
27. 
28.    if(!$query) {
29.        echo mysqli_error($conn);
30.    }
31.    else
32.    {
33.        echo "Record add successfully";
34.    }
35. 
36.    mysqli_close($conn);
37.?>
38.</body>
39.</html>

Result

Stored Procedure บน MySQL

Insert ข้อมูลและ Save

Stored Procedure บน MySQL

ผลลัพธ์ที่ได้



สามารถประยุกต์ในรูปแบบของการ Prepare Statement
01.<html>
02.<head>
03.<title>ThaiCreate.Com PHP & MySQL (mysqli)</title>
04.</head>
05.<body>
06.<?php
07.    ini_set('display_errors', 1);
08.    error_reporting(~0);
09. 
10.    $serverName = "localhost";
11.    $userName = "root";
12.    $userPassword = "root";
13.    $dbName = "mydatabase";
14. 
15.    $conn = mysqli_connect($serverName,$userName,$userPassword,$dbName);
16. 
17.    $strCustomerID = $_POST["txtCustomerID"];
18.    $strName = $_POST["txtName"];
19.    $strEmail = $_POST["txtEmail"];
20.    $strCountryCode = $_POST["txtCountryCode"];
21.    $strBudget = $_POST["txtBudget"];
22.    $strUsed = $_POST["txtUsed"];
23. 
24.    $sql = "CALL insertCustomer(?, ?, ?, ?, ?, ?)";
25.    $stmt = $conn->prepare($sql);
26.    $stmt->bind_param('ssssii', $strCustomerID, $strName, $strEmail, $strCountryCode, $strBudget, $strUsed); //   s - string, b - blob, i - int, etc
27. 
28.    $stmt ->execute();
29. 
30.    printf("%d Row inserted.\n", $stmt->affected_rows);
31. 
32.    $conn->close();
33.?>
34.</body>
35.</html>

ส่วนวิธีการ UPDATE และ DELETE ก็ใช้หลักการเดียวกับการ INSERT ข้อมูล

สำหรับตัวอย่างที่ 3 และ 4 จะเป็นการอ่านจาก OUTPUT หรือ OUT

ตอนที่ 9 : การใช้พารามิเตอร์ชนิด OUT เพื่อส่งค่ากลับ (MySQL : Stored Procedure)


Example 3 : การใช้ PHP เรียก Stored Procedure และอ่านค่า OUTPUT พร้อมกับ SELECT ข้อมูล

Stored Procedure Name : getCustomer()
01.DROP PROCEDURE IF EXISTS getCustomer;
02. 
03.DELIMITER //
04.CREATE PROCEDURE getCustomer(IN pCountryCode VARCHAR(2),
05.    OUT pRowFound INT)
06.BEGIN
07. 
08.    # Return SELECT
09.    SELECT * FROM customer WHERE COUNTRY_CODE = sCountryCode;
10.     
11.    # Return  pRowFound
12.    SET pRowFound  = FOUND_ROWS();
13.         
14.END //
15. 
16.DELIMITER ;

PHP MySQL Stored OUTPUT

Code (PHP)
01.$serverName = "localhost";
02.$userName = "root";
03.$userPassword = "root";
04.$dbName = "mydatabase";
05. 
06.$mysqli = new mysqli($serverName, $userName, $userPassword,$dbName);
07.if(!$mysqli) die('Error : ' . $mysqli->connect_error);
08. 
09.$strCountryCode = "US";
10. 
11.$mysqli->query("SET @pCountryCode = '".$strCountryCode."'"); // IN
12.$mysqli->query("SET @pRowFound = 0"); // OUT
13. 
14. 
15.$res = $mysqli->multi_query("CALL getCustomer(@pCountryCode,@pRowFound); SELECT @pRowFound"); 
16.if(!$res) die("Error : " . $mysqli->error);
17. 
18./*
19.// Get all Result
20.if( $res ) {
21.  $results = 0;
22.  do {
23.    if ($result = $mysqli->store_result()) {
24.      printf( "<b>Result #%u</b>:<br/>", ++$results );
25.      while( $row = $result->fetch_row() ) {
26.        foreach( $row as $cell ) echo $cell, "&nbsp;";
27.      }
28.      $result->close();
29.      if( $mysqli->more_results() ) echo "<br/>";
30.    }
31.  } while ($mysqli->more_results() && $mysqli->next_result());
32.}
33.**/
34. 
35. 
36.// Result 1
37.$result = $mysqli->store_result();
38.while( $row = $result->fetch_row() ) {
39.    foreach( $row as $cell ) echo $cell, "&nbsp;";
40.}        
41.$result->free();
42.$mysqli->next_result();
43. 
44. 
45.echo "<br><br>";   
46. 
47.// Result 2
48.$mysqli->next_result();
49.$result = $mysqli->store_result();
50.while( $row = $result->fetch_row() ) {
51.    foreach( $row as $cell ) echo $cell, "&nbsp;";
52.}  
53. 
54.$mysqli->close();

PHP MySQL Stored OUTPUT

การอ่านค่า OUTPUT ที่ถูกส่งกลับ อ่านได้ทั้งค่า Parameters และค่าที่ได้จากการ SELECT

Code (PHP) : แสดงผลบน Table
01.<html>
02.<head>
03.<title>ThaiCreate.Com PHP & MySQL (mysqli)</title>
04.</head>
05.<body>
06.<?php
07.    ini_set('display_errors', 1);
08.    error_reporting(~0);
09. 
10.    $serverName = "localhost";
11.    $userName = "root";
12.    $userPassword = "root";
13.    $dbName = "mydatabase";
14. 
15.    $mysqli = new mysqli($serverName, $userName, $userPassword,$dbName);
16.    if(!$mysqli) die('Error : ' . $mysqli->connect_error);
17. 
18.    $strCountryCode = "US";
19.     
20.    $mysqli->query("SET @pCountryCode = '".$strCountryCode."'"); // IN
21.    $mysqli->query("SET @pRowFound = 0"); // OUT
22. 
23. 
24.    $res = $mysqli->multi_query("CALL getCustomer(@pCountryCode,@pRowFound); SELECT @pRowFound"); 
25.    if(!$res) die("Error : " . $mysqli->error);
26. 
27.echo "Result from SELECT";
28.?>
29.<table width="600" border="1">
30.  <tr>
31.    <th width="91"> <div align="center">CustomerID </div></th>
32.    <th width="98"> <div align="center">Name </div></th>
33.    <th width="198"> <div align="center">Email </div></th>
34.    <th width="97"> <div align="center">CountryCode </div></th>
35.    <th width="59"> <div align="center">Budget </div></th>
36.    <th width="71"> <div align="center">Used </div></th>
37.  </tr>
38.<?php
39.$result = $mysqli->store_result();
40.while($row = $result->fetch_assoc())
41.{
42.?>
43.  <tr>
44.    <td><div align="center"><?php echo $row["CUSTOMER_ID"];?></div></td>
45.    <td><?php echo $row["NAME"];?></td>
46.    <td><?php echo $row["EMAIL"];?></td>
47.    <td><div align="center"><?php echo $row["COUNTRY_CODE"];?></div></td>
48.    <td align="right"><?php echo $row["BUDGET"];?></td>
49.    <td align="right"><?php echo $row["USED"];?></td>
50.  </tr>
51.<?php
52.}
53.    $result->free();
54.    $mysqli->next_result();
55.?>
56.</table><br />
57.<?php
58.echo "Result from @pRowFound : ";
59.$mysqli->next_result();
60.$result = $mysqli->store_result();
61.$row = $result->fetch_assoc();
62.echo $row["@pRowFound"];
63. 
64.$mysqli->close();
65.?>
66.</body>
67.</html>

PHP MySQL Stored OUTPUT

แสดงผลบน Table


Example 4 : การใช้ PHP เรียก Stored Procedure และอ่านค่า OUTPUT ที่มีตั้งแต่ 2 ค่าขึ้นไป

Stored Procedure Name : insertCustomer()
01.DROP PROCEDURE IF EXISTS insertCustomer;
02. 
03.DELIMITER //
04.CREATE PROCEDURE insertCustomer(IN pCustomerID VARCHAR(4),
05.    IN pName VARCHAR(150),
06.    IN pEmail VARCHAR(150),
07.    IN pCountryCode VARCHAR(2),
08.    IN pBudget DECIMAL(18,2),
09.    IN pUsed DECIMAL(18,2),
10.    OUT pResult INT,
11.    OUT pMessage VARCHAR(500))
12.BEGIN
13.     
14.    # Declare Variable
15.    DECLARE errCode CHAR(5) DEFAULT '00000';
16.    DECLARE errMsg TEXT;
17.    DECLARE effRows INT;
18. 
19.    # Declare Handler Exception
20.    DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
21.        BEGIN
22.          GET DIAGNOSTICS CONDITION 1
23.        errCode = RETURNED_SQLSTATE, errMsg = MESSAGE_TEXT;
24.        END;
25. 
26.    # Statement
27.    INSERT INTO customer (CUSTOMER_ID, NAME, EMAIL, COUNTRY_CODE, BUDGET, USED)
28.        VALUES (pCustomerID, pName, pEmail, pCountryCode, pBudget, pUsed);
29. 
30.    # Set Result
31.    IF errCode = '00000' THEN
32.        SET pResult  = 1;
33.        SET pMessage = 'Insert Data Successfully';
34.    ELSE
35.        SET pResult  = 0;
36.        SET pMessage = CONCAT('Error, Code = ',errCode,', Message = ',errMsg);
37.    END IF;
38. 
39.END //
40.DELIMITER ;

OUTPUT / OUT  : Stored Procedure

กรณีที่ Insert ข้อมูลสำเร็จ

OUTPUT / OUT  : Stored Procedure

กรณีที่ Insert ข้อมูลไม่สำเร็จ

Code (PHP)
01.<html>
02.<head>
03.<title>ThaiCreate.Com PHP & MySQL (mysqli)</title>
04.</head>
05.<body>
06.<?php
07.    ini_set('display_errors', 1);
08.    error_reporting(~0);
09. 
10.    $serverName = "localhost";
11.    $userName = "root";
12.    $userPassword = "root";
13.    $dbName = "mydatabase";
14. 
15.    $mysqli = new mysqli($serverName, $userName, $userPassword,$dbName);
16.    if(!$mysqli) die('Error : ' . $mysqli->connect_error);
17. 
18.    $strCustomerID = "C005";
19.    $strName = "Fun Wipa";
20.    $strEmail = "fun.wipa@thaicreate.com";
21.    $strCountryCode = "TH";
22.    $strBudget = 1000000.00;
23.    $strUsed = 0.00;
24.     
25.    $mysqli->query("SET @pCustomerID = '".$strCustomerID."'"); // IN
26.    $mysqli->query("SET @pName = '".$strName."'"); // IN
27.    $mysqli->query("SET @pEmail = '".$strEmail."'"); // IN
28.    $mysqli->query("SET @pCountryCode = '".$strCountryCode."'"); // IN
29.    $mysqli->query("SET @pBudget = '".$strBudget."'"); // IN
30.    $mysqli->query("SET @pUsed = '".$strUsed."'"); // IN
31. 
32.    $mysqli->query("SET @pResult = 0"); // OUT
33.    $mysqli->query("SET @pMessage = 0"); // OUT
34. 
35. 
36.    $res = $mysqli->multi_query("CALL insertCustomer(@pCustomerID,@pName,@pEmail,@pCountryCode,@pBudget,@pUsed,@pResult,@pMessage);
37.                                                    SELECT @pResult,@pMessage"); 
38.    if(!$res) die("Error : " . $mysqli->error);
39.     
40.    /*
41.    // Get all Result
42.    if( $res ) {
43.      $results = 0;
44.      do {
45.        if ($result = $mysqli->store_result()) {
46.          printf( "<b>Result #%u</b>:<br/>", ++$results );
47.          while( $row = $result->fetch_row() ) {
48.            foreach( $row as $cell ) echo $cell, "&nbsp;";
49.          }
50.          $result->close();
51.          if( $mysqli->more_results() ) echo "<br/>";
52.        }
53.      } while ($mysqli->more_results() && $mysqli->next_result());
54.    }
55.    **/
56.     
57.    $pResult = "";
58.    $pMessage = "";
59. 
60.    if($res) {
61.      $results = 0;
62.      do {
63.        if ($result = $mysqli->store_result()) {
64.          $row = $result->fetch_assoc();
65.          $pResult = $row["@pResult"];
66.          $pMessage = $row["@pMessage"];
67.          $result->close();
68.          if( $mysqli->more_results() ) echo "<br/>";
69.        }
70.      } while ($mysqli->more_results() && $mysqli->next_result());
71.    }
72. 
73.    echo "@pResult : ". $row["@pResult"];
74.    echo "<br>";
75.    echo "@pMessage : ". $row["@pMessage"];
76. 
77.    $mysqli->close();
78. 
79.?>
80.</body>
81.</html>

PHP MySQL Stored OUTPUT

กรณีที่ Insert ข้อมูลสำเร็จ

PHP MySQL Stored OUTPUT

กรณีที่ Insert ข้อมูลไม่สำเร็จ



เขียนได้อีกวิธีคือ

Code (PHP)
01.<html>
02.<head>
03.<title>ThaiCreate.Com PHP & MySQL (mysqli)</title>
04.</head>
05.<body>
06.<?php
07.    ini_set('display_errors', 1);
08.    error_reporting(~0);
09. 
10.    $serverName = "localhost";
11.    $userName = "root";
12.    $userPassword = "";
13.    $dbName = "mydatabase";
14. 
15.    $conn = mysqli_connect($serverName,$userName,$userPassword,$dbName);
16. 
17.    $strCustomerID = "C005";
18.    $strName = "Fun Wipa";
19.    $strEmail = "fun.wipa@thaicreate.com";
20.    $strCountryCode = "TH";
21.    $strBudget = 1000000.00;
22.    $strUsed = 0.00;
23.     
24.    $stmt = mysqli_prepare($conn, 'CALL insertCustomer(?, ?, ?, ?, ?, ?, @pResult, @pMessage)');
25.    mysqli_stmt_bind_param($stmt, 'ssssii', $strCustomerID, $strName, $strEmail, $strCountryCode, $strBudget, $strUsed);  //s - string, b - blob, i - int, etc
26.    mysqli_stmt_execute($stmt);
27. 
28.    $query = mysqli_query($conn, 'SELECT @pResult, @pMessage');
29.    $result = mysqli_fetch_assoc($query);
30.    $strResult     = $result['@pResult'];
31.    $strMessage = $result['@pMessage'];
32. 
33. 
34.    echo "@pResult : ". $strResult;
35.    echo "<br>";
36.    echo "@pMessage : ". $strMessage;
37. 
38.    $conn->close();
39.?>
40.</body>
41.</html>


   
Hate it
Don't like it
It's ok
Like it
Love it
Share


ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท


ลองใช้ค้นหาข้อมูล


   


Bookmark.   
       
  By : ThaiCreate.Com Team (บทความเป็นลิขสิทธิ์ของเว็บไทยครีเอทห้ามนำเผยแพร่ ณ เว็บไซต์อื่น ๆ)
  Score Rating :  
  Create/Update Date : 2015-10-10 22:01:58 / 2017-03-24 22:04:53
  Download : No files
 Sponsored Links / Related

 
ตอนที่ 1 : รู้จักและการสร้าง Stored Procedure บน MySQL (MySQL : Stored Procedure)
Rating :

 
ตอนที่ 2 : การสร้าง Parameters บน MySQL (MySQL : Stored Procedure)
Rating :

 
ตอนที่ 3 : การ Print และแสดงผลบน Stored Procedure (MySQL : Stored Procedure)
Rating :

 
ตอนที่ 4 : การสร้างตัวแปร Declare Variable บน Stored Procedure (MySQL : Stored Procedure)
Rating :

 
ตอนที่ 5 : การสร้าง Declare Temp Table - TEMPORARY (MySQL : Stored Procedure)
Rating :

 
ตอนที่ 6 : การสร้าง Loop ข้อมูลบน Stored Procedure (MySQL : Stored Procedure)
Rating :

 
ตอนที่ 7 : การใช้ Cursor บน Stored Procedure (MySQL : Stored Procedure)
Rating :

 
ตอนที่ 8 : การใช้ IF....ELSE... สร้างเงื่อนไข (MySQL : Stored Procedure)
Rating :

 
ตอนที่ 9 : การใช้พารามิเตอร์ชนิด OUT เพื่อส่งค่ากลับ (MySQL : Stored Procedure)
Rating :

 
ตอนที่ 10 : การใช้ CASE WHEN บน Stored Procedure (MySQL : Stored Procedure)
Rating :

 
ตอนที่ 11 : การใช้ Error Handling หรือ Try Catch ดักจับข้อผิดลาด (MySQL : Stored Procedure)
Rating :

 
ตอนที่ 12 : การใช้ Transaction บน MySQL Stored Procedure (MySQL : Stored Procedure)
Rating :

 
ตอนที่ 13 : การสร้าง VIEW Table บน MySQL Database (MySQL : View Table)
Rating :

 
ตอนที่ 14 : การสร้าง Trigger บน MySQL Database (MySQL : Trigger)
Rating :

 
ตอนที่ 15 : การสร้าง Function บน MySQL Database (MySQL : Function)
Rating :

 
ตอนที่ 16 : การใช้ phpMyAdmin : Stored Procedure, View, Function, Trigger บน MySQL
Rating :

 
ตอนที่ 17 : การ Export/Import : Stored Procedure, View, Function, Trigger บน MySQL
Rating :

 
ตอนที่ 18 : การ Debug Stored Procedure บน MySQL เพื่อตรวจสอบค่าตัวแปร
Rating :

 
ตอนที่ 20 : Visual Basic (VB.Net) เรียกใช้ Call MySQL Stored Procedure
Rating :

 
ตอนที่ 21 : Java เรียกใช้ Call MySQL Stored Procedure ด้วย (JDBC)
Rating :

 
ตอนที่ 22 : Visual C# (C# .Net) เรียกใช้ Call MySQL Stored Procedure
Rating :


ThaiCreate.Com Forum
Comunity Forum Free Web Script
Jobs Freelance Free Uploads
Free Web Hosting Free Tools

สอน PHP ผ่าน Youtube ฟรี
สอน Android การเขียนโปรแกรม Android
สอน Windows Phone การเขียนโปรแกรม Windows Phone 7 และ 8
สอน iOS การเขียนโปรแกรม iPhone, iPad
สอน Java การเขียนโปรแกรม ภาษา Java
สอน Java GUI การเขียนโปรแกรม ภาษา Java GUI
สอน JSP การเขียนโปรแกรม ภาษา Java
สอน jQuery การเขียนโปรแกรม ภาษา jQuery
สอน .Net การเขียนโปรแกรม ภาษา .Net
Free Tutorial
สอน Google Maps Api
สอน Windows Service
สอน Entity Framework
สอน Android
สอน Java เขียน Java
Java GUI Swing
สอน JSP (Web App)
iOS (iPhone,iPad)
Windows Phone
Windows Azure
Windows Store
Laravel Framework
Yii PHP Framework
สอน jQuery
สอน jQuery กับ Ajax
สอน PHP OOP (Vdo)
Ajax Tutorials
SQL Tutorials
สอน SQL (Part 2)
JavaScript Tutorial
Javascript Tips
VBScript Tutorial
VBScript Validation
Microsoft Access
MySQL Tutorials
-- Stored Procedure
MariaDB Database
SQL Server Tutorial
SQL Server 2005
SQL Server 2008
SQL Server 2012
-- Stored Procedure
Oracle Database
-- Stored Procedure
SVN (Subversion)
แนวทางการทำ SEO
ปรับแต่งเว็บให้โหลดเร็ว


Hit Link
   





ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2025 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่