WebSite X5Help Center

 
Björn J.
Björn J.
User

Php mysql query problem  en

Автор: Björn J.
Просмотрено 2564, Подписчики 2, Размещенный 0  
Тэги: database

I have now tried for a couple of days to get a php-script to read from mysql-database. When I load the page I get this error: Could not connect: php_network_getaddresses: getaddrinfo failed: hostname nor servname provided, or not known.

I attach the script

Can anyone tell me what I am doing wrong?

Размещено
6 Ответы
Samuel V.
Samuel V.
User

Hello,

Well, I understand you have a DB server which URL is "database.my.site" ? Or, do you replace the variables with your own data ?

Читать больше
Размещено От Samuel V.
Björn J.
Björn J.
User
Автор

Hi,

yes, I don't want to give away too muchSmile.

I use the same settings as I do in the email-form to data, there it works

Читать больше
Размещено От Björn J.
Samuel V.
Samuel V.
User

Thanks. So perhaps is it the "server port" that is missing. For ex: "database.my.site:5345"

Have you already tried this ? Smile

Читать больше
Размещено От Samuel V.
Björn J.
Björn J.
User
Автор

Since I don't have to give that in emailform I haven't tried that Undecided

Will do that as soon as I have tried with version10

I'll get back...

Читать больше
Размещено От Björn J.
Björn J.
Björn J.
User
Автор

Problem solved...

I really don't know what was wrong.

But now it works. the mysql_connect statement works now.

mysql_select_db should only use tablename as parameter.

Читать больше
Размещено От Björn J.
Björn J.
Björn J.
User
Автор

of course it should be databasename not tablenam Foot in mouth

Читать больше
Размещено От Björn J.