Problem with user in phpmyadmin

Status
Not open for further replies.

iced.north8359

New Member
Messages
6
Reaction score
0
Points
0
Hi all, i am working in a project and i have a problem.
I created a database and in the phpmyadmin the only user I can see is name@localhost.
From the MySql Databases i created another user with full privileges and add him in the database. In the file database_fuctions.inc in the db_open function i use as arguments the name from the user i made from MySql Databases and the password. When I give in a php file a sql command then it returns me error like this
Access Denied for user 'name'@'10.33.248.75' (using password:no).
When i add this user in the database_functions.inc in the db_open function then the php file doesnt seem to work. Can anyone help me?
Thank you
 

iced.north8359

New Member
Messages
6
Reaction score
0
Points
0
thanks for replying
the way i created the db is like your link.
i just can't add the user i created in the phpmyadmin. am i missing somethnig else maybe?
 

stpvoice

Community Support Rep
Community Support
Messages
5,987
Reaction score
212
Points
63
Hello,

What is the MySQL username you are using?

Thanks.
 

iced.north8359

New Member
Messages
6
Reaction score
0
Points
0
the mysql name i am using is the one from the user i made for mysql wizard,also the password.
just like this:
Code:
$db = mysql_connect("localhost", "name_user", "password")
until here, everything is fine. But when i added this line of code in the php file:
Code:
$t=ceil(mysql_num_rows(mysql_query("SELECT * FROM reviews where name='$elementname'")));
then the error message appears (the one i have in bold in my first post)
i changed this one
Code:
$db = mysql_connect("localhost", "name_user", "password")
with this
Code:
$db = mysql_connect("localhost", "user@localhost")
but then a big part from the php file could not be loaded
thaks for your time :smile:
 

stpvoice

Community Support Rep
Community Support
Messages
5,987
Reaction score
212
Points
63
This is the correct format
Code:
$db = mysql_connect("localhost", "name_user", "password")
Where are you telling it which database to select from?
You may need something like this:
Code:
if (!mysql_select_db($database))
    die("Can't select database");

Replace $database with your database name, or define it.
 
Last edited:

iced.north8359

New Member
Messages
6
Reaction score
0
Points
0
i have a seperate file (database_functions.inc). Over there i have the functions i use with the commands needed. Just like this:
Code:
<?php
function db_open() {  @ $db = mysql_connect("localhost", "name_user", "password") or die("Cannot connect to the database"); 
 @ mysql_select_db('name_databasename') or die('Cannot find database');
}

function db_close() {  @ $db = mysql_close or die("Cannot disconnect for the database"); 
}
 

stpvoice

Community Support Rep
Community Support
Messages
5,987
Reaction score
212
Points
63
Hmm. It may help if you can post both files in full. It's difficult to diagnose when we only have fragments. :)
I can also test the script on another server then, and get back to you with an edited version that works.
 
Last edited:

iced.north8359

New Member
Messages
6
Reaction score
0
Points
0
Now that i see, i cant access my site at all but i guess that's a server case. Tell me what files you need and i will send you via e-mail or what?
 

stpvoice

Community Support Rep
Community Support
Messages
5,987
Reaction score
212
Points
63
Yes, looks like your server is having a moment to itself....
Just the two files you've described so far. I'll send an email to the address linked to your account.
i***********@g****.***
 

iced.north8359

New Member
Messages
6
Reaction score
0
Points
0
could you maybe pm your e-mail address because from what i see i cant include any file when i check send e-mail from your profile page..
edit ok now i saw it
 
Last edited:
Status
Not open for further replies.
Top