Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > PHP > PHP Forum > มันไม่ขึ้นฐานข้อมูลให้อะครับ ช่วยดูให้หน่อย นะครับผม หมดปัญญาแล้ว



 

มันไม่ขึ้นฐานข้อมูลให้อะครับ ช่วยดูให้หน่อย นะครับผม หมดปัญญาแล้ว

 



Topic : 112414



โพสกระทู้ ( 0 )
บทความ ( 0 )



สถานะออฟไลน์




มันขึ้นอย่างนี้





Code
<?php require_once('Connections/eye_data.php'); ?>
<?php
//initialize the session
if (!isset($_SESSION)) {
  session_start();
}

// ** Logout the current user. **
$logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
  $logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_GET['doLogout'])) &&($_GET['doLogout']=="true")){
  //to fully log out a visitor we need to clear the session varialbles
  $_SESSION['MM_Username'] = NULL;
  $_SESSION['MM_UserGroup'] = NULL;
  $_SESSION['PrevUrl'] = NULL;
  unset($_SESSION['MM_Username']);
  unset($_SESSION['MM_UserGroup']);
  unset($_SESSION['PrevUrl']);
	
  $logoutGoTo = "student_login.php";
  if ($logoutGoTo) {
    header("Location: $logoutGoTo");
    exit;
  }
}
?>
<?php
if (!isset($_SESSION)) {
  session_start();
}
$MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";

// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) { 
  // For security, start by assuming the visitor is NOT authorized. 
  $isValid = False; 

  // When a visitor has logged into this site, the Session variable MM_Username set equal to their username. 
  // Therefore, we know that a user is NOT logged in if that Session variable is blank. 
  if (!empty($UserName)) { 
    // Besides being logged in, you may restrict access to only certain users based on an ID established when they login. 
    // Parse the strings into arrays. 
    $arrUsers = Explode(",", $strUsers); 
    $arrGroups = Explode(",", $strGroups); 
    if (in_array($UserName, $arrUsers)) { 
      $isValid = true; 
    } 
    // Or, you may restrict access to only certain users based on their username. 
    if (in_array($UserGroup, $arrGroups)) { 
      $isValid = true; 
    } 
    if (($strUsers == "") && true) { 
      $isValid = true; 
    } 
  } 
  return $isValid; 
}

$MM_restrictGoTo = "student_login.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {   
  $MM_qsChar = "?";
  $MM_referrer = $_SERVER['PHP_SELF'];
  if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
  if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0) 
  $MM_referrer .= "?" . $_SERVER['QUERY_STRING'];
  $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
  header("Location: ". $MM_restrictGoTo); 
  exit;
}
?>
<?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;
}
}

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;
}
}

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;
}
}

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;
}
}

$colname_Rs_show_pass = "-1";
if (isset($_SESSION['MM_Username'])) {
  $colname_Rs_show_pass = $_SESSION['MM_Username'];
}
mysql_select_db($database_eye_data, $eye_data);
$query_Rs_show_pass = sprintf("SELECT * FROM student_member WHERE username = %s", GetSQLValueString($colname_Rs_show_pass, "text"));
$Rs_show_pass = mysql_query($query_Rs_show_pass, $eye_data) or die(mysql_error());
$row_Rs_show_pass = mysql_fetch_assoc($Rs_show_pass);
$totalRows_Rs_show_pass = mysql_num_rows($Rs_show_pass);

$colname_Rs_show_profile = "-1";
if (isset($_POST['MM_Username'])) {
  $colname_Rs_show_profile = $_POST['MM_Username'];
}
mysql_select_db($database_eye_data, $eye_data);
$query_Rs_show_profile = sprintf("SELECT * FROM d_name WHERE id = %s", GetSQLValueString($colname_Rs_show_profile, "int"));
$Rs_show_profile = mysql_query($query_Rs_show_profile, $eye_data) or die(mysql_error());
$row_Rs_show_profile = mysql_fetch_assoc($Rs_show_profile);
$totalRows_Rs_show_profile = mysql_num_rows($Rs_show_profile);

