<? @mysql_connect("localhost","root","root") or die("Error Connect Database"); @mysql_select_db("com") or die("Error Select Database"); @mysql_query("SET NAMES utf8"); ?>
<? session_start(); include "inc/config.inc.php"; ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } function unitToTxt($id){ switch ($id): case 1: return "วัน"; break; case 2: return "เดือน"; break; case 3: return "ปี"; break; endswitch; } mysql_select_db($mysql_select_db, $mysql_connect); $query_price = "SELECT setting_point.price, setting_point.`number`, setting_point.unit FROM setting_point"; $price = mysql_query($query_price, $mysql_connect) or die(mysql_error()); $row_price = mysql_fetch_assoc($price); $totalRows_price = mysql_num_rows($price); ?> <style type="text/css"> .center { text-align: center; } </style> <body> <table width="356" border="1"> <tr> <th width="111" scope="col">ราคา</th> <th width="226" scope="col">เวลาใช้งาน</th> </tr> </table> <?php do { ?> <table width="356" border="1"> <tr class="center"> <th width="111" scope="col"><?php echo $row_price['price']; ?></th> <th width="111" scope="col"><?php echo $row_price['number']; ?></th> <th width="112" bgcolor="#FF66CC" scope="col"><?php echo unitToTxt($row_price['unit']); ?></th> </tr> </table> <?php } while ($row_price = mysql_fetch_assoc($price)); ?> </body> </html><?php mysql_free_result($price); ?>
<?php ?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง