|
|
|
ขอความช่วยเหลื่อ หน่อยครับ การเปลี่ยนค่าที่ได้จาก databases เป็นอย่างอื่น |
|
|
|
|
|
|
|
<?php require_once('Connections/myconnect.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($database_myconnect, $myconnect);
$query_price = "SELECT setting_point.price, setting_point.`number`, setting_point.unit FROM setting_point";
$price = mysql_query($query_price, $myconnect) 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);
?>
|
|
|
|
|
Date :
2017-02-14 00:33:51 |
By :
tomrambo |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Date :
2017-02-15 09:21:32 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|