using store_result() with dates

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
mattgleeson
Forum Newbie
Posts: 1
Joined: Wed Aug 09, 2006 1:31 am

using store_result() with dates

Post by mattgleeson »

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. 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 data comes out of the DB looking like (a random combination of number, letters and shapes):
2tmtdqXJs

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

Cheers
Post Reply