c_shelswell Posted April 10, 2007 Share Posted April 10, 2007 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 https://forums.phpfreaks.com/topic/46410-connect-to-mysql-db-as-different-user-with-in-session/ Share on other sites More sharing options...
c_shelswell Posted April 11, 2007 Author Share Posted April 11, 2007 sorry anyone got any ideas? :bump: Link to comment https://forums.phpfreaks.com/topic/46410-connect-to-mysql-db-as-different-user-with-in-session/#findComment-226680 Share on other sites More sharing options...
rpadilla Posted April 11, 2007 Share Posted April 11, 2007 from php.net mysql_query ( string query [, resource link_identifier]) try $delRes = mysql_query($delQ, $conn); Link to comment https://forums.phpfreaks.com/topic/46410-connect-to-mysql-db-as-different-user-with-in-session/#findComment-226705 Share on other sites More sharing options...
c_shelswell Posted April 11, 2007 Author Share Posted April 11, 2007 great that seems to have worked. Thanks very much indeed Link to comment https://forums.phpfreaks.com/topic/46410-connect-to-mysql-db-as-different-user-with-in-session/#findComment-226740 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.