분류
php
Access Style DLookup function for MySQL
본문
function
DLookup($fld, $tab, $whr)
{
$q =
"Select $fld from $tab where $whr"
;
$rst = mysql_query($q);
if
($row = mysql_fetch_object($rst))
return
$row->$fld;
else
return
NULL;
}
// ex: lookup a customer name based on $customerid
$name = DLookup(
"Name"
,
"Customer"
,
"Id=$customerid"
);
- 이전글PHP Snippets 18.08.31
- 다음글CSV Export 18.08.31