Ga naar inhoud

PHP


anoniem

Aanbevolen berichten

Weet iemand wat onderstaande foutmelding inhoud en wat ik moet doen om deze niet meer te krijgen zodat het goed werkt. Draai op localhost. [code:1:f90f575c2f]Warning: Unknown MySQL Server Host 'c' (2) in c:\program files\easyphp\www\php.php on line 16 Warning: MySQL Connection Failed: Unknown MySQL Server Host 'c' (2) in c:\program files\easyphp\www\php.php on line 16 kan SQL server niet selecteren[/code:1:f90f575c2f]
Link naar reactie
Ik weet al waar het probleem zit. Ik draai lokaal PHP en MySQL. Ik vul in als gebruikersnaam "localhost" en als username en password vul ik niks in. Zie hieronder mij script. [code:1:a5d83e865e] <html> <head> <title><PHP Pagina</title> </head> <body> <table width="420" border="1" algin="center"> <tr> <td width="20">ID</td> <td widht="160">Titel</td> <td width="240">Bericht</td> </tr> </table> <?php mysql_connect("localhost","","") or die("kan SQL server niet selecteren"); mysql_select_db("nieuws") or die("kan database niet selecteren"); $query = "SELECT Nieuws_ID, Nieuws_Titel, Nieuws_Bericht FROM nieuwsbericht"; $nieuw = mysql_query($query) or die("Select niet gelukt!"); while ($nieuws = mysql_fetch_array($nieuws)) { ?> <table width="420" border="1" align="center"> <tr bgcolor="#BAD1F5"> <td width="20"><?php echo $nieuws['Nieuws_ID'];?></td> <td width="160"><?php echo $nieuws['Nieuws_Titel'];?></td> <td width="240"><?php echo $nieuws['Nieuws_Bericht'];?></td> </tr> </table> <?php } ?> </body> </html><html> <head> <title><PHP Pagina</title> </head> <body> <table width="420" border="1" algin="center"> <tr> <td width="20">ID</td> <td widht="160">Titel</td> <td width="240">Bericht</td> </tr> </table> <?php mysql_connect("localhost","","") or die("kan SQL server niet selecteren"); mysql_select_db("nieuws") or die("kan database niet selecteren"); $query = "SELECT Nieuws_ID, Nieuws_Titel, Nieuws_Bericht FROM nieuwsbericht"; $nieuw = mysql_query($query) or die("Select niet gelukt!"); while ($nieuws = mysql_fetch_array($nieuws)) { ?> <table width="420" border="1" align="center"> <tr bgcolor="#BAD1F5"> <td width="20"><?php echo $nieuws['Nieuws_ID'];?></td> <td width="160"><?php echo $nieuws['Nieuws_Titel'];?></td> <td width="240"><?php echo $nieuws['Nieuws_Bericht'];?></td> </tr> </table> <?php } ?> </body> </html>[/code:1:a5d83e865e]
Link naar reactie

Om een reactie te plaatsen, moet je eerst inloggen

Gast
Reageer op dit topic

×   Geplakt als verrijkte tekst.   Herstel opmaak

  Er zijn maximaal 75 emoji toegestaan.

×   Je link werd automatisch ingevoegd.   Tonen als normale link

×   Je vorige inhoud werd hersteld.   Leeg de tekstverwerker

×   Je kunt afbeeldingen niet direct plakken. Upload of voeg afbeeldingen vanaf een URL in

  • Populaire leden

    Er is nog niemand die deze week reputatie heeft ontvangen.

  • Leden

    Geen leden om te tonen

×
×
  • Nieuwe aanmaken...