Question

Ok so i want to do a prepared insert such as:

prepare("INSERT INTO `analyzeditemsdetails` SET 
                                     analyzeditem_id = ? ,
                                     start_time = ? ,
                                     end_time = ? 
                                      ");

start_time and end_time are stored in the database as sql dates. Fill in the ?'s in this next statement:

$stmt->bind_param('i??',
                           $this->sqlid, 
                           $item['start_time'], 
                           $item['end_time'] 
                           );

So basically what do I put in a bind_param method call for sql dates???

Was it helpful?

Solution

I think it would be s (string).

$stmt->bind_param('iss',
                           $this->sqlid, 
                           $item['start_time'], 
                           $item['end_time'] 
                           );
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top