DB Error (warning and fatal error)


#1

Warning: mysqli_query() expects at least 2 parameters, 1 given in /storage/ssd5/701/4147701/public_html/novidades.php on line 11

Fatal error: Uncaught Error: Call to undefined function mysql_error() in /storage/ssd5/701/4147701/public_html/novidades.php:11 Stack trace: #0 {main} thrown in /storage/ssd5/701/4147701/public_html/novidades.php on line 11

Does anyone help me solve this error?

<?php
$user="id4132775_tops";
$password="vitor";
$database="id4132775_testando";
$hostname="localhost";

$conexao = mysqli_connect($hostname,$user,$password,$database);
// cria a instrução SQL que vai selecionar os dados
$query = sprintf("SELECT autor, data, texto FROM publica");
// executa a query
$dados = mysqli_query($query,$conexao) or die(mysql_error());
// transforma os dados em um array
$linha = mysqli_fetch_assoc($dados);
// calcula quantos dados retornaram
$total = mysqli_num_rows($dados);
?>

<html>
	<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>Home </title>
<link href="novidades/estilo.css" rel="stylesheet" media="screen and (min-width: 1200px)" type="text/css" />
  <link href="novidades/tablet.css" rel="stylesheet" media="screen and (min-width: 741px)and (max-width: 1199px)" type="text/css" />
  <link href="novidades/smartphone.css" rel="stylesheet" media="screen and (min-width: 250px)and (max-width: 740px)" type="text/css" />
  <link rel="stylesheet" href="assets1/web/assets/mobirise-icons-bold/mobirise-icons-bold.css">
  <link rel="stylesheet" href="assets1/web/assets/mobirise-icons/mobirise-icons.css">
  <link rel="stylesheet" href="assets1/tether/tether.min.css">
  <link rel="stylesheet" href="assets1/bootstrap/css/bootstrap.min.css">
  <link rel="stylesheet" href="assets1/bootstrap/css/bootstrap-grid.min.css">
  <link rel="stylesheet" href="assets1/bootstrap/css/bootstrap-reboot.min.css">
  <link rel="stylesheet" href="assets1/dropdown/css/style.css">
  <link rel="stylesheet" href="assets1/socicon/css/styles.css">
  <link rel="stylesheet" href="assets1/theme/css/style.css">
  <link rel="stylesheet" href="assets1/mobirise/css/mbr-additional.css" type="text/css">
	</head>
<body>
 <section class="menu cid-qF6wBSkn27" once="menu" id="menu1-p" data-rv-view="729">

    

    <nav class="navbar navbar-expand beta-menu navbar-dropdown align-items-center navbar-fixed-top navbar-toggleable-sm">
        <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
            <div class="hamburger">
                <span></span>
                <span></span>
                <span></span>
                <span></span>
            </div>
        </button>
        <div class="menu-logo">
            <div class="navbar-brand">
                <span class="navbar-logo">
                    <a href="index.html">
                         <img src="assets1/images/nova-imagem-1514x1394.jpg" alt="Mobirise" title="" media-simple="true" style="height: 3.8rem;">
                    </a>
                </span>
                <span class="navbar-caption-wrap"><a class="navbar-caption text-white display-4" href="index.html">I.B.R. TREMEMBÉ</a></span>
            </div>
        </div>
        <div class="collapse navbar-collapse" id="navbarSupportedContent">
            <ul class="navbar-nav nav-dropdown" data-app-modern-menu="true"><li class="nav-item">
                    <a class="nav-link link text-white display-4" href="index.html">
                        <span class="mbri-home mbr-iconfont mbr-iconfont-btn"></span>Entrada</a>
                </li>
                <li class="nav-item dropdown open">
                    <a class="nav-link link text-white dropdown-toggle display-4" href="sobre.html" data-toggle="dropdown-submenu" aria-expanded="true"><span class="mbri-search mbr-iconfont mbr-iconfont-btn"></span>Sobre Nós</a><div class="dropdown-menu">
						<a class="text-white dropdown-item display-4" href="sobre.html">Sobre Nós</a>
						<a class="text-white dropdown-item display-4" href="pastores.html">Pastores</a>
						<a class="text-white dropdown-item display-4" href="ministerios.html" aria-expanded="false">Ministérios</a></div>
                </li>
				<li class="nav-item"><a class="nav-link link text-white display-4" href="novidades.php"><span class="mbrib-sites mbr-iconfont mbr-iconfont-btn"></span>
                        Novidades</a></li>
			</ul>
            <div class="navbar-buttons mbr-section-btn"><a class="btn btn-sm btn-white display-4" href="login.html"><span class="mbrib-login mbr-iconfont mbr-iconfont-btn" style="color: rgb(139, 0, 0);"></span>
                    </a></div>
        </div>
    </nav>
