File: popsql.pmod

package info (click to toggle)
libroxen-popdrop 1.9-5
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 92 kB
  • sloc: makefile: 39
file content (26 lines) | stat: -rw-r--r-- 534 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//
// SQL Pmod by iMil
//
// $Id: popsql.pmod,v 1.2 2000/10/24 20:24:20 kiwi Exp $
//
#define NB_FIELDS 4

array (array(string)) getuser(string db, string table)
{
  object o,r;

  o = Sql.sql(db);
  r = o->big_query("SELECT popuser,poppass,popserv,emailto FROM "+table);

  int n_queries=r->num_rows();
  array (array(string)) list=allocate(n_queries);

  for (int i=0;i<n_queries;i++) {
    array tmp=r->fetch_row();
    list[i]=allocate(NB_FIELDS);
    for (int j=0;j<NB_FIELDS;j++)
      list[i][j]=tmp[j];
  }

  return(list);
}