[support] Inserting php block snippet into a standard node

Earnie Boyd earnie at users.sourceforge.net
Fri May 4 13:19:51 UTC 2007


Quoting Jason Flatt <drupal at oadaeh.net>:


>
> Try it this way:
>
> <?php
>  global $user;
>  $result=db_query("SELECT uid, init FROM dru_users WHERE dru_users.uid = %s",
> $user->uid);
>
>  while ($u = db_fetch_object($result)) {
>    $items[]=l($u->init, "user/" . $u->uid);
>  }
>
>  return theme('item_list',$items);
> ?>
>
> I'm assuming your database tables have a prefix, thus the "dru_" before
> the "users" in the table name.
>

Wouldn't you want to use {users} for the table name including the { } pair?

http://api.drupal.org/api/5/group/database

Earnie


More information about the support mailing list