Connecting Rev stack to On-Rev mySQL DB?

Devin Asay devin_asay at byu.edu
Fri Mar 26 16:26:05 EDT 2010


On Mar 26, 2010, at 11:58 AM, John Patten wrote:

> Thanks Sarah and Andre!
>
> I figured out the % wildcard for SQL but I like Sarah's irev strategy
> too.  I'm attempting to modify what Sarah describes to include a
> search field on card and a WHERE in the SQL.  Having a hard time
> getting my head around sending  the POST to the irev script so that I
> can search by field in SQL and then returning the data to the stack.
>
> Here's where I'm at:
>
> --On the card-
> on mouseUp
> put cd fld "SearchName" into tTeacher
> libUrlFormData("name", tTeacher)
> post it to url "http://jpatten.on-rev.com/readDB.irev"
> put "http://jpatten.on-rev.com/readDB.irev" into tData
> put tData into fld "tempdata"
> ...
>
> --in the irev file
> put $_POST["name"] into tTeacher
> ( and then everything that Sarah describes below)
>
> My confusion comes from trying to submit two actions to the irev file,
> a POST of the card field text and the Open&Query of the database. What
> is the proper way to get the text (POST) included as a WHERE in the
> irev SQL action?

John,

A few weeks back I taught a block in my Rev class on creating irev  
scripts that respond to form requests in the context of creating  
custom database queries. I've just posted my class notes, which  
include an example of how this could be done. You may find them  
useful. (Or maybe you'll just find them way too basic. :) ) But it may  
give you some ideas.

Go to http://revolution.byu.edu/indexgeneric.php. Scroll down to the  
section on Internet and Networking and see the links under Web  
Services and Server-side Scripting.

Hope it is helpful.

Devin

Devin Asay
Humanities Technology and Research Support Center
Brigham Young University




More information about the use-livecode mailing list