Jump to content

Soabirw

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Soabirw's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I keep getting this error from the SOAP server: Server did not recognize the value of HTTP Header SOAPAction: [a href=\"http://authorize.net/merchantApi/#GetReturns\" target=\"_blank\"]http://authorize.net/merchantApi/#GetReturns[/a]. Which I thought made sense. I know that it is wanting "http://authorize.net/merchantApi/GetReturns". Not sure how or why that pound gets put there, but then I tried to make the same script in Perl with SOAP::Lite and it puts it there too, so I get the exact same error. Think the last time I used SOAP was 2 years ago, so maybe I'm just too rusty. Here is the XML I am needing to produce: [a href=\"https://account.authorize.net/api/merchantapi.asmx?op=GetReturns\" target=\"_blank\"]https://account.authorize.net/api/merchanta...x?op=GetReturns[/a] It's a really small call. And here is my current PHP: [code] class auth {     private $login;     private $password;          public function __construct($login,$password) {         $this->login = $login;         $this->password = $password;     } } $client = new SoapClient(null,     array(         'location' => 'https://account.authorize.net/api/merchantapi.asmx',         'uri' => 'http://authorize.net/merchantApi/'     ) ); // Tried this way of connecting too. // $client = new SoapClient('https://account.authorize.net/api/merchantapi.asmx?WSDL'); $auth = new auth('login','password'); $header = new SoapHeader('http://authorize.net/merchantApi/','InHeader', $auth); $result = $client->__soapCall('GetReturns', array('transactionID' => 123456789), null, $header); if (is_soap_fault($result)) {    trigger_error("SOAP Fault: (faultcode: {$result->faultcode}, faultstring: {$result->faultstring})", E_ERROR); } [/code]
  2. Moving towards mysqli so I can use prepared statements. So far I am liking it, but now and then I need my queries to be a bit more dynamic. For example, I want to pass an array of fields and build my own where clause. Problem I'm having is I can't figure out how to dynamically bind params. Here is my old code as an example: [code] if(!empty($criteria['username'])) {     $where_list[] = " username = '".mysql_real_escape_string($criteria['username'])."'"; } if(!empty($where_list)) {     $where = "WHERE ";     $where .= implode(" AND ",$where_list); } $sql_list = "SELECT id, CONCAT(last_name, ', ', first_name, '(', username, ')') AS label     FROM users     $where "; [/code] That works just fine, but with mysqli prepare I need to run a query more like: SELECT id FROM users WHERE username = ? Then run: $stmt->bind_param('s',$criteria['username']); As I mentioned earlier the function allows you to pass in an array. Which could look something like: User::listUsers(array('username' => 'jjohnson', 'first_name' => 'joe', 'last_name' => 'johnson')); My old code handles it just fine, but I can't figure out how to make the bind_param work this way. I know others have used prepared statements flexible enough, any suggestions?
×
×
  • 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.