07. 08. 2013. | #1 |
član
Certified
Datum učlanjenja: 06.09.2012
Poruke: 64
Hvala: 0
342 "Hvala" u 10 poruka
|
Problem pri konektovanju na bazi
Nov samu PHP programiranju i na samom startu imam problem
Prilikom konektovanja na MySql bazu izbacuje mi gresku. Kod za konektovanje je sledeci: <?php $link = mysqli_connect('localhost', 'root', 'password'); if (!$link) { $output = 'Unable to connect to the database server.'; exit(); } if (!mysqli_set_charset($link, 'utf8')) { $echo = 'Unable to set database connection encoding.'; exit(); } //naziv baze ijdb if (!mysqli_select_db($link, 'ijdb')) { $echo = 'Unable to locate the database.'; exit(); } $echo = 'Database connection established.'; ?> Promenio sam u phpmyadmin root password u privileges na root localhost i izmenio sam u confing.inc kad pokrenem sajt stalno mi izbacuje Warning: mysqli_connect() [function.mysqli-connect]: (28000/1045): Access denied for user 'root'@'localhost' (using password: YES) a kad izmenim kod <?php $link = mysqli_connect('localhost', 'root'); if (!$link) { $output = 'Unable to connect to the database server.'; exit(); } if (!mysqli_set_charset($link, 'utf8')) { $echo = 'Unable to set database connection encoding.'; exit(); } //naziv baze ijdb if (!mysqli_select_db($link, 'ijdb')) { $echo = 'Unable to locate the database.'; exit(); } $echo = 'Database connection established.'; ?> sve radi normalno |
|
|