SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Database User Priviledge error
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

TSmith
Starting Member

2 Posts

Posted - 04/24/2013 :  15:29:24  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

3707 Posts

Posted - 04/24/2013 :  15:35:55  Show Profile  Reply with Quote
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 - 04/24/2013 :  16:06:46  Show Profile  Reply with Quote
Oh, okay,

Thanks
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.04 seconds. Powered By: Snitz Forums 2000