Accessing mySQL DB from stack utilizing revserver/irev/on-rev?

John Patten johnpatten at mac.com
Fri Jul 22 16:34:12 EDT 2011


Hi All

  I'm trying to get a handle on using on-rev and irev files on the  
server in combination with post commands and mysql queries directly  
from within a stack.

  Here's what I have so far:

  1. One card with two fields (username & password) and a button.

  2. mySQL table with records consisting of a field for username and a  
field for password.

  3. the beginning of an irev file in directory on on-rev server.



My button contains the following script:

on mouseup

put URLEncode(cd fld "username")& URLEncode(cd fld "password") into  
tLoginVariables

post tLoginVariables to URL ("http://server.on-rev.com/sandbox/login.irev 
")

end mouseUp



irev file on the on-rev server:



<?irev

put "address-of-db" into tDatabaseAddress

   put "dbname" into tDatabaseName

   put "dbUsername" into tDatabaseUser

   put "dbpassword" into tDatabasePassword



  ...and that's about as far as I've gotten so far.  :-(



Essentially I want to create the functionality I have working in my  
stack now into a project that makes the database calls via an irev (on- 
rev) calls. I would like to try making a mobile app out of what I have  
but my stack relies heavily on calls to the mySQL database for data.

  I have very limited experience with irev and just need to know how  
to query the database, get the resulting data from the query, do some  
stuff with in the stack, and then put the data back into the database.

  Is there and example of this available?

  Thank you!

John Patten

SUSD



More information about the use-livecode mailing list