Hi everyone.
I have a problem modifying the Rows.
My code is pretty simple:
sql_create_14(stock,
1, 14,
mysqlpp::sql_int, id,
mysqlpp::sql_int, area,
mysqlpp::sql_double, latitude,
mysqlpp::sql_double, longtitude,
mysqlpp::sql_int, charge_num,
mysqlpp::sql_int, duration_int,
mysqlpp::sql_time, duration,
mysqlpp::sql_int, user_num,
mysqlpp::sql_datetime, start_time,
mysqlpp::sql_datetime, end_time,
mysqlpp::sql_varchar, vehicle_num,
mysqlpp::sql_tinyint, replied,
mysqlpp::sql_tinyint, used,
mysqlpp::sql_tinyint, active);
query << "select * from parkingscylar where id = " << msg_in.park_num;
mysqlpp::StoreQueryResult res = query.store();
===>stock row = res[0]; Error from here "mysqlpp::BadConversion at memory
location"
stock orig_row = row;
row.user_num = msg_in.user_num; (it's an int number "45")
query.update(orig_row,row);
query.execute();
what is wrong here?
My table is as follows:
+--------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------+--------------+------+-----+---------+-------+
| id | int(11) | YES | | NULL | |
| area | int(11) | YES | | NULL | |
| latitude | double(10,7) | YES | | NULL | |
| longtitude | double(10,7) | YES | | NULL | |
| charge_num | int(11) | YES | | NULL | |
| duration_int | int(11) | YES | | NULL | |
| duration | time | YES | | NULL | |
| user_num | int(20) | YES | | NULL | |
| start_time | datetime | YES | | NULL | |
| end_time | datetime | YES | | NULL | |
| vehicle_num | varchar(20) | YES | | NULL | |
| replied | tinyint(1) | YES | | NULL | |
| used | tinyint(1) | YES | | NULL | |
| active | tinyint(1) | YES | | NULL | |
+--------------+--------------+------+-----+---------+-------+
Please help out here.