Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Users id  (Read 2884 times)

0 Members and 2 Guests are viewing this topic.

dquelhas

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Users id
« on: September 02, 2006, 08:49:51 pm »

Hi again,

I'm trying to retrieve the users id in the init.inc.php, but i have no returns.
Can someone help me with this?

Thanks in advance,

Dinis
Logged

dquelhas

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Users id
« Reply #1 on: September 02, 2006, 08:58:39 pm »

The query i have done is:

$results = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_USERS']}");
while ($row = mysql_fetch_array($results)) {
    echo $row['user_id'];
}

what is wrong with this?

Thanks in advance,

Dinis
Logged

dquelhas

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Users id
« Reply #2 on: September 02, 2006, 09:18:01 pm »

Hello again,

i have tryed again

$results = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_USERS']}");
while ($row = mysql_fetch_array($results)) {
    echo $CONFIG[$row['name']];
}

but no results again. Please help me.

Thanks,

Dinis
Logged

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: Users id
« Reply #3 on: September 02, 2006, 09:53:48 pm »

where did you run that code?
and also,
you have a global array for visitor:
USER_NAME has user name
USER_ID has id of user
Logged
‍I don't answer to PM with support question
Please post your issue to related board

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Users id
« Reply #4 on: September 03, 2006, 10:22:01 am »

you have a global array for visitor:
Actually, those are constants, not arrays.

However, you're suppossed to use those contants as suggested instead of running yet another query.
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 20 queries.