I want to connect a database to a PHP page, in another that I have it works well, but it is this I need to connect and show inside the echo. I have this that I use in another page:
<?php
$conexion=mysqli_connect('localhost','user','mypass','mibase');
?>
//Esto lo pongo arriba de la etiqueta <html>
<?php
$sql="SELECT * from dpartidos";
$result=mysqli_query($conexion,$sql);
while($mostrar=mysqli_fetch_array($result)){
?>
// Y para mostralo lo hago así
<li><?php echo $mostrar['dia1'] ?></li>
//Pero necesito ponerlo acá:
//...PHP
if ($quediaes=="Tue" && 11 <= $hora && $hora <= 12 ) {
$sql="SELECT * from dpartidos";
$result=mysqli_query($conexion,$sql);
while($mostrar=mysqli_fetch_array($result)){
echo '<center>
<h3>Ahora EN VIVO:
<a href="#"
onclick="window.open( \'https://paginas.com\', \'_self\');
window.open( \'https://paginas.com\', \'_blank\');" >' . $mostrar['autor'] . '</a>
</h3>
</center>';
else if ($quediaes=="Tue" && 15 <= $hora && $hora <= 16 ) {
echo '<center>
<h3>Ahora EN VIVO:
<a href="#"
onclick="window.open( \'https://www.\', \'_self\');
window.open( \'https://www.\', \'_blank\');" >
UN PARTIDO -
</a>
<a href="#"
onclick="window.open( \'https://www.\', \'_self\');
window.open( \'https://www.\', \'_blank\');" >
UN PARTIDO
</a>
</h3>
</center>';
}
}
echo '</div>';
?>