|
 |
|
ขอคำแนะหน่อยครับในการเขียนโคดคำนวนน่ะครับ ตอนนี้ผมใช้โคดนี้เป็นตัวอย่างในการเขียนอยู่ครับแต่มีปัญหาอยู่นิดหน่อยน่ะครับ |
|
 |
|
|
 |
 |
|
Sample4.php
<html>
<head>
<body bgcolor="#FFFFFF">
<?
$host="localhost";
$username="";
$pass_word="";
$db="mydatabase";
$tb="color";
mysql_connect( $host,$username,$pass_word) or die ("ติดต่อกับฐานข้อมูล Mysql ไม่ได้ ");
mysql_select_db($db) or die("เลือกฐานข้อมูลไม่ได้");
for ($i=0;$i<count($color_array);$i++) {
$color_no[$i] = $color_array[$i];
if($color_no[$i] !=""){ //ตรวจสอบค่า array checbox ที่ติกเลือกมา มีค่าหรือไม่
$sql="Select * From $tb where color_no=$color_no[$i]";
$db_query=mysql_db_query($db,$sql);
$result = mysql_fetch_array($db_query);
$result_color_no=$result['color_no'];
$color_name=$result[color_name];
echo "$result_color_no \t $color_name<br>";
mysql_free_result($db_query);
}
}
//ลองดูนะครับแต่ผมยังไม่ได้รันดูนะครับ
?>
</body>
</html>
|
 |
 |
 |
 |
Date :
1 พ.ย. 2549 20:47:02 |
By :
เกาลัด |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 05
|