ช่วยแก้โค้ดหน่อยค่ะ

ถาม-ตอบ แนะนำไอเดียว โค้ดตัวอย่าง แนวทาง วิธีแก้ปัญหา ช่วยแก้โค้ดหน่อยค่ะ

ช่วยแก้โค้ดหน่อยค่ะ
ยอดเงินคืนไม่แสดงอะค่ะ อยากไห่มันแสดงจะได้รู้ว่าต้องชำระเท่าไหร่ค่ะ
<?php require_once('../Connections/connection.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;
}
}

$colname_pp = "-1";
if (isset($_POST['word'])) {
  $colname_pp = $_POST['word'];
}
mysql_select_db($database_connection, $connection);
$query_pp = sprintf("SELECT Loans_id, Loans_date, Members_name, Loans_deadline, Loans_status, LP_date, LP_money FROM loans WHERE Members_name LIKE %s", GetSQLValueString("%" . $colname_pp . "%", "text"));


$pp = mysql_query($query_pp, $connection) or die(mysql_error());
$row_pp = mysql_fetch_assoc($pp);
$totalRows_pp = mysql_num_rows($pp);
?>
<!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>ศูนย์ข้าวชุมชนตำบลโพกรวม</title>
<style type="text/css">
a:link {
	color: #000;
	text-decoration: none;
}
a:visited {
	text-decoration: none;
	color: #000;
}
a:hover {
	text-decoration: none;
	color: #F00;
}
a:active {
	text-decoration: none;
	color: #F00;
}
</style>
</head>
<body background="../img/11 (1).jpg">
<center>
<img src="../img/111.jpg" height="250" width="1024">

<form id="form1" name="form1" method="post" action="payment_show.php">
  <h2>ข้อมูลการรับชำระเงินกู้ยืมทุนกองทุน</h2>
  <label for="word">ค้นหาชื่อสมาชิก : </label>
  <input name="word" type="text" id="word" />
  <input type="submit" name="button" id="button" value="ค้นหา" />

  <table width="1100" border="0" align="center">
    <tr>
    <td align="right"><a href="admin_page.php"><img src="../img/1138515785.gif">  <b>กลับเมนูหลัก</b> <img src="../img/1138515921.gif"></a></td>
  </tr>
</table>
<table border="1" align="center" width="1100">
  <tr align="center" bgcolor="#FF99CC">
    <td>รหัสรับชำระเงินกู้ยืม</td>
    <td>วันทำสัญญา</td>
    <td>ชื่อ-สกุลสมาชิก</td>
    <td>ยอดเงินคืน</td>
    <td>กำหนดคืน</td>
    <td>สถานะกู้ยืม</td>
    <td bgcolor="#FF9966">วันที่ชำระเงิน</td>
    <td>ยอดเงินคืนทั้งหมด</td>
    <td>เพิ่ม</td>
    <td>แก้ไข</td>
    <td>ลบ</td>
    <td>พิมพ์</td>
  </tr>
  <?php do { ?>
    <tr align="center" bgcolor="#FFCCCC">
      <td><?php echo $row_pp['Loans_id'];?></td>
      <td><?php echo date("d-m-Y",strtotime($row_pp['Loans_date'])); ?></td>
      <td><?php echo $row_pp['Members_name']; ?></td>
      <td><?php echo $row_pp['Loans_balance']; ?></td>
      <td><?php echo date("d-m-Y",strtotime($row_pp['Loans_deadline'])); ?></td>
      <td><?php if(!isset($row_pp['Loans_status']) || $row_pp['Loans_status']=="ยังไม่ได้ชำระเงิน"){  
     echo $row_pp['Loans_status']; 
 } ?></td>
      <td bgcolor="#FF9966"><?php if(!isset($row_pp['Loans_status']) || $row_pp['Loans_status']=="ยังไม่ได้ชำระเงิน"){    
     echo "00-00-0000";
 }else{
     echo date("d-m-Y",strtotime($row_pp['LP_date']));
} ?></td>
      <td><?php  echo $row_pp['LP_money']; ?></td>
      <td><a href="payment_insert.php?Loans_id=<?php echo $row_pp['Loans_id']; ?>"><img src="../img/Add.png" width="30" height="28" /></a></td>
      <td><a href="payment_show.php?Loans_id=<?php echo $row_pp['Loans_id']; ?>"><img src="../img/Edit.png" width="30" height="28" /></a></td>
      <td><a href="payment_delete.php?Loans_id=<?php echo $row_pp['Loans_id']; ?>"><img src="../img/delete.png" width="30" height="28" /></a></td>
      <td><div onclick=""><a href="pay_pp.php?Loans_id=<?php echo $row_pp ['Loans_id']; ?>" onclick="{window.open("pay_pp.php?Loans_id=<? echo $row_pp['Loans_id']?>","popup","height=550,width=610,left=200,top=150,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no")}"><img src="../img/printButton.png" width="30" height="28" /></a></td>
    </tr>
    <?php } while ($row_pp = mysql_fetch_assoc($pp)); ?>
</table>


</form>
</center>
</body>
</html>
<?php
mysql_free_result($pp);
?>


Monchusa 125.26.116.xxx 10-03-2016 00:11:33

คำแนะนำ และการใช้งาน

สมาชิก กรุณา ล็อกอินเข้าระบบ เพื่อตั้งคำถามใหม่ หรือ ตอบคำถาม สมาชิกใหม่ สมัครสมาชิกได้ที่ สมัครสมาชิก


  • ถาม-ตอบ กรุณา ล็อกอินเข้าระบบ
  • เปลี่ยน


    ( หรือ เข้าใช้งานผ่าน Social Login )

 ความคิดเห็นที่ 1
ลองลบบรรทัดที่ 43 ออกดู

$row_pp = mysql_fetch_assoc($pp);  

ไม่เคยใช้รูปแบบเขียนโค้ดโดยใช้ dreamweaver ช่วยเขียน  มานานแล้ว


ninenik 122.155.43.xxx 10-03-2016
 ความคิดเห็นที่ 2
ลบแร้วก๊ ไม่ขึ้นอะค่ะ 


monchusa 125.26.116.xxx 10-03-2016 00:34
 ความคิดเห็นที่ 3
ถ้าข้อมูลทุกอย่างแสดง ยกเว้นยอดเงินคืน ที่เป็นไปได้
ก็น่าจะเป็นชื่อฟิลด์ผิดหรือปาว ข้อมูลในฐานข้อมูลมีจริงไหม หรือเป็นค่าว่าง
แนวทางตรวจสอบคร่าวๆ ก็น่าจะประมาณนี้ นอกนั้นต้องไล่ดูเอง 


ninenik 122.155.43.xxx 10-03-2016
1






เว็บไซต์ของเราให้บริการเนื้อหาบทความสำหรับนักพัฒนา โดยพึ่งพารายได้เล็กน้อยจากการแสดงโฆษณา โปรดสนับสนุนเว็บไซต์ของเราด้วยการปิดการใช้งานตัวปิดกั้นโฆษณา (Disable Ads Blocker) ขอบคุณครับ