Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Getting results from DB

Asked Modified Viewed 1,347 times
F
FredrikBroberg
F
  • Newbie, joined since
  • Contributed 4 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions
asked
Newbie

Why canĀ“t I get group_name from this code? :o



$data = 10;

$respons = dbquery("SELECT group_name FROM ".DB_USER_GROUPS." WHERE group_id='".$data."'"));

echo = "$respons";



All I get is "Resource id #31"
0 replies

2 posts

P
PeaceLaced
P
PHP-Fusion MAIN Support Team
PHP-Fusion USA NSS Admin
  • Member, joined since
  • Contributed 154 posts on the community forums.
  • Started 23 threads in the forums
answered
Member

Try adding dbresult function

dbresult(dbquery("SELECT group_name FROM ".DB_USER_GROUPS." WHERE group_id='".$data."'"));
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
answered
Fusioneer

Here you go...

$data = 10;

$respons = dbquery("SELECT group_name FROM ".DB_USER_GROUPS." WHERE group_id='".$data."'");

$group_data = dbarray($respons);

echo $group_data['group_name'];


EDIT on Mar 07 2014 at 22:11:25:

Want an even easier way?

echo getgroupname(10);
Edited by Jib on 08-03-2014 00:11,
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 2 posts
  • Votes 0 votes
  • Topic users 3 members

3 participants

P
P
PHP-Fusion MAIN Support Team
PHP-Fusion USA NSS Admin
  • Member, joined since
  • Contributed 154 posts on the community forums.
  • Started 23 threads in the forums
C
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
F
F
  • Newbie, joined since
  • Contributed 4 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet