result set database query

Peter T Evensen pevensen at siboneylg.com
Sat Jun 10 23:47:16 EDT 2006


Don't you need something like:

put "SELECT * FROM workers WHERE workers.ID='" & gnameid & "'" into 
theSQL

if gnameid is a Revolution variable, it won't automatically be 
substituted in a string.  You have to build the string.

On Jun 10, 2006, at 8:56 PM, Robert Mann wrote:

> Thanks got that working
> now having trouble getting the variable to work in the new query
>
>   global gnameid
>   put gnameid into fld "gnameid"  --I know it is passing the id it 
> puts it
> in this fld
>
>   put "SELECT * FROM workers WHERE workers.ID='gnameid'" into theSQL
>
> if I put the number in the query it works fine
>
>
> Robert Mann
>
>
> -----Original Message-----
> From: use-revolution-bounces at lists.runrev.com
> [mailto:use-revolution-bounces at lists.runrev.com]On Behalf Of Sarah
> Reichelt
> Sent: Saturday, June 10, 2006 7:40 PM
> To: How to use Revolution
> Subject: Re: result set database query
>
>
>> I get the result set from a query (id and name) these are put into a 
>> menu
>> (only name showing)
>> now when you select a name I want to pass the id that goes with the 
>> name
> to
>> a new query
>> any ideas how to do this?
>>
>> 1  bill
>> 2 john
>> 3 rob
>>
>> select rob would like to pass 3 to new query
>
> In your example, the ID number is the line number. If this is always
> the case then you can use:
>   the menuHistory of me
> which gives the selected line number for a menu button.
>
> If this is not the case, then you need to store the complet list
> somewhere and refer back to it.
>
> get the complete list
> sort it the way you want
> put it into a custom property
> extract the names and put them into the menu
>
> When a menu item is selected:
>
> get the menuHistory of the menu button
> find the line number of the custom property
> get word 1 of that line to find the ID
>
> HTH,
> Sarah
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your 
> subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your 
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
Peter T. Evensen
314-629-5248 or 888-682-4588 (toll free)
http://www.PetersRoadtoHealth.com
Get on the road to better health with Juice Plus+
17 fruits, vegetables and grains in capsules, chewables, or gummies
24-hour pre-recorded information line:  1-800-942-1260




More information about the use-livecode mailing list