Variable isn't recognized(or brain freeze)
Posted: Sat Nov 03, 2012 3:53 pm
I'm JUST starting with on-rev scripting so I'm guessing the answer to my question is something very simple and basic.
I'm using 2 irev files with a form on each to go to a 3rd page which will display(hopefully) a large table with data from a mySQL database table.
The 1st form produces say "Team Stats"(user selected of 2 options) in $_GET["whichtypestats"] and the 2nd form produces say "b_fall_division_players"(user selected of 6 options) in $_GET["division"] I can "print" both variables on the 3rd page. The b_fall_division_players is the name of a table in my on-Rev database.
This is part of the URL on the 3rd page:
whichtypestats=team+stats&division=b_fall_division_players<p&submit=Get+The+Stats
The 3rd page uses an include file which has 6 if-then statements that try to create an SQL statement which will pick the appropriate table(b_fall_division_players")
One of the 6(the user can choose from 6 options) statements looks like this:
if $_GET["division"] = "b_fall_division_players" then
put "SELECT * FROM b_fall_division_players;" into tsql
end if
The statement doesn't execute and I get: revdberr,Query was empty
If I comment out like the below, the Query is successful and the data is put into a table on the 3rd page:
--if $_GET["division"] = "b_fall_division_players" then
put "SELECT * FROM b_fall_division_players;" into tsql
--end if
I posted this question on the on-Rev forum but that forum seems to be abandoned by livecode developers.
This has to be something simple?
I'm using 2 irev files with a form on each to go to a 3rd page which will display(hopefully) a large table with data from a mySQL database table.
The 1st form produces say "Team Stats"(user selected of 2 options) in $_GET["whichtypestats"] and the 2nd form produces say "b_fall_division_players"(user selected of 6 options) in $_GET["division"] I can "print" both variables on the 3rd page. The b_fall_division_players is the name of a table in my on-Rev database.
This is part of the URL on the 3rd page:
whichtypestats=team+stats&division=b_fall_division_players<p&submit=Get+The+Stats
The 3rd page uses an include file which has 6 if-then statements that try to create an SQL statement which will pick the appropriate table(b_fall_division_players")
One of the 6(the user can choose from 6 options) statements looks like this:
if $_GET["division"] = "b_fall_division_players" then
put "SELECT * FROM b_fall_division_players;" into tsql
end if
The statement doesn't execute and I get: revdberr,Query was empty
If I comment out like the below, the Query is successful and the data is put into a table on the 3rd page:
--if $_GET["division"] = "b_fall_division_players" then
put "SELECT * FROM b_fall_division_players;" into tsql
--end if
I posted this question on the on-Rev forum but that forum seems to be abandoned by livecode developers.
This has to be something simple?