[support] PHP custom code in drupal block / node

garyl lists at luminosity.co.uk
Sat Apr 18 13:44:59 UTC 2009


use db_query() or db_fetch_object() instead of the mysql equivalents

http://api.drupal.org/api/function/db_query

Nikhil Kala wrote:
> 
> On Sat, Apr 18, 2009 at 5:27 PM, garyl <lists at luminosity.co.uk 
> <mailto:lists at luminosity.co.uk>> wrote:
> 
>     normal php code in <?php ?> tags is fine
> 
> But if I want to display the list of the user registered with the site, 
> I need to fetch the values from the users table. In that case how do I 
> connect to the database first?
> 
> Do I need to include setting.php file ?
>  
> 
> 
> 
>     Nikhil Kala wrote:
> 
>         Hello All,
> 
>         This might be very easy question for some of you, I want to
>         display database values into the php block / node
>         How I can do this?
> 
>         Can I user normal php coding same in drupal block OR I need to
>         do any extra steps for it.
> 
> 
> 
>         Warm Regards,
>         Nikhil Kala
>         http://www.nikhilkala.com
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> --
> [ Drupal support list | http://lists.drupal.org/ ]



More information about the support mailing list