|
|
|
สอบถามเกียวกับฐานข้อมุล MySQL หน่อยครับ ขอบคุณครับ |
|
|
|
|
|
|
|
Code (PHP)
$sql = "select NULLIF( t1.simple_test_one, t2.simple_test_two) as result from db_test_1 t1, db_test_2 t2";
$res = mysqli_query($link,$sql) or die(mysqli_error());
$data = mysqli_fetch_assoc($res);
if(is_null($data["result"])){
echo "yes";
}else {
echo "no";
}
|
|
|
|
|
Date :
2014-08-02 15:32:20 |
By :
sakuraei |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ตัวแปร $link นี้อะไรครับ
|
|
|
|
|
Date :
2014-08-02 16:34:54 |
By :
yokvoice |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
แบบนี้ก็ได้ mysql_***
$sql = "select NULLIF( t1.simple_test_one, t2.simple_test_two) as result from db_test_1 t1, db_test_2 t2";
$res = mysql_query($sql) or die(mysql_error());
$data = mysql_fetch_assoc($res);
if(is_null($data["result"])){
echo "yes";
}else {
echo "no";
}
|
|
|
|
|
Date :
2014-08-02 17:00:05 |
By :
sakuraei |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|