$checkid = $row_Rs_show_time['id'];
$checkroom = $row_Rs_show_time['room'];
mysql_select_db($database_eye_data, $eye_data);
$query_Rs_show_time = ("SELECT id_time,  d_time.time_in, d_time.time_out, d_time.status ,d_time.id ,d_time.room, d_time.date FROM d_time WHERE d_time.id = '$checkid' AND d_time.room = '$checkroom'");
$Rs_show_time = mysql_query($query_Rs_show_time, $eye_data) or die(mysql_error());
$row_Rs_show_time = mysql_fetch_assoc($Rs_show_time);
$totalRows_Rs_show_time = mysql_num_rows($Rs_show_time);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>STUDENT LOGIN</title>
<style type="text/css">
body {
	background-color: #C0D1FF;
}
body,td,th {
	color: #000000;
	text-align: center;
}
</style>
<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
</head>

<body>
<table width="800" border="0" align="center">
  <tr bgcolor="#D6D6D6">
    <th scope="col"><img src="images/logo.jpg" width="800" height="150" /></th>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td><ul id="MenuBar1" class="MenuBarHorizontal">
      <li><a href="#"><img src="images/home-128.png" width="128" height="128" />HOME</a>        </li>
      <li><a href="#"><img src="images/graduated.png" width="128" height="128" />STUDENT</a></li>
      <li><a href="#"><img src="images/teacher_icon.jpg" width="128" height="128" />TEACHER</a>        </li>
      <li><a href="#"><img src="images/admin2.png" width="128" height="128" />ADMIN</a></li>
      <li><a href="#"><img src="images/url.jpg" width="128" height="128" />ABOUT</a></li>
    </ul></td>
  </tr>
  <tr>
    <td height="300" align="left" valign="baseline" bgcolor="#D6D6D6"><form id="form1" name="form1" method="post" action="">
      <p>รหัสนักศึกษา <strong><?php echo $_SESSION['MM_Username']; ?></strong> <?php echo $row_Rs_show_pass['student_name']; ?><a href="<?php echo $logoutAction ?>"> ออกจากระบบ</a></p>
      <p>วันจันทร์ คาบ 1-4  ห้อง IT401</p>
      <p>&nbsp;</p>
      <table border="1" align="center">
        <tr>
          <td>id_time</td>
          <td>time_in</td>
          <td>time_out</td>
          <td>status</td>
          <td>id</td>
          <td>room</td>
          <td>date</td>
        </tr>
        <?php do { ?>
          <tr>
            <td><?php echo $row_Rs_show_time['id_time']; ?></td>
            <td><?php echo $row_Rs_show_time['time_in']; ?></td>
            <td><?php echo $row_Rs_show_time['time_out']; ?></td>
            <td><?php echo $row_Rs_show_time['status']; ?></td>
            <td><?php echo $row_Rs_show_time['id']; ?></td>
            <td><?php echo $row_Rs_show_time['room']; ?></td>
            <td><?php echo $row_Rs_show_time['date']; ?></td>
          </tr>
          <?php } while ($row_Rs_show_time = mysql_fetch_assoc($Rs_show_time)); ?>
      </table>
<center>
        <p>&nbsp;</p>
</center></p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp; </p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
    </form></td>
  </tr>
  <tr>
    <td bgcolor="#D6D6D6"><center>
      <strong>Copyright © 2014 CSIT PROJECT TEAM   </strong>
    </center></td>
  </tr>
</table>
<script type="text/javascript">
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
</script>
</body>
</html>
<?php
mysql_free_result($Rs_show_time);

mysql_free_result($Rs_show_pass);

mysql_free_result($Rs_show_profile);

?>




Tag : MySQL, Windows









ประวัติการแก้ไข
2014-11-07 12:20:40
2014-11-07 12:20:42
Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2014-11-07 12:18:36 By : tinnapat.sathurum View : 1149 Reply : 6
 

 

No. 1



โพสกระทู้ ( 9,559 )
บทความ ( 2 )



สถานะออฟไลน์


งงครบั

