Jump to content

MySQLi error


magcr23

Recommended Posts

Hi guys, 

 

I have a page with this code: 

<?php require "verificauser.php"; ?>
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>SB Admin - Bootstrap Admin Template</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/sb-admin.css" rel="stylesheet">
<link href="css/plugins/morris.css" rel="stylesheet">
<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
</head>

<body>
<div id="wrapper">
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">		
<?php
$con=mysqli_connect("localhost","root","6794","website");
// Check connection
if (mysqli_connect_errno()){
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
?>
	
<?php
include("menuLateral.php");
include("menuTop.php");
?>
</nav>	
			
<div id="page-wrapper">
<div class="container-fluid">
	
<div class="row">
<div class="col-lg-12">
<div class="alert alert-info alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
Lista de Artesões
</div>
</div>
</div>
<div class="row">
<?php
$mostra= "SELECT * FROM artesoes";
mysqli_query($con, $mostra);
?>
</div>

<?php
	mysqli_close($con);
?>
</body>

</html>

and it gives me an error: Warning: mysqli_query(): Couldn't fetch mysqli in C:\Users\TheMagcr23\Documents\usb\root\admin\artesoes.php on line 66

 

how can i fix that? someone can help me?

Link to comment
https://forums.phpfreaks.com/topic/296875-mysqli-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.