Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Database User Priviledge error

Author  Topic 

TSmith
Starting Member

2 Posts

Posted - 2013-04-24 : 15:29:24
We have a database with two tables in it, members, and registrations. I'm using the same PHP and MySQL code to populate both tables that have basically the same rows of data.

The database was manually made, along with the database user in cPanel.

The registrations table is populating but when I try to run this code below to populate the members table it isn't working.....

<?php
$dbhost = '#';
$dbuser = '#';
$dbpass = '#';
$conn = mysql_connect($dbhost, $dbuser, $dbpass);
if(! $conn )
{
die('Could not connect: ' . mysql_error());
}
$sql = 'INSERT INTO members '.
'(event,venue, firstname) '.
'VALUES ( "test", "test", "test" )';

mysql_select_db('back_office');
$retval = mysql_query( $sql, $conn );
if(! $retval )
{
die('Could not enter data: ' . mysql_error());
}
echo "Entered data successfully\n";
mysql_close($conn);
?>

It gives me this error...

Could not enter data: INSERT command denied to user '#'@'sub.domain.org' for table 'members'

I can't figure out how to fix this, any help is appreciated.

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-04-24 : 15:35:55
This forum is for Microsoft SQL Server; so there would be very few, if any, experts on MySQL/PHP. You would get faster and better answers at PHP or MySql forum.
Go to Top of Page

TSmith
Starting Member

2 Posts

Posted - 2013-04-24 : 16:06:46
Oh, okay,

Thanks
Go to Top of Page
   

- Advertisement -