简体   繁体   中英

mysqli_stmt::bind_param and mysqli_stmt::prepare

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???

I think it would be s (string).

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM