Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to store data from mysql query to editable array or cursor ?

Status
Not open for further replies.

Coolprogram

Programmer
Nov 9, 2011
15
LT
Well question is simple, how can i store data from mysql query to editable array or cursor ?

i'v tried like
SQLEXEC(P1,"SELECT * FROM zaliavosprekes WHERE pavadinimas LIKE '%"+a+"%' INTO CURSOR cOrders","afas")
 
mysql should error on this, it doesn't know INTO CURSOR. You're executing mysql here not foxpro sql. If you remove that sqlexec will create a cursor on it's own, it's name will be "afas".

Read about the sqlexec() parameters and you'd know.

Bye, Olaf.
 
Remove the INTO CURSOR clause from your query. It's unnecessary and MySQL won't understand it.

The query should be something like this:

Code:
SQLEXEC(P1,"SELECT * FROM zaliavosprekes WHERE pavadinimas LIKE '%"+a+"%'","afas")

This will send the results to a cursor named Afas (assuming you have a variable named "a" that contains your search string).

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
So how can I add data to cursor or array from mysql database ?

Thanks , best redargs
 
I'v tried this mike , it works . But how can I use it as cursor ? As then I try to use afas i got error unknow variable

Best regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top