15-5. 论坛系统-父板块展示、删除

Forum father modules display and deletion

 

How to increase the quality of user experience in processing the data queried from the database?

In fact, the data queried from database need to be processed and transfer to the common type which

can be accepted easily by users. Firstly, use html delimiter [dɪ'lɪmɪtɚ] 定界符 "<<<A” to assign html code to a variable

and echo the variable. This way is better for printing html code and do not need to use escape function.

And the php code also can be written in the html code.

Secondly, we need to replace the fixed value with dynamic data from database. For example,

There are many different module names in the system and each module have different id.

So we should use variable(array,object) to replace the fixed value.

 

How to delete a father_module and how to increase the quality of user experience

in deleting father_module from database?

The function of deleting the father module can be realized by a php file which we can use the SQL

deletion statement to finish the task. As we know, each father module has the special id, so we can

transfer the id from father_module.php to the father_module_delete.php through the method of “GET”.

The process is that  add “?id” as a sender behind the php file father_module_delete.php, and use

variable “$_GET” as a receiver to receive the data in file father_module_delete.php.

At last, process the id by SQL statement.

 

  • Give a prompt for users whether they decide to delete the father module or not when they click the delete button.
  • The page need to return to the previous page after finishing the task of deletion.
  • Prompt users when incorrect operation was executed.

 

Brief summary on data transmission type:

So far, the data queried from database is in the type of array. The data are stored as the type of array

when we store data into database table. They are stored as the type of associative array in database

not like the indexed array in other programming language. So they are all shown as the associative array

when we var_dump the data from database or $_GET the data.

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值