hi, i am working on a developing a website in drupal 7...
i have a doubt that should i change the database using db queries in my own custom module, or should i call any function in existing modules which can do so???

Comments

vm’s picture

depends on what you are doing. To answer this question more context is needed.

sluggo’s picture

for eg: i want to add a new field to a login form. i made a custom module to do that. should my module handle database using database queries or should i call any function in existing modules which can do so(which can add the tables or fields required and manage them automatically)???

jaypan’s picture

Drupal 7 core already provides the ability to add fields to the user profile. You don't even need a custom module for this. Navigate to admin -> Configuration -> People -> Account settings, and click the 'manage fields' tab.

If you need different user types, check out the profile2 module.

Contact me to contract me for D7 -> D10/11 migrations.

sluggo’s picture

@Jaypan: thanx :-)

yashdv’s picture

I am having a similar problem. I want to know how can we use the newly added field in validating the log in of any user. I mean a successful log in should occur only if the all the three parameters (username, password, "new field") are correct and correspond to each other.

Can this be done using alter/hooks or modifying the core "user" modules ?

chrisrockwell’s picture