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
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");

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.