Need help retrievig data from my query!..
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Need help retrievig data from my query!..
Good Day Livecoders,
I need your help. I have a query my problem is how can I able to pass it to the txt field?
I have 2 columns in my table named "name and address"
I have query here's my script
local Ldisplay
local Tdisplay
put "select * from contact_details where email = 'dede'" into ldisplay
put revdatafromQuery (,,gConnectionID,ldisplay) into display
I am successful displaying in datagrid but i want to put it the data into the txt field.
from my query into the txtfield.
Need your help.
Any help will very much appreciated.
Thanks Livecoders.. )
I need your help. I have a query my problem is how can I able to pass it to the txt field?
I have 2 columns in my table named "name and address"
I have query here's my script
local Ldisplay
local Tdisplay
put "select * from contact_details where email = 'dede'" into ldisplay
put revdatafromQuery (,,gConnectionID,ldisplay) into display
I am successful displaying in datagrid but i want to put it the data into the txt field.
from my query into the txtfield.
Need your help.
Any help will very much appreciated.
Thanks Livecoders.. )
Re: Need help retrievig data from my query!..
Hi Snop21,
what about:
...
put revdatafromQuery (,,gConnectionID,ldisplay) into display
put display into fld "your field here"
...
Since "revdatafromQuery" will return just text, you can simply put this into a field!
Best
Klaus
what about:
...
put revdatafromQuery (,,gConnectionID,ldisplay) into display
put display into fld "your field here"
...
Since "revdatafromQuery" will return just text, you can simply put this into a field!
Best
Klaus
Re: Need help retrievig data from my query!..
-klaus
Thanks klaus,
I tried it but it display all the data from my query into the a single txtfield I want to display it one column per txtfield.
---sample my query "select name,email from contacts where name = 'snop21'"
the result
txtfield1 == the value of name from my query
txtfield2 == the value of email from my query
- Thanks
-snop21
Thanks klaus,
I tried it but it display all the data from my query into the a single txtfield I want to display it one column per txtfield.
---sample my query "select name,email from contacts where name = 'snop21'"
the result
txtfield1 == the value of name from my query
txtfield2 == the value of email from my query
- Thanks
-snop21
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Need help retrievig data from my query!..
Hi.
Is it possible that you are trying to put an array into a text field? This will not work. The array must first be converted into the clear, likely with the "combine" command.
If you already have your data in a dataGrid, the same issue applies, so you might take the "dgData" from the DG, since this is also clear data, not an array, like the dgData would be.
Craig Newman
Is it possible that you are trying to put an array into a text field? This will not work. The array must first be converted into the clear, likely with the "combine" command.
If you already have your data in a dataGrid, the same issue applies, so you might take the "dgData" from the DG, since this is also clear data, not an array, like the dgData would be.
Craig Newman
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Need help retrievig data from my query!..
I see.
Why not parse your data according to the delimiters it is formatted with? I assume these are tab and return? You can loop through each line quickly and extract the item of interest from each line. These will form the "column" you want.
Craig
Why not parse your data according to the delimiters it is formatted with? I assume these are tab and return? You can loop through each line quickly and extract the item of interest from each line. These will form the "column" you want.
Craig
Re: Need help retrievig data from my query!..
Hi Craig,
I am new in Livecode that's why I am getting difficulty honestly I don't have an Idea how to do it regarding to your suggestion. But thanks anyway.. )
- snop21
I am new in Livecode that's why I am getting difficulty honestly I don't have an Idea how to do it regarding to your suggestion. But thanks anyway.. )
- snop21
Re: Need help retrievig data from my query!..
Hi snop21,
What "revdatafromquery" returns is TEXT, as I already mentioned, in the format:
1 record per LINE and the fields delimited by TAB in each line in the order as you queried them.
So this:
...
select name,email from contacts where name = 'snop21'
...
will probably return ONE line/record, so you can do this:
...
put revdatafromQuery (,,gConnectionID,ldisplay) into display
set itemdel to TAB
put item 1 of display into fld "name"
put item 2 of display into fld "email"
...
Best
Klaus
but that was your question!snop21 wrote:I tried it but it display all the data from my query into the a single txtfield
...i want to put it the data into the txt field...
What "revdatafromquery" returns is TEXT, as I already mentioned, in the format:
1 record per LINE and the fields delimited by TAB in each line in the order as you queried them.
So this:
...
select name,email from contacts where name = 'snop21'
...
will probably return ONE line/record, so you can do this:
...
put revdatafromQuery (,,gConnectionID,ldisplay) into display
set itemdel to TAB
put item 1 of display into fld "name"
put item 2 of display into fld "email"
...
Best
Klaus
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Need help retrievig data from my query!..
Something like this. In a button somewhere:
Craig
Code: Select all
on mouseUp
put "a" & tab & "b" & tab & "C" & return & "z" & tab & "x" & tab & "b" & return & "h" & tab & "j" & tab & "k" into tData
set the itemdelimiter to tab
repeat with y = 1 to the number of lines of tData
put item 2 of line y of tData into line y of tColumn
end repeat
answer tColumn
end mouseUp
Re: Need help retrievig data from my query!..
-Klus
Got it.. Thank you.. )
Kudos..!
-snop21
Got it.. Thank you.. )
Kudos..!
-snop21
Re: Need help retrievig data from my query!..
KLAUS, my name is KLAUS!snop21 wrote:-Klus
KLAUS! &#*¢¢$$"§
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: Need help retrievig data from my query!..
What a Majer mistake!
Simon
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Need help retrievig data from my query!..
-Klaus
it's a mortal sin.. hehe )
I am Very Sorry.. Didn't Noticed I spelled it wrong.
-snop21
it's a mortal sin.. hehe )
I am Very Sorry.. Didn't Noticed I spelled it wrong.
-snop21
Re: Need help retrievig data from my query!..
Very funny, Sayman!Simon wrote:What a Majer mistake!
Simon