Como colocar o echo de uma query lado a lado
Pessoal boa tarde, estou com um problema desde o periodo da manha e sinceramente nao encontro uma forma de fazer com array.
Preciso pegar 4 informacoes no banco de dados mysql, a consulta retorna corretamente mas nao consigo pegar as variaveis e armazenar nas variaveis, vou usar para abrir 4 video aulas na tela principal do aluno, utilizando uma mini imagem para o aluno clicar e ir para o video selecionado
Por favor alguem pode me ajudar a carregar estas 4 informacoes ( caminho e imagem), agradeço.
Gostaria se possivel "ir" apenas 1 vez no fonte abaixo e ja pegar as 4 variaveis ou um loop mas que "anda-se" de lado na tela.
A rotina abaixo e chamada pelo index, preciso que 4 videos apareçam um ao lado do outro em cada linha ok, mas nao sei fazer isso. Por isso pensei em uma array mostrando em uma tabela lado a lado ou 4 variaveis diferentes na mesma situacao seguem os fontes.
divulgar_video.php
<?php
// fazendo uma conexão com o banco de dados
include("conexao.php");
//pesquisa
$resultado_videos = $arquivo->query("SELECT id, caminho, imagem FROM videos ORDER BY id DESC LIMIT 5");
if (false === $resultado_videos) {
echo mysqli_error();
}
$linha=mysqli_fetch_array($resultado_videos);
if (false === $resultado_videos) {
echo mysqli_error();
}
mysqli_close($arquivo);
?>
index.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="icon" type="image/png" href="Novas_imagens/bolha_icone.png" />
<style type="text/css">
</style>
<?php
session_start();
include("topo1.php")?>
<link rel="sortcut icon" href="favicon.ico" type="image/x-icon" />
<style type="text/css"><!--
.style2 {
font-size: large;
font-weight: bold;
}
#Layer_dvulgacao_imagem_2 {
position:absolute;
width:1100px;
height:115px;
z-index:1;
left: 0px;
top: 500px;
}
#Layer_divulgacao_novidades {
position:absolute;
width:1200px;
height:300px;
z-index:2;
left: 0px;
top: 110px;
}
#Layer_divulgacao_video {
position:absolute;
width:899px;
height:500px;
z-index:2;
left: 0px;
top: 250px;
}
#Layer_quero_me_cadastrar {
position:absolute;
width:200px;
height:47px;
z-index:3;
left: 0px;
top: 150px;
}
#Layer_divulgacao_legenda_aula_1{
position:absolute;
width:289px;
height:500px;
z-index:2;
left: 900px;
top: 250px;
border:solid;
text-wrap:normal;
word-wrap:normal
}
#videos_novidades{
position:absolute;
width:300px;
height2300px;
z-index:2;
left: 0px;
top: 250px;
border:border:2px solid black;
text-wrap:normal;
word-wrap:normal;
color:#F96;
width: auto;
height: auto
}
#videos_novidades_coluna_2{
position:absolute;
width:300px;
height:200px;
z-index:2;
left: 300px;
top: 250px;
border:border:2px solid black;
text-wrap:normal;
word-wrap:normal;
color:#F96;
width: auto;
height: auto
}
#videos_novidades_coluna_3{
position:absolute;
width:300px;
height:200px;
z-index:2;
left: 600px;
top: 250px;
border:border:2px solid black;
text-wrap:normal;
word-wrap:normal;
width: auto;
height: auto;
color:#F96
}
#videos_novidades_coluna_4{
position:absolute;
width:300px;
height:200px;
z-index:2;
left: 900px;
top: 250px;
border:border:2px solid black;
text-wrap:normal;
word-wrap:normal;
width: auto;
height: auto;
color:#F96
}
</style>
</head>
<body vlink="#6633CC" style='margin:0'>
<div style='position:absolute;width:8.-1863in;height:7.2239in'>
<!--[if gte vml 1]><v:rect id="_x0000_s1025" style='position:absolute;left:123pt;
top:63pt;width:386.24pt;height:220.53pt;z-index:1;mso-wrap-distance-left:2.88pt;
mso-wrap-distance-top:2.88pt;mso-wrap-distance-right:2.88pt;
mso-wrap-distance-bottom:2.88pt' o:preferrelative="t" filled="f" fillcolor="white [7]"
stroked="f" strokecolor="black [0]" o:cliptowrap="t">
<v:fill color2="white [7]"/>
<v:stroke color2="white [7]">
<o:left v:ext="view" color="black [0]" color2="white [7]" joinstyle="miter"/>
<o:top v:ext="view" color="black [0]" color2="white [7]" joinstyle="miter"/>
<o:right v:ext="view" color="black [0]" color2="white [7]" joinstyle="miter"/>
<o:bottom v:ext="view" color="black [0]" color2="white [7]" joinstyle="miter"/>
<o:column v:ext="view" color="black [0]" color2="white [7]"/>
</v:stroke>
<v:imagedata src="index_arquivos/image302.jpg" o:title="simbolos matematicos 2"/>
<v:shadow color="#ccc [4]"/>
<v:path o:extrusionok="f" insetpenok="f"/>
<o:lock v:ext="edit" aspectratio="t"/>
</v:rect><![endif]--><![if !vml]><![endif]><!--[if gte vml 1]><v:shapetype
id="_x0000_t202" coordsize="21600,21600" o:spt="202" path="m,l,21600r21600,l21600,xe">
<v:stroke joinstyle="miter"/>
<v:path gradientshapeok="t" o:connecttype="rect"/>
</v:shapetype><v:shape id="_x0000_s1026" type="#_x0000_t202" style='position:absolute;
left:123pt;top:18pt;width:387pt;height:36.18pt;z-index:2;
mso-wrap-distance-left:2.88pt;mso-wrap-distance-top:2.88pt;
mso-wrap-distance-right:2.88pt;mso-wrap-distance-bottom:2.88pt' filled="f"
fillcolor="white [7]" stroked="f" strokecolor="black [0]" o:cliptowrap="t">
<v:fill color2="white [7]"/>
<v:stroke color2="white [7]">
<o:left v:ext="view" color="black [0]" color2="white [7]"/>
<o:top v:ext="view" color="black [0]" color2="white [7]"/>
<o:right v:ext="view" color="black [0]" color2="white [7]"/>
<o:bottom v:ext="view" color="black [0]" color2="white [7]"/>
<o:column v:ext="view" color="black [0]" color2="white [7]"/>
</v:stroke>
<v:shadow color="#ccc [4]"/>
<v:path insetpenok="f"/>
<v:textbox style='mso-column-margin:2mm' inset="2.88pt,2.88pt,2.88pt,2.88pt"/>
</v:shape><![endif]--><![if !vml]><span style='position:absolute;z-index:2;left:10px;top:22px;width:516px;height:78px'>
</span><![endif]><!--[if gte vml 1]><v:shape id="_x0000_s1048" type="#_x0000_t202"
style='position:absolute;left:123pt;top:294pt;width:387pt;height:225pt;
z-index:5;mso-wrap-distance-left:2.88pt;mso-wrap-distance-top:2.88pt;
mso-wrap-distance-right:2.88pt;mso-wrap-distance-bottom:2.88pt' filled="f"
fillcolor="white [7]" stroked="f" strokecolor="black [0]" o:cliptowrap="t">
<v:fill color2="white [7]"/>
<v:stroke color2="white [7]">
<o:left v:ext="view" color="black [0]" color2="white [7]"/>
<o:top v:ext="view" color="black [0]" color2="white [7]"/>
<o:right v:ext="view" color="black [0]" color2="white [7]"/>
<o:bottom v:ext="view" color="black [0]" color2="white [7]"/>
<o:column v:ext="view" color="black [0]" color2="white [7]"/>
</v:stroke>
<v:shadow color="#ccc [4]"/>
<v:path insetpenok="f"/>
<v:textbox style='mso-column-margin:2mm' inset="2.88pt,2.88pt,2.88pt,2.88pt"/>
</v:shape><![endif]--><![if !vml]><![endif]>
</div>
<?php
include("topo_1_menu.php");
?><!--
<div id="Layer_divulgacao_novidades">
<div class="video">
<?php include("divulgar_noticias.php");?>
<iframe align="center" border="1" frameborder="yes" height="300px" id="myIframe"
name="myIframe" scrolling="yes" src="<? echo $caminho_divulgacao_noticias; ?>" width="350px"> </iframe>
</div>
</div>
-->
<div id="videos_novidades">
<div class="video">
<?php include("divulgar_video.php");?>
<iframe align="center" width="300px" height="200px" src="<? echo $linha;?>" <a href="mostrar_video.php<? echo '$'.$linha;?>"> frameborder="yes" scrolling="yes" name="myIframe" id="myIframe" > </iframe>
</div>
</div>
<!--
<div id="Layer_divulgacao_legenda_aula">
<textarea name="textarea" cols="38" rows="33" readonly id="textarea"><? echo $_SESSION['divulgacao_legenda']; ?></textarea>
</div>
-->
<div id="Layer_dvulgacao_imagem_2">
<div id="propaganda">
<table width="1050" border="0">
<tr>
<?php include("divulgar.php");?>
<td width="1000"> </td>
</tr>
</table>
</div>
</div>
<div id="Layer_quero_me_cadastrar">
<table width="1136">
<tr>
<td class="style2">Para receber noticias de novas aulas <a href="receber_noticias.php"><img src="Clique-aqui.jpg" alt="aqui" width="123" height="32" border="0" /></a></td>
</tr>
</table>
</div>
<p>
<!-- BEGIN JIVOSITE CODE {literal} -->
<script type='text/javascript'>
(function(){ var widget_id = 'PU7ft5N3bR';var d=document;var w=window;function l(){
var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = '//code.jivosite.com/script/widget/'+widget_id; var ss = document.getElementsByTagName('script')[0]; ss.parentNode.insertBefore(s, ss);}if(d.readyState=='complete'){l();}else{if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})();</script>
</p>
</body>
</html>

Discussão (0)
Carregando comentários...