You are here: beginners problem « PHP SQL « IT news, forums, messages
beginners problem

Posted by Juegen Koenig on 02/03/07 18:17

Sorry, I am completely new to the subject and it begins very frustrating.
I took an example almost word for word from a book and it doesn't work. I
have no idea where to look next.

What ist wrong with the following file:

<?
$host="192.168.0.11";
$user="root";
$pass="passwort";
$database="Lehrerverzeichnis";
$dz=mysql_connect($host,$user,$pass);
mysql_select_db($database,$dz);
?>
<html>
<head></head>
<body>
<?
$sql=mysql_query("SELECT * from TelefonEmail");
while ($ds=mysql_fetch_object($sql)){
$name=$ds -> name;
$vorname=$ds -> vorname;
echo "$name $vorname<br>";
}
mysql_close($dz)
?>
</body>

I myself am sitting at machine 192.168.0.200. I can open the database and
the table using phpmyadmin with those parameters without any problem. I get
a lost connection. at line 6.

I have for some reason set $host to "localhost" and it works to my surprise
to line 14, where it says "supplied argument is not valid"

So what is correct, when I am working at 192.168.0.200 and the server ist
192.168.0.11. What should hosts be? And if it is really 'localhost', what I
do not believe, what does the error mean?

Thanks

Jürgen

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация