Llaverola Posted December 4, 2007 at 12:07 AM Report Share #152144 Posted December 4, 2007 at 12:07 AM ja conseigo fazer as querys correctamente clicando num botão.. por exemplo: codigo para imprimir notas dum determinado aluno q faz o login: <?php $aluno_id = $_SESSION['numero']; ?> <?php echo '<table>'; $pesquisa="select nome, valor from nota,disciplina where aluno_id=$aluno_id and nota.disciplina_id=disciplina.disciplina_id"; $resultado=mysql_query($pesquisa) or die(mysql_error()); while($reg=mysql_fetch_array($resultado)) { echo '<tr><td>' . $reg['nome'] . '</td><td>'. $reg['valor'] .'</td></tr>'; } echo '</table>'; este codigo n me imprime tabela nenhuma com linhas e assim e é o k eu quero. so imprime os valores. HELP ME 😉 Link to comment Share on other sites More sharing options...
djthyrax Posted December 4, 2007 at 01:05 AM Report Share #152157 Posted December 4, 2007 at 01:05 AM Não percebi. O que é que isso não faz e devia fazer? Não peças ajuda por PM! A tua dúvida vai ter menos atenção do que se for postada na secção correcta do fórum! Link to comment Share on other sites More sharing options...
Llaverola Posted December 4, 2007 at 01:08 AM Author Report Share #152159 Posted December 4, 2007 at 01:08 AM isto devia imprimir linhas da tabela mas n imprime. o k eu kero é criar uma tabela qd imprimo os dados da base de dados entendes? Link to comment Share on other sites More sharing options...
djthyrax Posted December 4, 2007 at 01:09 AM Report Share #152160 Posted December 4, 2007 at 01:09 AM Imprime os dados mas não ficam com as linhas da tabela? É isso? Não peças ajuda por PM! A tua dúvida vai ter menos atenção do que se for postada na secção correcta do fórum! Link to comment Share on other sites More sharing options...
Llaverola Posted December 4, 2007 at 01:11 AM Author Report Share #152161 Posted December 4, 2007 at 01:11 AM isso mesmo. olha adiciona-me no msn sim? ricardocoelho81@portugalmail.pt Link to comment Share on other sites More sharing options...
Llaverola Posted December 4, 2007 at 01:29 AM Author Report Share #152164 Posted December 4, 2007 at 01:29 AM e entao, ajudas-me? Link to comment Share on other sites More sharing options...
zero-cool Posted December 4, 2007 at 01:33 PM Report Share #152203 Posted December 4, 2007 at 01:33 PM $link = mysql_connect('mysql_host', 'mysql_user', 'mysql_password') or die('Não foi possível conectar: ' . mysql_error()); echo 'Conexão bem sucedida'; mysql_select_db('my_database') or die('Não foi possível selecionar o banco da dados'); Falta a abertura da base de dados. Dá uma vista de olhos aqui (exemplos). Abraço, Link to comment Share on other sites More sharing options...
Llaverola Posted December 4, 2007 at 02:00 PM Author Report Share #152206 Posted December 4, 2007 at 02:00 PM nao isso ja faz acredita, pq antes d ir pa esse ficheiro eu chamo outro, q dentro dele ta o include deste. mas pronto, kero é so saber como criar tabelas como as do word em php????????? Link to comment Share on other sites More sharing options...
joxnas Posted December 4, 2007 at 05:03 PM Report Share #152251 Posted December 4, 2007 at 05:03 PM n tens as bordas das tabelas defenidas para branco pois não?? ... just in case.. Link to comment Share on other sites More sharing options...
NCS_One Posted December 4, 2007 at 05:11 PM Report Share #152255 Posted December 4, 2007 at 05:11 PM Ois E k tal isto : echo '<table border="1">'; Se a vida te voltar as costas aproveita e apalpa-lhe o cu. Link to comment Share on other sites More sharing options...
djthyrax Posted December 4, 2007 at 05:15 PM Report Share #152259 Posted December 4, 2007 at 05:15 PM isso mesmo. olha adiciona-me no msn sim? ricardocoelho81@portugalmail.pt O fórum serve para isso mesmo. A soluçao é a do NCS_One. Não peças ajuda por PM! A tua dúvida vai ter menos atenção do que se for postada na secção correcta do fórum! Link to comment Share on other sites More sharing options...
Llaverola Posted December 4, 2007 at 10:22 PM Author Report Share #152354 Posted December 4, 2007 at 10:22 PM NESTE MOMENTO TENHO ESTA TABELA: <?php $aluno_id = $_SESSION['numero']; ?> <?php //echo '<table>'; $pesquisa="select nome, valor from nota,disciplina where aluno_id=$aluno_id and nota.disciplina_id=disciplina.disciplina_id"; $resultado=mysql_query($pesquisa) or die(mysql_error()); if ($resultado){ print("<table width=80% align=left border=4 top:10em text-align=center>"); print("<tr bgcolor=\"000000\"> <td><h3>Disciplina</h5></td > <td><h3>Nota</h3></td> </tr>"); while($reg=mysql_fetch_array($resultado)){ $nomeA=$reg["nome"]; $nomeD=$reg["valor"]; print("<td><align=center></td> <tr> <td>$nomeA</td> <td>$nomeD</td> </tr>"); } print("</table>"); } a tabela até é engraçada, mas o texto q imprimo na tabela quero alinha-lo ao centro e n consigo. alem disso, como por a tabela mais abaixo ou seja por prai 15 em do topo. Link to comment Share on other sites More sharing options...
djthyrax Posted December 5, 2007 at 02:11 PM Report Share #152441 Posted December 5, 2007 at 02:11 PM <?php $aluno_id = $_SESSION['numero']; $pesquisa="select nome, valor from nota,disciplina where aluno_id=$aluno_id and nota.disciplina_id=disciplina.disciplina_id"; $resultado=mysql_query($pesquisa) or die(mysql_error()); if ($resultado){ echo '<table width=80% align=left border=4 style="top:10em; text-align=center">'; echo '<tr bgcolor="000000"> <td><h3>Disciplina</h5></td > <td><h3>Nota</h3></td> </tr>'; while($reg=mysql_fetch_array($resultado)){ $nomeA=$reg["nome"]; $nomeD=$reg["valor"]; echo "<tr> <td style='text-align:center;'>$nomeA</td> <td style='text-align:center;'>$nomeD</td> </tr>"; } echo '</table>'; } alem disso, como por a tabela mais abaixo ou seja por prai 15 em do topo. Não percebi. Não peças ajuda por PM! A tua dúvida vai ter menos atenção do que se for postada na secção correcta do fórum! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now