1
Saganxis
Get fields name using xoops class
  • 2006/11/3 17:43

  • Saganxis

  • Just popping in

  • Posts: 25

  • Since: 2006/7/20


Hi, i wanted to know if there is a way to take a list of the fields on any table using the XOOPS class.

I know i can do

function GetFieldList($DB, $Table) {
$fldlist = mysql_list_fields($DB, $Table);
$columns = mysql_num_fields($fldlist);
for ($i = 0; $i < $columns; $i++) {
$Listing[] = mysql_field_name($fldlist, $i);
}
Return ($Listing);
}

Is anyone know another way to this using the XOOPS class?

Thanks!

2
Saganxis
Re: Get fields name using xoops class
  • 2006/11/3 18:11

  • Saganxis

  • Just popping in

  • Posts: 25

  • Since: 2006/7/20


I realized that i can do

function GetFieldList($result) {
global $xoopsDB;
$columns = $xoopsDB->getFieldsNum($result);
for ($i = 0; $i < $columns; $i++) {
$Listing[] =$xoopsDB->getFieldName($result,$i);
}
return ($Listing);
}

Thanks anyway and sorry for my english

Login

Who's Online

157 user(s) are online (87 user(s) are browsing Support Forums)


Members: 0


Guests: 157


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits