本文整理汇总了PHP中toRow函数的典型用法代码示例。如果您正苦于以下问题:PHP toRow函数的具体用法?PHP toRow怎么用?PHP toRow使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了toRow函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getMainpic
function getMainpic($gid)
{
global $db;
$q = "SELECT * FROM {$this->table_name} WHERE gallery_id = '{$gid}' AND photo_mainpic = 1 LIMIT 0,1";
$obj = $db->query($q, 1);
$this->fill(toRow($obj));
}
示例2: getLatestNewsFeature
public function getLatestNewsFeature()
{
global $db;
$q = "SELECT * FROM {$this->table_name} WHERE ID!=1 AND ID!=6 AND post_image !='' ORDER BY post_modified DESC LIMIT 0,1";
$obj = $db->query($q, 1);
$this->fill(toRow($obj));
}
示例3: getLastCommentByID
public function getLastCommentByID($wid)
{
global $db;
$q = "SELECT {$this->default_read_coloms} FROM {$this->table_name} WHERE wid = '{$wid}' ORDER BY c_date DESC LIMIT 0,1";
$obj = $db->query($q, 1);
$this->fill(toRow($obj));
}
示例4: getDefaultChannel
public function getDefaultChannel()
{
global $db;
$q = "SELECT * FROM {$this->table_name} WHERE channel_default = 1 LIMIT 0,1";
$obj = $db->query($q, 1);
$this->fill(toRow($obj));
}
示例5: getLastReply
public function getLastReply($id)
{
global $db;
$q = "SELECT * FROM {$this->table_name} WHERE inbox_id = '{$id}' ORDER BY inbox_createdate DESC LIMIT 0,1";
$obj = $db->query($q, 1);
$row = toRow($obj);
$this->fill($row);
}
示例6: getSelfAndAccount
public function getSelfAndAccount($id)
{
global $db;
$acc = new Account();
$q = "SELECT {$this->default_read_coloms} FROM {$this->table_name},{$acc->table_name} WHERE account_id = '{$id}' AND admin_id = account_id";
$obj = $db->query($q, 1);
$row = toRow($obj);
$this->fill($row);
}
示例7: myHomeroomTeacher
public function myHomeroomTeacher()
{
$ta = TahunAjaran::ta();
$kelas = Account::getMyKelas($ta);
$guru = new Guru();
$row = $guru->getHomeroomFromKelas($ta, $kelas->kelas_id);
$guru->fill(toRow($row));
//pr($guru);
Mold::both("leap/homeroom_widget", array("guru" => $guru, "kelas" => $kelas));
}
示例8: saveFromJS
public function saveFromJS()
{
$user = json_decode($_POST['user']);
//pr($user);
$fb = new FBUser();
$fb->fill(toRow($user));
//pr($fb);
$fb->save();
$fb->saveToSession();
}
示例9: getLatest
public function getLatest($begin = 0, $limit = 20)
{
global $db;
$q = "SELECT * FROM {$this->table_name} ORDER BY wall_update DESC LIMIT {$begin},{$limit}";
$muridkelas = $db->query($q, 2);
$newMurid = array();
$classname = get_called_class();
foreach ($muridkelas as $databasemurid) {
$m = new WallPortal();
$m->fill(toRow($databasemurid));
$newMurid[] = $m;
}
return $newMurid;
}
示例10: getWhereFromMultipleTable
public function getWhereFromMultipleTable($whereClause, $arrTables = array(), $selectedColom = "*")
{
global $db;
//implode the tables
if (count($arrTables) < 1) {
die("please use normal getWhere");
}
foreach ($arrTables as $tableClassname) {
$m = new $tableClassname();
$imp[] = $m->table_name;
}
$implode = implode(",", $imp);
$q = "SELECT {$selectedColom} FROM {$this->table_name},{$implode} WHERE {$whereClause}";
$muridkelas = $db->query($q, 2);
$newMurid = array();
$classname = get_called_class();
foreach ($muridkelas as $databasemurid) {
$m = new $classname();
$m->fill(toRow($databasemurid));
$newMurid[] = $m;
}
return $newMurid;
}
示例11: getByMyChannels
public function getByMyChannels($array_channels, $sort = "")
{
//pr($array_channels);
if (count($array_channels) < 1) {
return array();
}
$strpp = array();
foreach ($array_channels as $chn) {
$strpp[] = " webapps_channel_id = '{$chn}' ";
}
$imp = implode(" OR ", $strpp);
//echo $imp;
global $db;
$q = "SELECT {$this->default_read_coloms} FROM {$this->table_name} WHERE ({$imp}) {$sort}";
$muridkelas = $db->query($q, 2);
$newMurid = array();
$classname = get_called_class();
foreach ($muridkelas as $databasemurid) {
$m = new $classname();
$m->fill(toRow($databasemurid));
$newMurid[] = $m;
}
return $newMurid;
}
示例12: toRow
var data = [
<?php
function toRow($array)
{
$string = "['{$array['0']}'";
for ($i = 1; $i < count($array); $i++) {
$string = $string . ",'" . $array[$i] . "'";
}
$string = $string . "]";
return $string;
}
foreach ($resultarray as $key => $value) {
if ($key == 0) {
echo toRow($value);
} else {
echo "," . toRow($value);
}
}
?>
];
var store = new Ext.data.Store({
proxy: new Ext.data.MemoryProxy(data),
reader: new Ext.data.ArrayReader({}, [
{name: 'fenxi'}
<?php
for ($i = 0; $i < count($row); $i++) {
echo ",{name: '{$i}'}";
}
示例13: sync_articletagging
function sync_articletagging()
{
$token = IMBAuth::createOAuth();
$url = "http://localhost:8888/tbsecom/LLProdWeb/LL_ArticleTagging_wbase?cmd=ws&mws=getall&token=" . $token;
// echo $url;
// pr($_POST);
$contents = file_get_contents($url);
// pr($contents);
$obj = json_decode($contents);
// pr($obj);
// $nn = new MProdModel();
// global $db;
// $db->query("UPDATE {$nn->table_name} SET prod_active = 0",1);
if ($_POST['radio'] == "truncate") {
$nn = new MArticleTagging();
$nn->truncate();
}
// pr($obj);
$num = 0;
$gagal = 0;
$gagalArr = array();
foreach ($obj->results as $new) {
$nn = new MArticleTagging();
$nn->fill(toRow($new));
// $nn->prod_active = 1;
if ($nn->save(1)) {
$num++;
} else {
$gagal++;
$gagalArr = $new->rel_id;
}
}
$json['success'] = $num;
$json['failed'] = $gagal;
$json['failed_arr'] = $gagalArr;
echo json_encode($json);
die;
}
示例14: getAllMyKelas
public function getAllMyKelas()
{
global $db;
$kelas = new Kelas();
$q = "SELECT kelas_id,kelas_tingkatan,kelas_name,mk_ta_id FROM {$this->table_murid_kelas},{$kelas->table_name} WHERE mk_murid_id = '{$this->murid_id}' AND mk_kelas_id = kelas_id ORDER BY mk_ta_id ASC";
//echo $q;
$muridkelas = $db->query($q, 2);
//pr($muridkelas);
$newMurid = array();
foreach ($muridkelas as $databasemurid) {
$m = new Kelas();
$m->fill(toRow($databasemurid));
$newMurid[] = $m;
}
return $newMurid;
}
示例15: loadByUserLogin
public function loadByUserLogin()
{
//get parameters
$username = $this->admin_username;
$password = $this->admin_password;
$rememberme = $this->rememberme;
$ldap = $this->admin_ldap;
//checksyarat
if (!isset($username) || !isset($password)) {
Redirect::loginFailed();
}
//load from db
global $db;
if (!$ldap) {
$sql = "SELECT * FROM {$this->table_name} WHERE admin_username = '{$username}' AND admin_password = '{$password}' AND admin_aktiv = 1 ";
} else {
$sql = "SELECT * FROM {$this->table_name} WHERE admin_username = '{$username}' AND admin_aktiv = 1 ";
}
$obj = $db->query($sql, 1);
$row = toRow($obj);
$this->fill($row);
if (isset($this->admin_id)) {
$_SESSION["admin_session"] = 1;
$_SESSION["account"] = $obj;
//Update setlastlogin
return self::setLastUpdate($_SESSION["account"]->admin_id);
} else {
return 0;
}
}