albertmaranian Posted July 25, 2014 Report Posted July 25, 2014 Hi, I was testing the "add" Invoice API but right now I have no idea what the problem is since the response is too generic, please see below: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 Below is my sample invoice data that I was trying to submit to our blesta server. Is there something I am missing here? $date = date('c'); $invoice = ['client_id' => 68, 'date_billed' => $date, 'date_due' => $date, 'date_closed' => $date, 'date_autodebit' => $date, 'status' => 'active', 'currency' => 'USD', 'note_private' => 'Initial payment', 'note public' => '', 'lines' => [ 'service_id' => 127, 'amount' => 500, 'qty' => 1, 'description' => '1 slot', 'tax' => false ], 'term' => '', 'period' => '', 'duration' => '', ]; Quote
Tyson Posted July 25, 2014 Report Posted July 25, 2014 That error is rather generic. Curious why you're using brackets for associative arrays. I'm not familiar with that syntax. The data values look fine, except for the due date, which is expected to be after the bill date, so the error is occurring on or before rule validation. Quote
mrrsm Posted July 26, 2014 Report Posted July 26, 2014 That error is rather generic. Curious why you're using brackets for associative arrays. I'm not familiar with that syntax. php 5.4 added square bracket array notation (http://php.net/manual/en/language.types.array.php) Quote
Tyson Posted August 25, 2014 Report Posted August 25, 2014 I'm not able to duplicate this issue. Do you still experience this problem, and if so, can you provide any additional information about the environment, etc., as shown in how to report a bug? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.