if (!function_exists("GetSQLValueString")) {

ทำไมต้อง ตรวจสอบแล้ว สร้าง function ข้างบน หลายหน ครั้งเดียว ก็ใช้งานได้แล้วครับ

mysql_select_db($database_eye_data, $eye_data); นี่ก็ด้วย ครั้งเดียว หลัง connect ก็ใช้ได้ทั้งโปรแกรม


Code (PHP)
<?php
mysql_free_result($Rs_show_time);

mysql_free_result($Rs_show_pass);

mysql_free_result($Rs_show_profile);

?>

mysql_free_result() มาทำตอนจบโปรแกรมไม่ได้ ประโยชน์อะไรครับ ถ้าจะทำๆ ระหว่างโปรแกรม เพื่อคืนหน่วยความจำ


print_r( ); exit; เช็คไปที่ละส่วน ให้มองเห็น ข้อมูล ที mysql_fetch_assoc() มาใช้ ครับ








ประวัติการแก้ไข
2014-11-07 13:22:02
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2014-11-07 13:20:55 By : Chaidhanan
 


 

No. 2



โพสกระทู้ ( 1,994 )
บทความ ( 10 )



สถานะออฟไลน์
Facebook Blogger

เริ่มแรกสเต็ปของผมคือ echo SQL ที่จะคิวรี่ในโปรแกรม ไปรันบน phpMyAdmin ครับ ถ้าได้ผลลัพธ์แล้วเดี๋ยวเรามาต่อกัน
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2014-11-07 13:42:14 By : {Cyberman}
 

 

No. 3



โพสกระทู้ ( 535 )
บทความ ( 0 )



สถานะออฟไลน์


ผิดดดโพสผิดที่ 5555


ประวัติการแก้ไข
2014-11-07 13:45:04
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2014-11-07 13:43:50 By : gaowteen
 


 

No. 4



โพสกระทู้ ( 0 )
บทความ ( 0 )



สถานะออฟไลน์


program_edit



Code
<?php require_once('Connections/eye_data.php'); ?>
<?php
//initialize the session
if (!isset($_SESSION)) {
session_start();
}

// ** Logout the current user. **
$logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
$logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_GET['doLogout'])) &&($_GET['doLogout']=="true")){
//to fully log out a visitor we need to clear the session varialbles
$_SESSION['MM_Username'] = NULL;
$_SESSION['MM_UserGroup'] = NULL;
$_SESSION['PrevUrl'] = NULL;
unset($_SESSION['MM_Username']);
unset($_SESSION['MM_UserGroup']);
unset($_SESSION['PrevUrl']);

$logoutGoTo = "student_login.php";
if ($logoutGoTo) {
header("Location: $logoutGoTo");
exit;
}
}
?>
<?php
if (!isset($_SESSION)) {
session_start();
}
$MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";

// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;

// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "") && true) {
$isValid = true;
}
}
return $isValid;
}

$MM_restrictGoTo = "student_login.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0)
$MM_referrer .= "?" . $_SERVER['QUERY_STRING'];
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?>
<?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;
}
}

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;
}
}

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;
}
}

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;
}
}

$colname_Rs_show_pass = "-1";
if (isset($_SESSION['MM_Username'])) {
$colname_Rs_show_pass = $_SESSION['MM_Username'];
}
mysql_select_db($database_eye_data, $eye_data);
$query_Rs_show_pass = sprintf("SELECT * FROM student_member WHERE username = %s", GetSQLValueString($colname_Rs_show_pass, "text"));
$Rs_show_pass = mysql_query($query_Rs_show_pass, $eye_data) or die(mysql_error());
$row_Rs_show_pass = mysql_fetch_assoc($Rs_show_pass);
$totalRows_Rs_show_pass = mysql_num_rows($Rs_show_pass);

$colname_Rs_show_profile = "-1";
if (isset($_POST['MM_Username'])) {
$colname_Rs_show_profile = $_POST['MM_Username'];
}
mysql_select_db($database_eye_data, $eye_data);
$query_Rs_show_profile = sprintf("SELECT * FROM d_name WHERE id = %s", GetSQLValueString($colname_Rs_show_profile, "int"));
$Rs_show_profile = mysql_query($query_Rs_show_profile, $eye_data) or die(mysql_error());
$row_Rs_show_profile = mysql_fetch_assoc($Rs_show_profile);
$totalRows_Rs_show_profile = mysql_num_rows($Rs_show_profile);

$checkid = $row_Rs_show_time['id'];
$checkroom = $row_Rs_show_time['room'];
mysql_select_db($database_eye_data, $eye_data);
$query_Rs_show_time ="SELECT id_time, d_time.time_in, d_time.time_out, d_time.status ,d_time.id ,d_time.room, d_time.date FROM d_time WHERE d_time.id = 544265021 AND d_time.room = 401";
$Rs_show_time = mysql_query($query_Rs_show_time, $eye_data) or die(mysql_error());
$row_Rs_show_time = mysql_fetch_assoc($Rs_show_time);
$totalRows_Rs_show_time = mysql_num_rows($Rs_show_time);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>STUDENT LOGIN</title>
<style type="text/css">
body {
background-color: #C0D1FF;
}
body,td,th {
color: #000000;
text-align: center;
}
</style>
<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
</head>

