While i’m creating basic page in drupal i select text format to PHP code. Now I can write PHP code here.
I want to list records from MySQL, How can I include a database-connection here?
Is it good way writing PHP code in content?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
you can directly call drupal api functions like
db_query()without adding anydbconectionin a page. Adding php codes inside a page is not recommented, try to create your own module for that or use views