| dhoward Admin Group
 
  
  
 Joined: June 29 2001
 Location: United States
 Online Status: Offline
 Posts: 4447
 | 
          Yes, you can call a vbscript with the ph_runscript_? functions.  Check out the help file as most of the ph_??? functions are also available for use within vbscript and jscript.
           | Posted: March 21 2006 at 21:28 | IP Logged |   |  
           | 
 |  
 You can run SQL queries and iterate through the return results using the ph_sqlselect function (ph.sqlselect in vbscript).  The syntax for your SQL above would be:
 
 ph_sqlselect(1,"select id from insteondevices where location like '%kitchen%'")
 
 ph_getsqlrows(1) will return how many records were retrieved and ph_getdata(1,row,1) will retrieve the data.  Check out the help file under the Database section for more info and related functions.  Be sure you destroy the data retrieval when you're done using the ph_sqldestroy(1) function to release the memory.
 
 HTH,
 
 Dave.
 
 |