<body>
<table width="800" border="0" align="center">
<tr bgcolor="#D6D6D6">
<th scope="col"><img src="images/logo.jpg" width="800" height="150" /></th>
</tr>
<tr bgcolor="#FFFFFF">
<td><ul id="MenuBar1" class="MenuBarHorizontal">
<li><a href="#"><img src="images/home-128.png" width="128" height="128" />HOME</a> </li>
<li><a href="#"><img src="images/graduated.png" width="128" height="128" />STUDENT</a></li>
<li><a href="#"><img src="images/teacher_icon.jpg" width="128" height="128" />TEACHER</a> </li>
<li><a href="#"><img src="images/admin2.png" width="128" height="128" />ADMIN</a></li>
<li><a href="#"><img src="images/url.jpg" width="128" height="128" />ABOUT</a></li>
</ul></td>
</tr>
<tr>
<td height="300" align="left" valign="baseline" bgcolor="#D6D6D6"><form id="form1" name="form1" method="post" action="">
<p>รหัสนักศึกษา <strong><?php echo $_SESSION['MM_Username']; ?></strong> <?php echo $row_Rs_show_pass['student_name']; ?><a href="<?php echo $logoutAction ?>"> ออกจากระบบ</a></p>
<p>วันจันทร์ คาบ 1-4 ห้อง IT401</p>
<p>&nbsp;</p>
<table border="1" align="center">
<tr>
<td>id_time</td>
<td>time_in</td>
<td>time_out</td>
<td>status</td>
<td>id</td>
<td>room</td>
<td>date</td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_Rs_show_time['id_time']; ?></td>
<td><?php echo $row_Rs_show_time['time_in']; ?></td>
<td><?php echo $row_Rs_show_time['time_out']; ?></td>
<td><?php echo $row_Rs_show_time['status']; ?></td>
<td><?php echo $row_Rs_show_time['id']; ?></td>
<td><?php echo $row_Rs_show_time['room']; ?></td>
<td><?php echo $row_Rs_show_time['date']; ?></td>
</tr>
<?php } while ($row_Rs_show_time = mysql_fetch_assoc($Rs_show_time)); ?>
</table>
<center>
<p>&nbsp;</p>
</center></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp; </p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</form></td>
</tr>
<tr>
<td bgcolor="#D6D6D6"><center>
<strong>Copyright © 2014 CSIT PROJECT TEAM </strong>
</center></td>
</tr>
</table>
<script type="text/javascript">
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
</script>
</body>
</html>
<?php
mysql_free_result($Rs_show_time);

mysql_free_result($Rs_show_pass);

mysql_free_result($Rs_show_profile);

?>


ผม select 544265021 และ 401 มันก้อจะขึ้นให้นะครับ แต่ผมต้องการให้เป็น database ของผู้ที่ log in เข้ามาอะครับ
สังเกตุที่โค๊ด Code
"SELECT id_time, d_time.time_in, d_time.time_out, d_time.status ,d_time.id ,d_time.room, d_time.date FROM d_time WHERE d_time.id = 544265021 AND d_time.room = 401";

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2014-11-07 22:14:09 By : tinnapat.sathurum
 


 

No. 5



โพสกระทู้ ( 9,559 )
บทความ ( 2 )



สถานะออฟไลน์


ผมคงช่วยไม่ได้หรอกครับ เพราะผมแนะนำการเขียนใหม่ให้ถูกวิธีคุณก็ไม่สนใจที่จะดู ผมบอกคุณไปคุณก็คงเอาโค๊ดไปแปะ
อย่างที่คุณทำอยู่ตอนนี้โดยไม่สนใจที่จะอ่านหรือศึกษามัน เพราะคุณเชื่อว่าโค๊ดที่คุณเอามาแปะมันทำงานได้
ซึ่งก็คงทำงานได้จริงนั่นแหล่ะครับ แต่มันอ้อมโลกเอาขยะไปใส่ในโค๊ดซะมาก
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2014-11-07 22:39:59 By : Chaidhanan
 


 

No. 6



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

นี่แหละ เหตุผลที่ผมไม่แนำนำให้ใช้ Dreamweaver มันไม่ได้ทำให้คนฉลาดที่จะเรียนรู้ครับ แต่ทำให้คนนั้นขี้เกียจ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2014-11-08 08:00:20 By : mr.win
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : มันไม่ขึ้นฐานข้อมูลให้อะครับ ช่วยดูให้หน่อย นะครับผม หมดปัญญาแล้ว
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 01
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่