By riwaj on
I couldn't generate a custom view to meet my requirement, so I opted to write query myself but I had problems in making own module. Is there something magical that can execute my sql query and generate a result page.
I couldn't generate a custom view to meet my requirement, so I opted to write query myself but I had problems in making own module. Is there something magical that can execute my sql query and generate a result page.
Comments
Magic
Little bit of magic
First, ya gotta learn how to create a module. There's tutorials for that.
Then, write the code.
Here is the part of code that, for me, queries the database for products sold in e-commerce and display a list of 'em.
Check it out. THe basic way to do it is to create a string that represents your sql query ("$querylist"), execute it ($queryResult = db_query($query);) and then parse the result ($links = db_fetch_object($queryResult)))
Hope this gets you started.
:)
Another important page to
Another important page to read:
Writing secure code
--
The Manual | Troubleshooting FAQ | Tips for posting | How to report a security issue.
Point taken
The sample I posted was very primitive and preliminary. Virtually no effort at security was included. The advice Heine gives is good.
:)
i think i got it!
let me try out first, thanks for your help!
this is good. but have a
this is good. but have a look at theme_table, rather than hard-coding the html table in your module:
http://api.drupal.org/api/function/theme_table/5
London Drupal Developer