Jump to content

problem with database connection


mostafa581

Recommended Posts

Dear friends

i,m a php beginner and i got a problem with connecting to my database

i created a database called (koora) with one table called (admins) and when i tried to connect to it (database ) ; it did not connect

here is the code i used for that

 

<?php

$connectdb = mysql_connect('localhost','','') or die("not connected");

$selectdb = mysql_select_db("koora", $connectdb);

 

if(!$selectdb)

{

die("error connecting table" .mysql_error());

 

}

 

then when refreshing my phpmyadmin page i got that message

 

error connecting tableAccess denied for user ''@'localhost' to database 'koora'

 

koora is the name of the database

so i need your help with this problem and what is the reason not to connect to the data base

Thank you

 

Link to comment
https://forums.phpfreaks.com/topic/224477-problem-with-database-connection/
Share on other sites

any user connecting to a MySQL database must have the proper login credentials to access the database. you must either set those login credentials (permissions) or find out what they are to use in this line:

 

$connectdb = mysql_connect('localhost','USERNAME????','PASSWORD????') or die("not connected");

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.