I am a newby so
i want to update or search a record in mysql.
if i put in something like SELECT * FROM table WHERE score=12 or name="theo" it works ; score and name are columns in mysql
But i want to ask the input first, put it into a variable, how do i put the content of that variable in mysql?
theo
variable into mysql
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: variable into mysql
Hi Theo,
1. welcome to the forum!
2. You need to build the correct string!
Example:
...
put 12 into tNumber
put "SELECT * FROM table WHERE score=" & tNumber into tSQL
...
Check this thread about exactly this topic:
http://forums.runrev.com/phpBB2/viewtop ... 12&t=20360
Best
Klaus
1. welcome to the forum!

2. You need to build the correct string!
Example:
...
put 12 into tNumber
put "SELECT * FROM table WHERE score=" & tNumber into tSQL
...
Check this thread about exactly this topic:
http://forums.runrev.com/phpBB2/viewtop ... 12&t=20360
Best
Klaus
Re: variable into mysql
Thanks for your reply
That works with a digit into tNumber but not if i put a text into tNumber.
I want to search for a record of a person by asking his name. Then search for the record.
theo
That works with a digit into tNumber but not if i put a text into tNumber.
I want to search for a record of a person by asking his name. Then search for the record.
theo
Re: variable into mysql
Hi Theo,
why did you not take a look at the thread I posted?
You really should do!
This is what I wrote there:
...
put field "saisie" into champsaisie
put "INSERT into informations_table VALUES ('" & champsaisie & "');" into tSQL
...
This is just an example, but I am sure you can change this to the SELECT statement
for your needs
Best
Klaus
why did you not take a look at the thread I posted?

You really should do!
This is what I wrote there:
...
put field "saisie" into champsaisie
put "INSERT into informations_table VALUES ('" & champsaisie & "');" into tSQL
...
This is just an example, but I am sure you can change this to the SELECT statement
for your needs

Best
Klaus