Good morning. I have that question, I have two tables, with 2 matches each, and I want to show on the same page the 4 matches that are in the different tables of the database. I use this to show my database:
$sql="SELECT * from dpartidos";
$result=mysqli_query($conexion,$sql);
while($mostrar=mysqli_fetch_array($result)){
// Lo muestro con un echo y la variable $mostrar['partido1']
And the other two games that I want to show are in a table called "dpartidos2", and they have the same name: "partido3" and "partido4"
And with this example:
$sql="SELECT partido1, partido2
FROM dpartidos
UNION
SELECT partido3, partido4
FROM dpartidos2 ";
$result=mysqli_query($conexion,$sql);
while($mostrar=mysqli_fetch_array($result)){
if ($quediaes=="Wed" && 0 <= $hora && $hora <= 10) {
echo '<h3>No hay ningun partido en este momento</h3>';
}
else if ($quediaes=="Wed" && 11 <= $hora && $hora <= 12) {
echo '<h3>Estás mirando: ' . $mostrar['partido1'] . '</h3>';
}
else if ($quediaes=="Wed" && 13 <= $hora && $hora <= 14) {
echo '<h3>A continuacion: ' . $mostrar['partido1'] . '</h3>';
}
else if ($quediaes=="Wed" && 15 <= $hora && $hora <= 17 ) {
echo '<h3>Estás mirando: ' . $mostrar['partido3'] . '</h3>';
}
else if ($quediaes=="Wed" && 16 <= $hora && $hora <= 23) {
echo '<h3>No hay ningun partido en este momento</h3>';
}
}
He does not play me and he puts me twice "You're watching"