<?php require('Connections/book.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; } } $maxRows_search = 10; $pageNum_search = 0; if (isset($_GET['pageNum_search'])) { $pageNum_search = $_GET['pageNum_search']; } $startRow_search = $pageNum_search * $maxRows_search; $colname_search = "-1"; if (isset($_POST['key'])) { $colname_search = $_POST['key']; } mysql_select_db($database_book, $book); $query_search = sprintf("SELECT * FROM book_data WHERE book_name_en LIKE %s ORDER BY book_name_en ASC", GetSQLValueString("%" . $colname_search . "%", "text")); $query_limit_search = sprintf("%s LIMIT %d, %d", $query_search, $startRow_search, $maxRows_search); $search = mysql_query($query_limit_search, $book) or die(mysql_error()); $row_search = mysql_fetch_assoc($search); if (isset($_GET['totalRows_search'])) { $totalRows_search = $_GET['totalRows_search']; } else { $all_search = mysql_query($query_search); $totalRows_search = mysql_num_rows($all_search); } $totalPages_search = ceil($totalRows_search/$maxRows_search)-1; ?> <table width="200" border="0.5"> <tr> <td>ID</td> <td>EN</td> <td>TH</td> <td>Country</td> </tr> <?php do { ?> <tr> <td><?php echo $row_search['book_id']; ?></td> <td><?php echo $row_search['book_name_en']; ?></td> <td><?php echo $row_search['book_name_th']; ?></td> <td><?php echo $row_search['country']; ?></td> </tr> <?php } while ($row_search = mysql_fetch_assoc($search)); ?> </table> <?php mysql_free_result($search); ?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง