Page 1 of 1

crash when executing this line

Posted: Thu Oct 26, 2017 4:28 am
by Ememjr
can anyone see what is wrong with this

Code: Select all

MYSQL_RES* result = query.RunQuery2(Q_SELECT, "SELECT h.id,h.house_id, h.item_id, h.x, h.y, h.z, h.rotation, h.pitch, h.roll, h.scale, h.incrate,i.model_id,i.primary_command,i.secondarycommand FROM house_item_list h,item_details_house i WHERE h.house_id = %s and h.item_id = i.item_id ", house_id );
if i put in my query editor and just change the hosueidto the actually id the query works
thinking it is something to do with ", house_id and the corresponding %s

do i need to convert house_id to a string?

Re: crash when executing this line

Posted: Thu Oct 26, 2017 11:36 am
by Ememjr
i tied with %i and with %s converting house_id to a string with to_string(house_id)

althoguh i dont get error anymore, its not pulling result

Re: crash when executing this line

Posted: Thu Oct 26, 2017 3:24 pm
by Jabantiz
First off I suck with sql so I am mostly just guessing and can't be sure with out even seeing the tables.

What is `house_id` in the table? If it is just an int then all you would need is a %i, no need to change it to a string.