Jump to content


Photo

using store_result() with dates


  • Please log in to reply
No replies to this topic

#1 mattgleeson

mattgleeson
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 08 August 2006 - 01:13 PM

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





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users