Documente Academic
Documente Profesional
Documente Cultură
ITPro.ir
Mysql PHP
Alighalehban 14 12:24:53 1394
mysql
,
. ,
HTML
index.html
><html
><body
>"<form action="verify.php" method="post
><p>Your age: <input type="text" name="id" /></p
><p><input type="submit" /></p
></form
></body
></html
POSt
. verify.php
<?php
;]'$id=(int)$_POST['id
;"$servername = "your server normally localhost
;"$username = "database username
;"$password = "password
;"$dbname = "database name
// Create connection
;)$conn = new mysqli($servername, $username, $password, $dbname
// Check connection
{ )if ($conn->connect_error
;)die("Connection failed: " . $conn->connect_error
}
https://itpro.ir/core/functions/printversion?id=n1EtNMrBgOGTqkK2akAdOfyIVLX9UoujhmTRFoRj4%2FeNolJoiiifyfCI57il4%2BFbOK8Uyw%3D%3D 1/2
7/30/2017 :: Mysql PHP
if ($result->num_rows > 0) {
echo "<table border=1><tr><th>name</th><th>family</th><th>id</th></tr>";
// output data of each row
while($row = $result->fetch_assoc()) {
echo "<tr><td>".$row["name"]."</td><td>".$row["family"]." ".$row["id"]."</td></tr>";
}
echo "</table>";
} else {
echo "0 results";
}
$conn->close();
?>
Select
.
- :
https://itpro.ir/core/functions/printversion?id=n1EtNMrBgOGTqkK2akAdOfyIVLX9UoujhmTRFoRj4%2FeNolJoiiifyfCI57il4%2BFbOK8Uyw%3D%3D 2/2