SQL Yoga Query

Josep jmyepes at mac.com
Mon Aug 24 10:17:20 EDT 2009


Hi List,

I'm try to retrieve all the records from a table named "products"
Frist I connect to the database in the preopenstack

   dbobject_set "storage object", the long id of button "DB Storage"
   put the result into theError
   
   put dbobject_getConnection("development") into theConnA
   if theConnA is not an array then
      dbconn_create "development", "mysql"
      put the result into theError
      
      if theError is empty then
         dbconn_set "host", "www.xxxx.com"
         dbconn_set "username", "admin"
         dbconn_set "password", "xxxx"
         dbconn_set "database name", "database_name"
      end if
   end if
   dbconn_connect

And from a button I try to populate the datagrid

   put sqlquery_create("product") into theQueryA
   
   sqlquery_set theQueryA, "order by", "model"
   sqlquery_retrieveAsArray theQueryA, theRegionDataA
   put the result into theError
   
   if theError is empty then
      ## Array can be assigned directly to a data grid
      set the dgData of group "dg_test" of me to theRegionDataA
   else
      answer "Error populating regions:" && theError
   end if

But nothing happen or the protected stack appear...
What I'm doing wrong?

Salut,
Josep
-- 
View this message in context: http://www.nabble.com/SQL-Yoga-Query-tp25116856p25116856.html
Sent from the Revolution - User mailing list archive at Nabble.com.




More information about the use-livecode mailing list