magcr23 Posted June 17, 2015 Share Posted June 17, 2015 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? Quote Link to comment https://forums.phpfreaks.com/topic/296875-mysqli-error/ Share on other sites More sharing options...
Solution Muddy_Funster Posted June 17, 2015 Solution Share Posted June 17, 2015 do either of your included files have any mysqli calls in them? Quote Link to comment https://forums.phpfreaks.com/topic/296875-mysqli-error/#findComment-1514161 Share on other sites More sharing options...
magcr23 Posted June 17, 2015 Author Share Posted June 17, 2015 do either of your included files have any mysqli calls in them? yeah 1 of them had, thx for the help it's fixed Quote Link to comment https://forums.phpfreaks.com/topic/296875-mysqli-error/#findComment-1514163 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.