mysql WHERE statement problem
Posted: Fri Oct 20, 2017 9:08 pm
Hi All,
First off I hope this is the correct area to post this question as I wouldn't want to be cluttering the forum.
I was wondering if anybody could help regarding a MySql statement, this particular query has been driving me crazy for the past two days. I'm trying to include a variable within the WHERE statement allowing the user to edit what is searched for.
Here is a snippet of my code:
I'm essentially trying to get a match across tbl_one & tbl_two (Which I have running via other scripts) and then including the "vUserInput" enhancing the WHERE statement acting like an AND ("WHERE tbl_one.mpn = tbl_two.mpn and tbl_one.mpn = vUserInput).As it would perform in a normal MySql query.
I hope this makes sense to someone, I feel that this is somewhat easy and I'm completely overlooking it and or being an idiot.
Any help would be greatly appreciated.
Gary
First off I hope this is the correct area to post this question as I wouldn't want to be cluttering the forum.
I was wondering if anybody could help regarding a MySql statement, this particular query has been driving me crazy for the past two days. I'm trying to include a variable within the WHERE statement allowing the user to edit what is searched for.
Here is a snippet of my code:
Code: Select all
put "SELECT tbl_one.*,tbl_two.mpn, tbl_two.cost_price, tbl_two.list_price FROM tbl_one,tbl_two " & \
"WHERE tbl_one.mpn = tbl_two.mpn" & vUserInput & "" into tQuery
I hope this makes sense to someone, I feel that this is somewhat easy and I'm completely overlooking it and or being an idiot.
Any help would be greatly appreciated.
Gary