Jump to content

Searching data form database, But something Wrong..Please Help me :(


gcxlovexxx

Recommended Posts

The problem is :
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in C:xampphtdocstestinsertsearch.php on line 12
This is my code
search.php
<?php
$con=mysqli_connect("localhost",'root',"","projectt");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con,"SELECT * FROM order
WHERE orderCode= '$_POST[firstname]'");
while($row = mysqli_fetch_array($result))
{
echo $row['orderCode'] . " " . $row['orderCode'];
echo "<br>";
}
?>
this is trysearch.php
<html>
<body>
<form action="search.php" method="post" enctype="multipart/form-data">
Firstname: <input type="text" name="firstname">
<input type="submit">
</form>
</body>
</html>
thx for help :)

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...