Skip to content
Hazeezet edited this page Nov 18, 2021 · 2 revisions

connecting

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

URL

Your SQLkey in the configuration file.

SQL key

All result variable : It is use by MOP

mop-aiv_3

Number of rows : Variable where number of rows is stored

mop-aiv_4

Procedure that will store number of rows

mop-aiv_5

web component that will run our query

mop-aiv_6

Run query procedure

mop-aiv_7

Run a query

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

mop-aiv_8

It can now be use on button click or anywhere as follow mop-aiv_9

Bind parameter

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 )

mop-aiv_10

Get column

create an empty list where you want to store each column result

mop-aiv_11

create a loop to store each column row

mop-aiv_12

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 mop-aiv_13

Number of rows

You can check for number of rows before getting column

You can also check for number of rows for INSERT STATEMENT

mop-aiv_14

Responds code

If your query was successful

Respond code = 200

If there is any error

Respond code = 206

Add query

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

mop-aiv_15

Master key

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

mop-aiv_16

Show error

You can get the error message when respond code is 206

you can get it from respond content directly

mop-aiv_17

Clone this wiki locally