How can i retrieve from database and display in my page?

How to retrieve and made changes on the data and insert new row into database?

Comments

nevets’s picture

It would probably help if you stated your problem at a higher level, that is what do you logically want to do. For example your question might run along the lines, "I want to add a new custom content type, what is the easiest way" in which case I would suggest looking at the CCK module.

johnsim’s picture

I'm trying to generate a document reference No such as SMR/EK/01-001. Example: (project code)/(module)/(month)-(incremental no). It will auto generated once a pages has been save. Work like receipt no/ invoice no.

I'm thinking of retrieveing from database , do some manupulation and insert a new row back to database.

nevets’s picture

If this is part of a custom content type and it is part of your module you could do this in the insert hook. If part of a custom content type that is not defined by your module you can use the nodeapi hook at the $op = 'insert' case. In both of these case the data (ref no) would normally be part of the content and can be easily generated and save in the approriate hook. If not a custom content type but using the forms API you could use the submit routine for your form.