0

I want to fetch single data in form by using PHP. Here is my code written in html file to fetch single data in form by using php

<form action="fetch.php" method="post">
    <label for="namm">Name</label>;
    <input type="text" id="namm" name="aa" value="<?php echo $row['namme']; ?>"><br>
    <label for="pasa">Password</label>
    <input type="password" id="pasa" name="aaa" value="<?php echo $row['paso']; ?>"><br>
</form>

And the php code written in php file are as

<?php
$con=mysqli_connect("localhost","root","","dela");
if(!$con)
{
    die("could not connect".mysqli_connect_error());
}
$sql="SELECT * FROM reco WHERE namme ='advik'";
mysqli_query($con, $sql);
mysqli_close($con);
?>
Dharman
  • 30,962
  • 25
  • 85
  • 135
Sam
  • 1
  • 2
  • Welcome to SO. Are you actually using Laravel? – Rwd Mar 20 '22 at 17:29
  • You're not actually returning the data that you're getting, all you're doing is executing it against the database. You need to do something like $result = $mysqli_query(""), $result->num_rows, for instance. I'd recommend having a look at using [pdo](https://phpdelusions.net/pdo) too. – Laim Mar 20 '22 at 17:35
  • You are not using Laravel so that tag was wrong – Dharman Mar 20 '22 at 19:40

0 Answers0