Jump to content

using store_result() with dates


mattgleeson

Recommended Posts

I am in the process of converting my app to use the new mysqli library and using bound parameters/results etc.

I am having trouble selecting dates from the database when storing the result.
I need to perform a select query on a date column and a LONGTEXT column in the same table. Because, as I understand it, I need to store_result in order to get the data for the LONGTEXT column, but in doing so it stuffs up the data returned for the date column.
How do I get around this as I dont want to do 2 different database queries just to get the data from the same table.

At the moment I create a connection to the database, prepare a database statement, bind the paramters, execute the statement, store the result (store_result), bind the return parameters, fetch the data. The LONGTEXT data is returned fine but the date data isn't. If I don't store the result, the date data is returned fine but then obviously the LONGTEXT isn't.

The incorrect date or LONGTEXT comes out of the DB looking like:
2tmtdqXJs

Is this a bug in mysqli or am I missing something?

Cheers
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.