Jump to content

MySQLi error


Go to solution Solved by Muddy_Funster,

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.