Jump to content

connect to mysql db as different user with in session


c_shelswell

Recommended Posts

Ok further to my previous query re connecting to a db with delete privileges i'm now trying to connect to the database as a different user to carry out this php function. It does however not seem to be carrying out the mysql request with the logon provided.

 

my db logon is:

function db_connect_pp(){



	$result = mysql_pconnect('localhost', 'smvideouserdel', 'smd31u53r');

	if (!$result)



		return false;

	if (!mysql_select_db('simpleminds_dlc'))



		return false;



	return $result;

} 

 

then i have the query which should (i thought) call that logon script and execute my queries with a user with delete privileges though it's not happening. The below is my php function:

 

function paymentVerified($orderNum, $userEmail, $txnid, $method)

{



    $conn = db_connect_pp();




    $delQ = "delete from purchases_pending where download_id='$d[0]'";

    $delRes = mysql_query($delQ);

(shortened version but that's the important stuff)

 

there will have been other connects to the db with a username that cannot delete before this is called could this be the problem? that it's just trying to do it under that user?

 

Thanks for any suggestions.

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.