help mysql search

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
bels79
Posts: 37
Joined: Fri Sep 09, 2011 8:01 am
DBs Used: DBF, MySQL

help mysql search

Post by bels79 »

I am still learning, and try the example "MYSQL.3".
for input successful but had to search no results.

These pieces of the program, can you please help.

oQuery := oServer:Query( "Select * From Nasabah Where Nopsb = " + Win_1.Text_1.value + " Order By Nopsb" )
msgbox(Win_1.Text_1.value) --> test results are correct
If oQuery:NetErr()
msgbox("message 1")
else
msgbox("message 2")
Endif

thank you,
beni
User avatar
Rathinagiri
Posts: 5482
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: help mysql search

Post by Rathinagiri »

Hi

You have to add single quote symbol ' on both sides. Please see and use c2sql function in mysql harbour contrib sample.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
bels79
Posts: 37
Joined: Fri Sep 09, 2011 8:01 am
DBs Used: DBF, MySQL

Re: help mysql search

Post by bels79 »

tq Rathinagiri

oQuery := oServer:Query( "Select * From Nasabah Where Nopsb = " + c2sql(Win_1.Text_1.value) + " Order By Nopsb" )
mean by adding the command c2sql(Win_1.Text_1.value) ? using c2sql ='12345'
result value oQuery = empty, if found ?

I still do not understand

rathinagiri wrote:Hi

You have to add single quote symbol ' on both sides. Please see and use c2sql function in mysql harbour contrib sample.
User avatar
Rathinagiri
Posts: 5482
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: help mysql search

Post by Rathinagiri »

It seems your query is correct. Do u get any error?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
bels79
Posts: 37
Joined: Fri Sep 09, 2011 8:01 am
DBs Used: DBF, MySQL

Re: help mysql search

Post by bels79 »

no error, but the result is always the same (empty), if found or not found
how to display the results "oQuery " ?

Rathinagiri, I am sorry a lot of questions, still need to learn a lot
rathinagiri wrote:It seems your query is correct. Do u get any error?
User avatar
Rathinagiri
Posts: 5482
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: help mysql search

Post by Rathinagiri »

I think you can make use of hmgmysql library which is based on harbour mysql with three simple functions.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
bels79
Posts: 37
Joined: Fri Sep 09, 2011 8:01 am
DBs Used: DBF, MySQL

Re: help mysql search

Post by bels79 »

ok tq, I'll try coding a new, hopefully successful
rathinagiri wrote:I think you can make use of hmgmysql library which is based on harbour mysql with three simple functions.
Post Reply