php-db | 2000121
Date: 12/13/00
- Next message: DEWA: "[PHP-DB] Kinda silly question"
- Previous message: Scott Mebberson: "[PHP-DB] AUTO INCREMENT - MySQL + PHP"
- Maybe in reply to: Mon Akira: "[PHP-DB] dbase_ commands dont work"
- Next in thread: Miles Thompson: "Re: [PHP-DB] dbase_ commands dont work"
- Reply: Miles Thompson: "Re: [PHP-DB] dbase_ commands dont work"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Frank is right. I have tested a program like below to read 3 Visual FoxPro's tables. (but I am sorry because the example is in Indonesian).
Regards,
Abdul Kadir
<HTML>
<HEAD>
<TITLE>Daftar Nilai</TITLE>
</HEAD>
<BODY>
<BODY LINK="#0000ff" VLINK="#800080" BACKGROUND="Image3.jpg">
<?php
//$no_mhs = "S71005 ";
$no_mhs = trim($no_mhs);
$panjang = strlen($no_mhs);
if ( !( ($panjang == 6) || ($panjang == 9)) )
{
printf("Nomor mahasiswa salah(1)<BR>\n");
return;
}
if ($panjang == 6)
{
if (! ((substr($no_mhs,0,1)=='S') || (substr($no_mhs,0,1)=='D')))
{
printf("Nomor mahasiswa salah(2)<BR>\n");
return;
}
$no_mhs = sprintf("%s ",$no_mhs);
}
$db_pribmhs = dbase_open("pribmhs.dbf", 0);
$db_mahasis = dbase_open("mahasis.dbf", 0);
$db_nilai = dbase_open("nilai.dbf", 0);
if (($db_pribmhs == False) || ($db_mahasis == False) || ($db_nilai == False))
{
printf("Maaf. untuk sementara belum berfungsi<BR>\n");
return ;
}
// Cek Status
$num_rec = dbase_numrecords($db_mahasis);
$ketemu = False;
for($index = 1; $index <= $num_rec; $index++)
{
$record = dbase_get_record($db_mahasis, $index);
if ($record[0] == $no_mhs)
{
if (($record[9]=='B') && ($record[6]=='2'))
{
$ketemu = True;
}
break;
}
}
if ($ketemu == False)
{
print("Akses data tidak diperkenankan<BR>\n");
return;
}
?>
<?php
// Cek Nama
$num_rec = dbase_numrecords($db_pribmhs);
$ketemu = False;
for($index = 1; $index <= $num_rec; $index++)
{
$record = dbase_get_record($db_pribmhs, $index);
if ($record[0] == $no_mhs)
{
print("Nama : $record[1]<BR>\n");
$ketemu = True;
break;
}
}
if ($ketemu == False)
{
print("Nomor mahasiswa ini tidak ditemukan<BR>\n");
return;
}
flush();
$current_date = getdate(time());
printf("DAFTAR NILAI Per Tanggal %d/%d/%d<BR><BR>\n",
$current_date["mday"],
$current_date["mon"],
$current_date["year"]);
// Cek Nilai
$num_rec = dbase_numrecords($db_nilai);
$nomor = 0;
for($index = 1; $index <= $num_rec; $index++)
{
$record = dbase_get_record($db_nilai, $index);
if ($record[0] == $no_mhs)
{
$nomor++;
$mk[$nomor] = $record[1];
$nilai[$nomor] = $record[2];
}
}
print("<TABLE BORDER=\"1\">\n");
if ($nomor > 0)
{
print("<TD>");
print("NO.");
print("</TD>");
print("<TD>");
print("KD. MATAKULIAH");
print("</TD>");
print("<TD>");
print("NILAI");
print("</TD>");
print("</TR>\n");
}
for ($index = 1; $index <= $nomor; $index++)
{
print("<TD>");
print($index);
print("</TD>");
print("<TD>");
print($mk[$index]);
print("</TD>");
print("<TD>");
print($nilai[$index]);
print("</TD>");
print("</TR>\n");
}
print("</TABLE>\n");
if ($nomor == 0)
{
print("Nilai untuk mahasiswa ini tidak ditemukan<BR>\n");
return;
}
printf("*** end <BR>\n");
dbase_close($db_pribmhs);
dbase_close($db_mahasis);
dbase_close($db_nilai);
?>
</BODY>
</HTML>
- Next message: DEWA: "[PHP-DB] Kinda silly question"
- Previous message: Scott Mebberson: "[PHP-DB] AUTO INCREMENT - MySQL + PHP"
- Maybe in reply to: Mon Akira: "[PHP-DB] dbase_ commands dont work"
- Next in thread: Miles Thompson: "Re: [PHP-DB] dbase_ commands dont work"
- Reply: Miles Thompson: "Re: [PHP-DB] dbase_ commands dont work"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

