TS91 Posted March 12, 2009 at 03:44 PM Report Share #250295 Posted March 12, 2009 at 03:44 PM Boas, isto diz que a um erro no ficheiro php mas eu nao consigo identifica-lo , se mepuderem a ajudar obrigado. Codigo: <?PHP$link = mysql_connect("http://127.0.0.1/","root",""); mysql_select_db("tn_bd"); $query = 'SELECT * FROM list_tabelas'; $results = mysql_query($query); echo "<?xml version=\"1.0\"?>\n"; echo "</list_tabelas>\n; while($line = mysql_fetch_assoc($result)){ echo "<nome>".$line["list_tabelas"]."</nome>\n"; } echo "</list_tabelas>\n"; mysql_close($link); ?> Link to comment Share on other sites More sharing options...
scorch Posted March 12, 2009 at 07:01 PM Report Share #250350 Posted March 12, 2009 at 07:01 PM Que erro é que te dá? Não sei se é disso, mas eu costumo usar localhost em vez de http://127.0.0.1/. Embora duvido que seja disso. ? PS: Não respondo a perguntas por mensagem que podem ser respondidas no fórum. Link to comment Share on other sites More sharing options...
The Loser Posted March 12, 2009 at 07:16 PM Report Share #250354 Posted March 12, 2009 at 07:16 PM Tens 2 erros aí. <?php $link = mysql_connect("http://127.0.0.1/","root",""); ?> Não te vais estar a ligar com o prefixo http://, basta localhost aí, ou 127.0.0.1. E para finalizar, <?php $results = mysql_query($query); ?> Aqui o result set chama-se %results mas, <?php while($line = mysql_fetch_assoc($result)){ ?> Aqui tentas usar um result set inexistente, porque é $results e não $result. 🙂 I intend to live forever. So far so good. Link to comment Share on other sites More sharing options...
yoda Posted March 13, 2009 at 10:55 AM Report Share #250475 Posted March 13, 2009 at 10:55 AM Boas, Falta este erro : <?php echo "<?xml version=\"1.0\"?>\n"; echo "</list_tabelas>\n; ?> Estás a fechar a tag antes de a abrires sequer .. before you post, what have you tried? - http://filipematias.info sense, purpose, direction Link to comment Share on other sites More sharing options...
The Loser Posted March 13, 2009 at 01:52 PM Report Share #250520 Posted March 13, 2009 at 01:52 PM Estás a fechar a tag antes de a abrires sequer .. Para não falar que ele nem fechou a string. 😉 I intend to live forever. So far so good. Link to comment Share on other sites More sharing options...
TS91 Posted March 13, 2009 at 02:21 PM Author Report Share #250526 Posted March 13, 2009 at 02:21 PM Obrigado, é que nunca mexi em php e tou a aprender vendo alguns tuts xD 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