本文整理汇总了PHP中dbconnection::execute方法的典型用法代码示例。如果您正苦于以下问题:PHP dbconnection::execute方法的具体用法?PHP dbconnection::execute怎么用?PHP dbconnection::execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dbconnection
的用法示例。
在下文中一共展示了dbconnection::execute方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: changepassword
function changepassword($userid, $oldpass, $newpass, $newpassrepeat)
{
if ($newpass == $newpassrepeat) {
$enc = new Encryption();
$db = new dbconnection();
$db->dbconnect();
//check oldpass, update password if ok, send message if not
$password = $enc->oneway_encode($oldpass);
$db->query = "select userid from " . TABLE_USERS . " where userid={$userid} and password='{$password}'";
$db->execute();
if ($db->rowcount() > 0) {
$newpass = $enc->oneway_encode($newpass);
$db->query = "update " . TABLE_USERS . " set password='{$newpass}' where userid={$userid}";
$db->execute();
$msg = 'Password updated.';
} else {
$msg = 'Incorrect old password.';
}
} else {
$msg = 'New password does not match.';
}
return $msg;
}
示例2: preload_lists
function preload_lists()
{
$db = new dbconnection();
$db->dbconnect();
$db->query = "select listid,listname from " . TABLE_LISTS . " where active=1";
$db->execute();
$rowcount = $db->rowcount();
if ($rowcount > 0) {
for ($x = 0; $x < $rowcount; $x++) {
$row = $db->fetchrow($x);
$list[$x] = $row;
}
}
return $list;
}
示例3: dbconnection
<?php
require_once '../../includes/dbase.php';
require_once '../../includes/settings.php';
$db = new dbconnection();
$db->dbconnect();
isset($_REQUEST['agent']) ? $agent = $_REQUEST['agent'] : exit;
isset($_REQUEST['leadid']) ? $leadid = $_REQUEST['leadid'] : exit;
$total = count($_FILES['upload']['name']);
// Loop through each file
for ($i = 0; $i < $total; $i++) {
$tmpFilePath = $_FILES['upload']['tmp_name'][$i];
if ($tmpFilePath != "") {
$filename = $leadid . ' - ' . $_FILES["upload"]['name'][$i];
$newFilePath = "../../uploads/{$filename}";
//Upload the file into the temp dir
if (move_uploaded_file($tmpFilePath, $newFilePath)) {
$db->query = "\n insert into " . TABLE_FILES . "\n (leadid,filename,dateuploaded,agent)\n values\n ({$leadid},'{$filename}',now(),{$agent})\n ";
$db->execute();
echo 'File <a href="uploads/' . $filename . '" target="_blank">' . $filename . ' uploaded.</a><br>';
} else {
echo 'Failed to upload file ' . $filename;
}
}
}