</section>
<?php
	// se o número de resultados for maior que zero, mostra os dados
	if($total > 0) {
		// inicia o loop que vai mostrar todos os dados
		do {
?><br><br>
			<p class="irineu"><?=$linha['autor']?> -

			<?=$linha['data']?></p>
			<div align="center">
<p class="irineuu" >
			<?=$linha['texto']?></p>
			<br><br><br><br><br><br><br><br><br><br>
			</div>			
<br><br><br><br><br><br>

			</div>	

<?php
		// finaliza o loop que vai mostrar os dados
		}while($linha = mysqli_fetch_assoc($dados));
	// fim do if 
	}
?>
<section class="engine"><a href="https://mobirise.co/l">bootstrap theme</a></section><section class="cid-qF6Zmdrbtd" id="footer1-t" data-rv-view="731">
    
    

    <div class="container">

        <div class="media-container-row content text-white">
            <div class="col-12 col-md-3">
                <div class="media-wrap">
                    <a href="https://mobirise.com/">
                        <img src="assets1/images/nova-imagem-1514x1394.jpg" alt="Mobirise" title="" media-simple="true">
                    </a>
                </div>
            </div>
      <div class="col-12 col-md-3 mbr-fonts-style display-7">
                <h5 class="pb-3">Endereço</h5>
                <p class="mbr-text">Rua Sena, 213 - J.d. Tremembé<br>São Paulo, SP</p>
            </div>
            <div class="col-12 col-md-3 mbr-fonts-style display-7">
                <h5 class="pb-3">&nbsp; &nbsp; &nbsp; Contato &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br></h5>
                <p class="mbr-text">&nbsp; &nbsp; &nbsp; &nbsp;Email: ibr.contato@gmail.com<br>&nbsp; &nbsp; &nbsp; &nbsp;Telefone: (11) 2262-3078<br>&nbsp; &nbsp; &nbsp; &nbsp;WhatsApp: (11) 96501-5136<br></p>
            </div>
          
            
        </div>
        <div class="footer-lower">
            <div class="media-container-row">
                <div class="col-sm-12">
                    <hr>
                </div>
            </div>
            <div class="media-container-row mbr-white">
                <div class="col-sm-6 copyright">
                    <p class="mbr-text mbr-fonts-style display-7">© Copyright 2017 SmartDesign - All Rights Reserved</p>
                </div>
                <div class="col-md-6">
                    <div class="social-list align-right">
                        <div class="soc-item">
                            <a href="https://twitter.com/mobirise" target="_blank">
                                <span class="socicon-twitter socicon mbr-iconfont mbr-iconfont-social" media-simple="true"></span>
                            </a>
                        </div>
                        <div class="soc-item">
                            <a href="https://www.facebook.com/pages/Mobirise/1616226671953247" target="_blank">
                                <span class="socicon-facebook socicon mbr-iconfont mbr-iconfont-social" media-simple="true"></span>
                            </a>
                        </div>
                        <div class="soc-item">
                            <a href="https://www.youtube.com/c/mobirise" target="_blank">
                                <span class="socicon-youtube socicon mbr-iconfont mbr-iconfont-social" media-simple="true"></span>
                            </a>
                        </div>
                        <div class="soc-item">
                            <a href="https://instagram.com/mobirise" target="_blank">
                                <span class="socicon-instagram socicon mbr-iconfont mbr-iconfont-social" media-simple="true"></span>
                            </a>
                        </div>
                        <div class="soc-item">
                            <a href="https://plus.google.com/u/0/+Mobirise" target="_blank">
                                <span class="mbr-iconfont mbr-iconfont-social socicon-deezer socicon" media-simple="true"></span>
                            </a>
                        </div>
                        
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>


  <script src="assets1/web/assets/jquery/jquery.min.js"></script>
  <script src="assets1/popper/popper.min.js"></script>
  <script src="assets1/tether/tether.min.js"></script>
  <script src="assets1/bootstrap/js/bootstrap.min.js"></script>
  <script src="assets1/dropdown/js/script.min.js"></script>
  <script src="assets1/touchswipe/jquery.touch-swipe.min.js"></script>
  <script src="assets1/smoothscroll/smooth-scroll.js"></script>
  <script src="assets1/theme/js/script.js"></script>
  
</body>
</html>
<?php
// tira o resultado da busca da memória
mysqli_free_result($dados);
?>

#2

You cannot use mysql and mysqli, and cannot invert the order connection/query
This

$dados = mysqli_query($query,$conexao) or die(mysql_error());

Should be

$dados = mysqli_query($conexao, $query) or die(mysqli_error($conexao));