本文整理汇总了PHP中mysql_class::ex_sql方法的典型用法代码示例。如果您正苦于以下问题:PHP mysql_class::ex_sql方法的具体用法?PHP mysql_class::ex_sql怎么用?PHP mysql_class::ex_sql使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mysql_class
的用法示例。
在下文中一共展示了mysql_class::ex_sql方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadByName
public function loadByName($name)
{
if (trim($name) != '') {
$name = trim($name);
$mysql = new mysql_class();
$ln1 = $mysql->ex_sqlx("insert into shahr_tmp (name) values ('{$name}') ", FALSE);
$tmp_id = $mysql->insert_id($ln1);
$mysql->close($ln1);
$mysql->ex_sql("select name from shahr_tmp where id = {$tmp_id}", $q1);
if (isset($q1[0])) {
$name = $q1[0]['name'];
}
$mysql->ex_sqlx("delete from shahr_tmp where id = {$tmp_id}");
$mysql->ex_sql("select * from shahr where name='{$name}'", $q);
if (isset($q[0])) {
$r = $q[0];
$this->id = $q[0]['id'];
$this->name = $q[0]["name"];
$this->en_name = $q[0]["en_name"];
} else {
$ln = $mysql->ex_sqlx("insert into shahr (name) values ('{$name}') ", FALSE);
$this->id = $mysql->insert_id($ln);
$this->name = $name;
$mysql->close($ln);
}
}
}
示例2: __construct
public function __construct($id = -1)
{
$id = (int) $id;
mysql_class::ex_sql("select * from `reserve_tmp` where `id` = {$id}", $q);
if ($r = mysql_fetch_array($q)) {
$this->id = $r['id'];
$this->parvaz_det_id = $r['parvaz_det_id'];
$this->tarikh = $r['tarikh'];
$this->tedad = $r['tedad'];
$this->customer_id = $r['customer_id'];
$this->zakhire = $r['zakhire'];
$this->zarfiat = $r['zarfiat'];
$this->timeout = $r['timeout'];
$this->adlprice = $r['adlprice'];
$this->chdprice = $r['chdprice'];
$this->infprice = $r['infprice'];
$this->adltedad = $r['adltedad'];
$this->chdtedad = $r['chdtedad'];
$this->inftedad = $r['inftedad'];
$this->netlog = $r['netlog'];
$this->rwaitlog = $r['rwaitlog'];
if ($r['info'] != '' && $r['info'] != null) {
$this->info = unserialize($r['info']);
}
}
}
示例3: load_tickets
function load_tickets($user, $pass, $sanad_record_ids)
{
$tmp_arr = array();
$my = new mysql_class();
$u = new user_class();
$u->loadByUser($user);
$customer_id = $u->customer_id;
$my->ex_sql("select * from ticket where customer_id={$customer_id} and sanad_record_id in ({$sanad_record_ids})", $q);
foreach ($q as $r) {
$tick = new ticket_class();
//$tick->id = (int)$r['id'];
unset($tick->sanad_record_id);
$tick->fname = $r["fname"];
$tick->lname = $r["lname"];
$tick->tel = $r["tel"];
$tick->adult = (int) $r["adult"];
$tick->rahgiri = (int) $r["sanad_record_id"];
$tick->parvaz_det_id = (int) $r["parvaz_det_id"];
$tick->customer_id = (int) $r["customer_id"];
$tick->user_id = (int) $r["user_id"];
$tick->shomare = (int) $r["shomare"];
$tick->typ = (int) $r["typ"];
$tick->en = (int) $r["en"];
$tick->regtime = $r["regtime"];
$tick->mablagh = (int) $r["mablagh"];
$tick->tour_mablagh = (int) $r["tour_mablagh"];
$tick->poorsant = (int) $r["poorsant"];
$tick->gender = (int) $r["gender"];
$tmp_arr[] = $tick;
}
$out = xml_class::export($tmp_arr);
return $out;
}
示例4: __construct
public function __construct($app = conf::app)
{
mysql_class::ex_sql("select * from `admin` where `app` = '{$app}'", $q);
while ($r = mysql_fetch_array($q)) {
$this->data[] = $r['content'];
}
}
示例5: add_item
function add_item()
{
$fields = array();
foreach ($_REQUEST as $key => $value) {
if (strpos($key, "new_") === 0 && $key != "new_id" && $key != "new_en") {
$fields[substr($key, 4)] = $value;
}
}
$min_ticket = 0;
mysql_class::ex_sql("select MAX(`max_ticket`) as `minticket` from `customers`", $q);
if ($r = mysql_fetch_array($q)) {
$min_ticket = (int) $r["minticket"];
}
$min_ticket++;
$max_ticket = 0;
$max_ticket = $min_ticket + 999;
$fields["min_ticket"] = $min_ticket;
$fields["max_ticket"] = $max_ticket;
$fi = "(";
$va = "(";
foreach ($fields as $key => $value) {
$fi .= "`{$key}`,";
$va .= "'{$value}',";
}
$fi = substr($fi, 0, -1);
$va = substr($va, 0, -1);
$fi .= ")";
$va .= ")";
$query = "insert into `customers` {$fi} values {$va}";
mysql_class::ex_sqlx($query);
}
示例6: firstVisit
public function firstVisit(&$ses, $req)
{
$out = TRUE;
$conf = new conf();
//var_dump($ses);
//echo "<br/>";
//var_dump($req);
//echo "<br/>";
$firstVisit = isset($ses[$conf->app . "_login"]) && $ses[$conf->app . "_login"] == 1 && isset($req["user"]);
//var_dump($firstVisit);
//echo "<br/>";
$mysql = new mysql_class();
if ($firstVisit) {
$user = $req["user"];
$pass = md5($req["pass"]);
$out = FALSE;
$mysql->ex_sql("select `id`,`typ`,`pass`,`customer_id` from user where user = '" . $user . "'", $q);
if (isset($q[0])) {
$r_u = $q[0];
if ($pass == $r_u["pass"]) {
$ses[$conf->app . "_user_id"] = (int) $r_u["id"];
$ses[$conf->app . "_typ"] = (int) $r_u['typ'];
$ses[$conf->app . "_customer_id"] = (int) $r_u['customer_id'];
$out = TRUE;
}
}
} else {
if (isset($req["user"]) && isset($_REQUEST['pass']) && $req['user'] == 'test' && $req['pass'] == 'test') {
$user = $req["user"];
$pass = md5($req["pass"]);
$out = FALSE;
//echo "select `id`,`typ`,`pass`,`customer_id` from user where user = '".$user."'<br/>";
$mysql->ex_sql("select `id`,`typ`,`pass`,`customer_id` from user where user = '" . $user . "'", $q);
//var_dump($q);
if (isset($q[0])) {
$r_u = $q[0];
if ($pass == $r_u["pass"]) {
$ses[$conf->app . "_user_id"] = (int) $r_u["id"];
$ses[$conf->app . "_typ"] = (int) $r_u['typ'];
$ses[$conf->app . "_customer_id"] = (int) $r_u['customer_id'];
$out = TRUE;
}
}
}
}
return $out;
}
示例7: edit_item
function edit_item($id, $field, $value)
{
$parvaz_det_id = $GLOBALS['parvaz_det_id'];
mysql_class::ex_sql('select `id` from `parvaz_jid` where `parvaz_det_id` = ' . $parvaz_det_id . ' and `jid` = ' . $value, $q);
if (!($r = mysql_fetch_array($q))) {
mysql_class::ex_sqlx('update `parvaz_jid` set `jid` = ' . $value . ' where `id` = ' . $id);
}
}
示例8: loadCustomer
function loadCustomer()
{
$out = '';
mysql_class::ex_sql("select `id`,`name` from `customers` where `en` = 1 order by `name` ", $q);
while ($r = mysql_fetch_array($q)) {
$out[$r['name']] = $r['id'];
}
return $out;
}
示例9: decreaseSms
public function decreaseSms($number, $user_id, $sanad_record_id, $status)
{
mysql_class::ex_sql("select `id` from `sms_charge` where `cont`<`maxi` order by `id` limit 1 ", $q);
if ($r = mysql_fetch_array($q)) {
mysql_class::ex_sqlx('update `sms_charge` set `cont`=`cont`+1 where `id`=' . $r['id']);
}
//---------------------------------------------------------
mysql_class::ex_sqlx("insert into `sms` (`number`,`user_id`,`sanad_record_id`,`sent`) values ('{$number}','{$user_id}','{$sanad_record_id}','{$status}')");
}
示例10: epass
function epass($cid)
{
$out = "";
mysql_class::ex_sql("select `epass` from `customers` where `id`='{$cid}'", $q);
if ($r = mysql_fetch_array($q)) {
$out = $r["epass"];
}
return $out;
}
示例11: setDetByAcc
function setDetByAcc($grp_id, $page_name, $frase)
{
mysql_class::ex_sql("select `id` from `access` where `page_name`='{$page_name}' and `group_id`='{$grp_id}' ", $q);
if ($r = mysql_fetch_array($q)) {
if ($r['id'] > 0) {
mysql_class::ex_sqlx("insert into `access_det` (`acc_id`,`frase`) values('" . $r['id'] . "','{$frase}') ");
}
}
}
示例12: loadCustomerName
function loadCustomerName()
{
$out = null;
mysql_class::ex_sql('select `name`,`id` from `customers` order by `name`', $q);
while ($r = mysql_fetch_array($q)) {
$out[$r['name']] = (int) $r['id'];
}
return $out;
}
示例13: loadGroups
function loadGroups()
{
$out = array();
$mysql = new mysql_class();
$mysql->ex_sql('select `name`,`id` from `grop` where `en`=1 order by `name`', $q);
foreach ($q as $r) {
$out[$r['name']] = (int) $r['id'];
}
return $out;
}
示例14: sanadJam
function sanadJam($where = '')
{
$out = array("sum_mablagh" => 0);
$mysql = new mysql_class();
$mysql->ex_sql("select sum(`mablagh`) as `sm` from `customer_daryaft` " . ($where != '' ? " where {$where}" : ''), $q);
if (isset($q[0])) {
$out = array("sum_mablagh" => (int) $q[0]['sm']);
}
return $out;
}
示例15: loadSherkatName
function loadSherkatName($inp)
{
$inp = (int) $inp;
$out = "";
mysql_class::ex_sql("select `name` from `sherkat` where `id` = '{$inp}'", $q);
if ($r = mysql_fetch_array($q)) {
$out = $r["name"];
}
return $out;
}