Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
include 'class_mdb.php';
$mdb = new mdb('mymdbfile.mdb');
$mdb->execute('show tables;');
$aTables = array();
$npp = 1;
while( !$mdb->eof() )
{
$aTables[] = $mdb->fieldvalue(1);
echo "$npp " . $mdb->fieldvalue(0) . ' ' . $mdb->fieldvalue(1) . ' ' . $mdb->fieldvalue(2);
$mdb->movenext();
}
print_r $aTables;
нужен код, который вытаскивает список таблиц, а также ключевые поля из таблицы. как реализовать?
function GetTableFields($TableName) {
$arr=array(Null, Null, Null, "TABLE");
$rs=$this->ADODB->OpenSchema(20, $arr);
if(!$rs->eof()){
while(!$rs->eof()){
$result_arr[]=$rs->fields[2]->value;
$rs->movenext();
}
} else {
$result_arr=false;
}
}
include 'class_mdb.php';
$mdb = new mdb('mymdbfile.mdb');
$aFields = $mdb->GetTableFields('mytable');
print_r $aFields;
function GetTableFields($TableName) {
$arr=array(Null, Null, Null, "TABLE");
$rs=$this->ADODB->OpenSchema(20, $arr);
if(!$rs->eof()){
while(!$rs->eof()){
$field_name = $rs->fields['COLUMN_NAME']->value;
$field_name2 = $rs->fields[2]->value;
$field_propid = $rs->fields['COLUMN_PROPID']->value;
$field_ord = $rs->fields['ORDINAL_POSITION']->value;
$field_flags = $rs->fields['COLUMN_FLAGS']->value;
$result_arr[]= "name=$field_name name2=$field_name propid=$field_propid ord=$field_ord flags=$field_flags";
$rs->movenext();
}
} else {
$result_arr=false;
}
}
include 'class_mdb.php';
$mdb = new mdb('mymdbfile.mdb');
$aFields = $mdb->GetTableFields('mytable');
print_r($aFields);