Re: database connect question
Posted: Mon May 14, 2012 11:19 pm
Your right !
SO THIS iRev script WORKS OK BUT...: I need to pass the data to the query via the global pNum and variable not hard coded into the iRev file.
<?rev set the errorMode to "inline" ?>
<?rev put revOpenDatabase("mysql", "localhost", "Database_Name", "User_Name_", "password") into tConId
put "'" & "400" & "'" into pNum
put "SELECT * FROM `Table_Name` WHERE StreetNumber =" && pNum into tSQL
if tConId is a number then
put revDataFromQuery(tab, return, tConID, tSQL) into tList
put tList
revCloseDatabase tConID
end if
?>
IN OTHER WORDS what am trying to do IN THE LC STACK is
on mouseup
global pNum
put "'" & "400" & "'" into pNum
put "theQuery=urlencode(myQuery)" into myQuery
post myQuery to url "http://www.mydomain.on-rev.com/NewQuery.irev"
put it into tMyResult
answer tMyResult
end mouse up
Then in the iRev File on the server named /NewQuery.irev"
<?rev set the errorMode to "inline" ?>
<?rev put revOpenDatabase("mysql", "localhost", "Database_Name", "User_Name_", "password") into tConId
global pNum ## <----THIS IS THE PART THAT IS NOT WORKING
put "SELECT * FROM `Table_Name` WHERE StreetNumber =" && pNum into tSQL
if tConId is a number then
put revDataFromQuery(tab, return, tConID, tSQL) into tList
put tList
revCloseDatabase tConID
end if
?>
Anyone? Help Bankok? I suspect globals need to be performed with the $_Get command but I can't wrap my head around it. I need a simple example showing the data being transferred from the LC desktop to the iRev script.
Dave
Dave
SO THIS iRev script WORKS OK BUT...: I need to pass the data to the query via the global pNum and variable not hard coded into the iRev file.
<?rev set the errorMode to "inline" ?>
<?rev put revOpenDatabase("mysql", "localhost", "Database_Name", "User_Name_", "password") into tConId
put "'" & "400" & "'" into pNum
put "SELECT * FROM `Table_Name` WHERE StreetNumber =" && pNum into tSQL
if tConId is a number then
put revDataFromQuery(tab, return, tConID, tSQL) into tList
put tList
revCloseDatabase tConID
end if
?>
IN OTHER WORDS what am trying to do IN THE LC STACK is
on mouseup
global pNum
put "'" & "400" & "'" into pNum
put "theQuery=urlencode(myQuery)" into myQuery
post myQuery to url "http://www.mydomain.on-rev.com/NewQuery.irev"
put it into tMyResult
answer tMyResult
end mouse up
Then in the iRev File on the server named /NewQuery.irev"
<?rev set the errorMode to "inline" ?>
<?rev put revOpenDatabase("mysql", "localhost", "Database_Name", "User_Name_", "password") into tConId
global pNum ## <----THIS IS THE PART THAT IS NOT WORKING
put "SELECT * FROM `Table_Name` WHERE StreetNumber =" && pNum into tSQL
if tConId is a number then
put revDataFromQuery(tab, return, tConID, tSQL) into tList
put tList
revCloseDatabase tConID
end if
?>
Anyone? Help Bankok? I suspect globals need to be performed with the $_Get command but I can't wrap my head around it. I need a simple example showing the data being transferred from the LC desktop to the iRev script.
Dave
Dave