[mysql] geen verbinding

Pagina: 1
Acties:

  • TutanRamon
  • Registratie: Februari 2001
  • Laatst online: 09-09 15:05
Ik krijg telkens dezelfde foutmelding:


Warning: MySQL Connection Failed: Access denied for user: 'apache@localhost' (Using password: NO) in /home/httpd/vhosts/blabla.nl/httpdocs/listc.inc.php on line 26

Warning: MySQL: A link to the server could not be established in /home/httpd/vhosts/blabla.nl/httpdocs/listc.inc.php on line 26

Warning: Supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/blabla.nl/httpdocs/listc.inc.php on line 27

Mijn instellingen zijn zeker weten goed.
Wat doe ik verkeerd?

We see things as we are, not as they are


Verwijderd

Kan je wel bij de DB komen via de mysql command line?

  • TutanRamon
  • Registratie: Februari 2001
  • Laatst online: 09-09 15:05
Ik kan wel bij de database komen via Phpmyadmin.

We see things as we are, not as they are


  • dusty
  • Registratie: Mei 2000
  • Laatst online: 21-02 00:06

dusty

Celebrate Life!

Gokje : Je moet je wachtwoord mee geven.

Back In Black!
"Je moet haar alleen aan de ketting leggen" - MueR


Verwijderd

Als je dit hebt:
PHP:
1
<?$link = mysql_connect("localhost", $gebruikersnaam, $wachtwoord)    or exit("bla");mysql_select_db("dbnaam")    or exit("bla2");?>

gebruik je dan echt de goede user en pass? Of connect ie niet eens?

  • Petuhr
  • Registratie: Juni 2000
  • Laatst online: 13:10

Petuhr

FreeBSD

[edit]
Geef eens een wachtwoord mee :)

  • TutanRamon
  • Registratie: Februari 2001
  • Laatst online: 09-09 15:05
Ik gebruik toch echt de goede pass en usernaam e.d.
PHP:
1
<?if($index != ""){  $Host= "localhost";  $Gebruiker = "gebruiker";  $Wachtwoord = "pass";  $DBNaam = "naam";    $Verbinding = mysql_connect ($Host, $Gebruiker, $Wachtwoord);  @mysql_select_db("$DBNaam") or die("Unable to select database $DBNaam"); }?>

We see things as we are, not as they are


Verwijderd

Ik zie in je eerste post dat je nogal wat errors krijgt bij latere regelnummers. Als je nou eerst een heel simpel scriptje gebruikt om te testen of je kan verbinden dan sluit je een heleboel uit.

Probeer ook de "@" te vermijden om meer errorinfo te krijgen. En: misschien is $index wel "". :?

  • TutanRamon
  • Registratie: Februari 2001
  • Laatst online: 09-09 15:05
zoals? (een simpel scriptje?)

ben nogal een newbie.

We see things as we are, not as they are


Verwijderd

Zoals het scriptje dat ik een paar posts hierboven neer heb gezet.

  • TutanRamon
  • Registratie: Februari 2001
  • Laatst online: 09-09 15:05
Bij jouw script geeft ie "bla2", is dat gunstig of niet?

We see things as we are, not as they are


Verwijderd

Dan heb je in ieder geval geconnect! Weet je zeker dat je de databasenaam goed heb? Dat moet het probeem bijna wel zijn.

Enne... dat is goed ja dat je bla2 krijgt.

  • TutanRamon
  • Registratie: Februari 2001
  • Laatst online: 09-09 15:05
Ja, alles is goed.

dit is trouwens het stukje php waar het fout gaat:
PHP:
1
<?$result = mysql_query("select id, name from cardcat where active = 1");while($query_data = mysql_fetch_row($result)) { echo"<a href=\"index.php?index=listc2&amp;a=$query_data[0]\">$query_data[1]</a><br>";}?>

We see things as we are, not as they are


Verwijderd

ik zie dat je dubbelquotes gebruikt binnen dubbelquotes. Bij echo. Dat is 1 ding dat ie niet lust.

<edit> oh nee, ik zag de slashes niet <edit>

  • TutanRamon
  • Registratie: Februari 2001
  • Laatst online: 09-09 15:05
Op vrijdag 15 maart 2002 15:02 schreef RedDot het volgende:
ik zie dat je dubbelquotes gebruikt binnen dubbelquotes. Bij echo. Dat is 1 ding dat ie niet lust.

<edit> oh nee, ik zag de slashes niet <edit>
dus dat moet worden:
PHP:
1
<?$result = mysql_query("select id, name from cardcat where active = 1");while($query_data = mysql_fetch_row($result)) { echo "<a href=\index.php?index=listc2&amp;amp;amp;a=$query_data[0]\>$query_data[1]</a><br>";}?>

Maar die regel waar $result begint, daar zit ie om te zeiken.

We see things as we are, not as they are


Verwijderd

Doe eens:

("select id, name from cardcat where active = '1'")

Dus even quotes om de 1.

In mij vorige reply zei ik iets over die dubbelquotes, maar je had het gewoon goed staan. Dus negeer dat maar en zet die dubbelquotes terug.

  • TutanRamon
  • Registratie: Februari 2001
  • Laatst online: 09-09 15:05
Het mag allemaal niet baten.... ;(

We see things as we are, not as they are

Pagina: 1