-
Notifications
You must be signed in to change notification settings - Fork 2
Usage
To need to add web component to your application at the designer part
now go to block part to setup and create some blocks.
Your URL during installation
Your SQLkey in the configuration file.
All result variable : It is use by MOP
Number of rows : Variable where number of rows is stored
Procedure that will store number of rows
web component that will run our query
Run query procedure
You need to call Run Query procedure whenever you want to run a query PARAMETEER
key : The global secret key created during connecting
query : Your query, any valid SQL query
It can now be use on button click or anywhere as follow
If Your query contain parameter to bind
SELECT * FROM `table name` WHERE `id` = ?;
PARAMETEER
key : The global secret key created during connecting
query : Your query, any valid SQL query
param[] : Your parameter ( it has open and closing square bracket )
create an empty list where you want to store each column result
create a loop to store each column row
The index number is the index of your column.
if you are selecting using *
SELECT * FROM `table name` WHERE `id` = ?;
then your column index will be in order of your column in your table starting at index 1
if you are selecting using names
SELECT `name`, `email` FROM `table name` WHERE `id` = ?;
then your column index will be in order of your query starting at index 1
You can now put it at web component got text like this.
You can put some block inside procedure so it will be neater
You can check for number of rows before getting column
You can also check for number of rows for INSERT STATEMENT
If your query was successful
Respond code = 200
If there is any error
Respond code = 206
You can use the function of adding query if your query is MYSQL procedure with an out parameter
This should be use if you already know how MYSQL procedure with an out parameter works
Your query will be
When you want to run some query from your admin app with restricted column as specified in the configuration
then you can as below
passing wrong key will block the query
PARAMETEER
key : The global secret key created during connecting
query : Your query, any valid SQL query
masterkey : Your master key in your configuration
You can get the error message when respond code is 206
you can get it from respond content directly
LICENSE
Fork and feel free to pull request......
MOP is licensed under the MIT License.
Copyright 2021 Hazeezet
π³π¬ π³π¬ π³π¬ π³π¬ π³π¬ π³π¬ π³π¬ π³π¬ π³π¬ π³π¬ π³π¬ π³π¬ π³π¬ π³π¬ π³π¬ π³π¬ π³π¬ π³π¬ π³π¬ π³π¬