 |
การนำข้อมูลจากฐานข้อมูลมาแสดงค๊ะ ตอนแรกหนูใช่โค๊ดนี้ ก็ OK ค๊ะ |
|
 |
|
|
 |
 |
|
ลอง echo $sql ดูครับว่ามันออกเป็นอะไร
|
 |
 |
 |
 |
Date :
2013-04-25 20:25:21 |
By :
itpcc |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองแก้เป็น
Code (PHP)
<?PHP
$sql = "SELECT * FROM product_details WHERE products_title_'.$sizes_size.' = '$Products' order by id asc";
$result = mysql_query($sql);
$datas=mysql_fetch_array($result);{
$products_color = stripslashes(str_replace('\r\n', '<br>',($datas['products_color_'.$sizes])));
}
?>
หรือ
Code (PHP)
<?PHP
$products_title = 'products_title_'.$sizes_size;
$sql = "SELECT * FROM product_details WHERE $products_title = '$Products' order by id asc";
$result = mysql_query($sql);
$datas=mysql_fetch_array($result);{
$products_color = stripslashes(str_replace('\r\n', '<br>',($datas['products_color_'.$sizes])));
}
?>
|
 |
 |
 |
 |
Date :
2013-04-26 10:49:30 |
By :
arm8957 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|