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.

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.