|
 |
|
สอบถามปัญหาทำไมข้อมูลที่เรียกจาก mysql db ไม่มาที่ textbox ต้องแก้ไขตรงไหนครับ |
|
 |
|
|
 |
 |
|
เอา code ใส่ tag จะดีมากครับ ปัญหาที่เจอคือ ทำไม่ถูกวิธีนะครับ ลองดูจากข้างล่าง ถ้าไม่ได้ เอาไปปรับต่อนะ ผมไม่ได้เทสให้
Code (PHP)
<form action="Testformx.php" target="iframe_target" method="post" target="_blank">
<label for="fname">รหัสลูกค้า :</label>
<input type="text" id="fname" name="vardata"><br><br>
<input type="submit" value="Submit">
</form>
<?php
header("Content-type:text/html; charset=UTF-8");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
include 'Dbconnect.php';
$sql = "SELECT * FROM Cust where CustID = '".$_POST["vardata"]."' limit 1";
$result = mysqli_query($conn, $sql);
$objResult = mysqli_fetch_assoc($objQuery);
?>
<input type="text" name="b[]" value="<?=$objResult[Price];?>">
|
ประวัติการแก้ไข 2022-03-25 16:54:37
 |
 |
 |
 |
Date :
2022-03-25 16:53:41 |
By :
mongkon.k |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณครับที่ให้คำแนะนำ แต่ลองเอา code ไปทดสอบแล้วครับก็ยังใช้ไม่ได้ครับ พอจะมีใครแนะนำอีกไหมครับ
|
 |
 |
 |
 |
Date :
2022-03-26 07:59:26 |
By :
์Newphp2565 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
มันไม่มี Error ครับ แต่มันไม่มีข้อมูลมาแสดงที่ Input ครับ
|
 |
 |
 |
 |
Date :
2022-03-27 07:56:12 |
By :
์Newphp2565 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ผมลองใหม่แล้วครับ แก้การรับค่าก็ได้แล้วครับ ขอบคุณมากครับที่ช่วยมือใหม่เพิ่งเริ่มครับ
<form action="Testformx.php" target="iframe_target" method="post" target="iframe_target">
<label for="fname">รหัสลูกค้า :</label>
<input type="text" id="fname" name="vardata"><br><br>
<input type="submit" value="Submit">
</form>
<?php
header("Content-type:text/html; charset=UTF-8");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
include 'Dbconnect.php';
$sql = "SELECT * FROM Cust where CustID = '{$_POST["vardata"]}' ";
$result = mysqli_query($conn, $sql);
//$objResult = mysql_fetch_array($objQuery);
while( $f = mysqli_fetch_assoc( $result )) {
echo $f['CustID']." / ".$f['Custname']." / ".$f['Price']."<br/>";
$pricex = $f['Price'];
}
// mysqli_close( $mysqli );
?>
<th><input type="text" name="x1" id="x1" value="<?php echo $pricex ?>"/></th>
|
 |
 |
 |
 |
Date :
2022-03-27 15:03:11 |
By :
์Newphp2565 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 03
|