Since I have been studying the xoops module for the past two days, I found this good module development quick start.
After reading it, I came to the development module with great interest, but encountered some problems during the development process.
I think it's too fast to learn. Therefore, the translation is here.
====================
Author: surance Yin
Email: Suranceyin@yahoo.com.cn
Home: http://www.fltek.com.cn
========================
Chapter 8-database operations and Classes
CrudAdd, delete, modify, and query
Database Operations have four basic functions:CReate,READ,UPdate,DElete; abbreviated as crud. We previously demonstrated adding and reading. Now let's demonstrate it.
CreateAdd
$ Query = "Insert" . $ Xoopsdb -> Prefix ( "Tutorial_myform" ). "(Name, address, telephone, email) values (' $ Name ',' $ Address ',' $ Tel ',' $ Email ')" ; $ res = $ xoopsdb -> query ( $ query ); If(!$ Res){ Echo"Error:$ Query"; } |
ReadRead
$ Query = $ Xoopsdb -> Query ( 'Select * from' . $ Xoopsdb -> Prefix ( 'Tutorial _ myform' ) "Where id =' $ Myid '" ); $ myrow = $ xoopsdb -> fetcharray ( $ query ); $ Name=$ Myrow['Name']; $ Ad |