You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on executing prepared statements asynchronously. By the looks of the code, this is still in development, but I wanted to make sure I wasn't making a mistake in my implementation. When initializing the parent class, I do the following:
Create a new statement with initStatementSync();.
Prepare the statement SQL with prepareSync();.
Store that MysqlStatment object in my parent class.
The parent class has methods to query the DB. When on of those methods is invoked, the code then does the following:
Get the saved MysqlStatment that was previously prepared
Set the params with bindParamsSync();.
Call execute() on the statement.
In the callback of the execute method, call bindResultSync();
After binding the results, call fetchAll() to get the dataset.
I had previously written this code to use the synchronous methods for testing my SQL statements and it worked great. However, I must use the async calls in the final application. The code above doesn't fail, but returns no data. I have a feeling I'm not binding the results correctly before calling fetchAll().
The source code for the execute() block is here, where the statement object has already been initialized and prepared:
As I said, it seems the support for async prepared statement execution might not be completed. That's OK, but I wanted to make sure my code wasn't wrong and that's why I'm getting an empty array back.
The text was updated successfully, but these errors were encountered:
Sannis
changed the title
Async Prpared Statement Execution
Async Prepared Statement Execution
Jul 12, 2014
Really great work on this library. Thanks.
I'm working on executing prepared statements asynchronously. By the looks of the code, this is still in development, but I wanted to make sure I wasn't making a mistake in my implementation. When initializing the parent class, I do the following:
The parent class has methods to query the DB. When on of those methods is invoked, the code then does the following:
I had previously written this code to use the synchronous methods for testing my SQL statements and it worked great. However, I must use the async calls in the final application. The code above doesn't fail, but returns no data. I have a feeling I'm not binding the results correctly before calling fetchAll().
The source code for the execute() block is here, where the
statement
object has already been initialized and prepared:As I said, it seems the support for async prepared statement execution might not be completed. That's OK, but I wanted to make sure my code wasn't wrong and that's why I'm getting an empty array back.
The text was updated successfully, but these errors were encountered: