Jump to content

erro PHP


TS91
 Share

Recommended Posts

Boas,

isto diz que a um erro no ficheiro php mas eu nao consigo identifica-lo :wallbash:, 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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.