Php 我只从数据库中提取一列。非常感谢你帮助我!什么也没发生。没有错误,但字段未填充either@SukritJaie您需要JS使其自动弹出。请尝试$result=$conn->query($sql)或die($mysqli->error)我的个人偏好mysql
Php 我只从数据库中提取一列。非常感谢你帮助我!什么也没发生。没有错误,但字段未填充either@SukritJaie您需要JS使其自动弹出。请尝试$result=$conn->query($sql)或die($mysqli->error)我的个人偏好mysql,php,html,mysql,Php,Html,Mysql,我只从数据库中提取一列。非常感谢你帮助我!什么也没发生。没有错误,但字段未填充either@SukritJaie您需要JS使其自动弹出。请尝试$result=$conn->query($sql)或die($mysqli->error)我的个人偏好mysqli_查询($conn,$sql)到$conn->query($sql)如果错误仍然存在,我将在vps上设置子域并尝试帮助您。:)这会激怒我,因为我的数据库表有多个列。所以我也考虑过使用JS,但是onchange事件只会从数据库中提取一列。非常感
我只从数据库中提取一列。非常感谢你帮助我!什么也没发生。没有错误,但字段未填充either@SukritJaie您需要JS使其自动弹出。请尝试
$result=$conn->query($sql)或die($mysqli->error)代码>我的个人偏好mysqli_查询($conn,$sql)代码>到$conn->query($sql)代码>如果错误仍然存在,我将在vps上设置子域并尝试帮助您。:)这会激怒我,因为我的数据库表有多个列。所以我也考虑过使用JS,但是onchange事件只会从数据库中提取一列。非常感谢你帮助我!
<!doctype html>
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "db_dealer_track";
$conn = new mysqli($servername, $username, $password, $dbname);
if($conn->connect_error){
die("Connection failed". $conn->connect_error);
}
if(isset($_POST['id1'])){
$sql = "SELECT * FROM tbl_dealer_info ";
$sql .= "WHERE $account_name = 'account_name' ";
$result = mysqli_query($conn, $sql);
while($row = mysqli_fetch_array($result)){
?>
<html>
<head>
<title>iMobile </title>
</head>
<body bgcolor = "#D6DFE3">
<center><b><h2>Please enter the following information: </h2></b></center>
<form action = "dealer_track.php" method = "post">
<strong><center> <u>Fields marked with an asterisk(*) are required.</u><br><br>
Name of the dealer:* // This is where the admin selects the user they would like to update
<?php
$sql = "SELECT account_name FROM tbl_dealer_info ";
$result = mysqli_query($conn, $sql);
echo "<select name = 'account_name' id = 'id'>";
echo "<option value = ''>";
while($row = mysqli_fetch_array($result)){
echo "<option value = '" .$row['account_name'] . "'>" . $row['account_name'] . "</option>";
}
echo "</select>";
?>
<br><br>
<input type = submit id = "id1" name = "id1" value = "Display the fields" /><br>
</center>
<hr>
<br><br>
</form>
<form action = "dealer_track.php" method = "post">
Email:*<br>
<input type = "email" name = "email" id = "id3" value = "<?php echo $row['email']?>" Required /><br><br>
RSM:*<br>
<?php
$sql = "SELECT rsm_val FROM tbl_rsm_drop_down ";
$result = mysqli_query($conn, $sql);
echo "<select name = 'rsm_val'>";
echo "<option value = ''></option>";
while($row = mysqli_fetch_array($result)){
echo "<option value = '" .$row['rsm_val'] . "'>" . $row['rsm_val'] . "</option>";
}
echo "</select>";
?>
<br><br>
**// My radio buttons aren't getting checked though**
iPhone Boost Approved:
<input type = "radio" name = "boost_app" <?php if(isset($boost_app)&& $boost_app =="Yes")?> value = "Yes" />Yes
<input type = "radio" name = "boost_app" <?php if(isset($boost_app)&& $boost_app =="No")?> value = "No" />No<br><br>
</form>
<?php
}} // While loop and if loop at the start
?>
</body>
</html>
$sqlQuery = "SELECT id, firstname, lastname FROM Table Where id = '$id'";
$result = $connection->query($sqlQuery ); //nb: $connection is your connection variable
if ($result->num_rows > 0) { ........ }
while($row = $result->fetch_assoc()) {
$firstname = $row["firstname"];
$lastname = $row["lastname"];
//and so on....
}
// You can display these variables any how you want in here, eg:
echo "<h2>$firstname</h2>";
<input type="text" id="firstname" name="firstname" value="<?php echo $firstname ?>" />
//nb: you must close the php tag before using html and re open it after
<?php
if(isset($_POST['formnamehere'])) {
$sql = "SELECT * FROM (table name) WHERE accountname=" . $accountname;
$result = $conn->query($sql);
$row = $result->fetch_assoc();
echo $row['accountname'];
//put other things here, etc.
}
?>