}
// We now have some contact, so we fetch it
- $importer = DBA::fetch_first("SELECT *, `name` as `senderName`
+ $importer = DBA::fetchFirst("SELECT *, `name` as `senderName`
FROM `contact`
WHERE NOT `blocked` AND `id` = ? LIMIT 1",
$contact['id']);
}
// We now have some contact, so we fetch it
- $importer = DBA::fetch_first("SELECT *, `name` as `senderName`
+ $importer = DBA::fetchFirst("SELECT *, `name` as `senderName`
FROM `contact`
WHERE NOT `blocked` AND `id` = ? LIMIT 1",
$cid);
$publish = (Config::get('system', 'publish_all') ? '' : " AND `publish` = 1 " );
- $cnt = DBA::fetch_first("SELECT COUNT(*) AS `total` FROM `profile`
+ $cnt = DBA::fetchFirst("SELECT COUNT(*) AS `total` FROM `profile`
LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid`
WHERE `is-default` $publish AND NOT `user`.`blocked` AND NOT `user`.`account_removed` $sql_extra");
if (DBM::is_result($cnt)) {
$nickname = str_replace(normalise_link(System::baseUrl())."/profile/", "", normalise_link($profiledata["url"]));
if (($nickname != $a->user["nickname"])) {
- $profile = DBA::fetch_first("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile`
+ $profile = DBA::fetchFirst("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile`
INNER JOIN `contact` on `contact`.`uid` = `profile`.`uid` INNER JOIN `user` ON `profile`.`uid` = `user`.`uid`
WHERE `user`.`nickname` = ? AND `profile`.`is-default` AND `contact`.`self` LIMIT 1",
$nickname
$this->mode |= App::MODE_DBAVAILABLE;
- if (DBA::fetch_first("SHOW TABLES LIKE 'config'") === false) {
+ if (DBA::fetchFirst("SHOW TABLES LIKE 'config'") === false) {
return;
}
$networkname = str_replace($search, $replace, $s);
if ((in_array($s, [NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS])) && ($profile != "")) {
- $r = DBA::fetch_first("SELECT `gserver`.`platform` FROM `gcontact`
+ $r = DBA::fetchFirst("SELECT `gserver`.`platform` FROM `gcontact`
INNER JOIN `gserver` ON `gserver`.`nurl` = `gcontact`.`server_url`
WHERE `gcontact`.`nurl` = ? AND `platform` != ''", normalise_link($profile));
if ($max == 0) {
// the maximum number of possible user connections can be a system variable
- $r = DBA::fetch_first("SHOW VARIABLES WHERE `variable_name` = 'max_user_connections'");
+ $r = DBA::fetchFirst("SHOW VARIABLES WHERE `variable_name` = 'max_user_connections'");
if (DBM::is_result($r)) {
$max = $r["Value"];
}
// We will now check for the system values.
// This limit could be reached although the user limits are fine.
- $r = DBA::fetch_first("SHOW VARIABLES WHERE `variable_name` = 'max_connections'");
+ $r = DBA::fetchFirst("SHOW VARIABLES WHERE `variable_name` = 'max_connections'");
if (!DBM::is_result($r)) {
return false;
}
if ($max == 0) {
return false;
}
- $r = DBA::fetch_first("SHOW STATUS WHERE `variable_name` = 'Threads_connected'");
+ $r = DBA::fetchFirst("SHOW STATUS WHERE `variable_name` = 'Threads_connected'");
if (!DBM::is_result($r)) {
return false;
}
* @param string $sql SQL statement
* @return array first row of query
*/
- public static function fetch_first($sql) {
+ public static function fetchFirst($sql) {
$params = self::getParam(func_get_args());
$stmt = self::p($sql, $params);
$sql = "SELECT COUNT(*) AS `count` FROM `".$table."`".$condition_string;
- $row = self::fetch_first($sql, $condition);
+ $row = self::fetchFirst($sql, $condition);
return $row['count'];
}
{
$return = 0;
if (intval($gid)) {
- $contacts = DBA::fetch_first('SELECT COUNT(*) AS `count`
+ $contacts = DBA::fetchFirst('SELECT COUNT(*) AS `count`
FROM `contact`
INNER JOIN `group_member`
ON `contact`.`id` = `group_member`.`contact-id`
// Does the given user have this item?
if ($uid) {
- $item = DBA::fetch_first("SELECT `item`.`id`, `user`.`nickname` FROM `item`
+ $item = DBA::fetchFirst("SELECT `item`.`id`, `user`.`nickname` FROM `item`
INNER JOIN `user` ON `user`.`uid` = `item`.`uid`
WHERE `item`.`visible` AND NOT `item`.`deleted` AND NOT `item`.`moderated`
AND `item`.`guid` = ? AND `item`.`uid` = ?", $guid, $uid);
// Or is it anywhere on the server?
if ($nick == "") {
- $item = DBA::fetch_first("SELECT `item`.`id`, `user`.`nickname` FROM `item`
+ $item = DBA::fetchFirst("SELECT `item`.`id`, `user`.`nickname` FROM `item`
INNER JOIN `user` ON `user`.`uid` = `item`.`uid`
WHERE `item`.`visible` AND NOT `item`.`deleted` AND NOT `item`.`moderated`
AND NOT `item`.`private` AND `item`.`wall`
$profile = null;
if ($profile_id) {
- $profile = DBA::fetch_first(
+ $profile = DBA::fetchFirst(
"SELECT `contact`.`id` AS `contact_id`, `contact`.`photo` AS `contact_photo`,
`contact`.`thumb` AS `contact_thumb`, `contact`.`micro` AS `contact_micro`,
`profile`.`uid` AS `profile_uid`, `profile`.*,
);
}
if (!DBM::is_result($profile)) {
- $profile = DBA::fetch_first(
+ $profile = DBA::fetchFirst(
"SELECT `contact`.`id` AS `contact_id`, `contact`.`photo` as `contact_photo`,
`contact`.`thumb` AS `contact_thumb`, `contact`.`micro` AS `contact_micro`,
`profile`.`uid` AS `profile_uid`, `profile`.*,
* @return boolean|array
*/
public static function getOwnerDataById($uid) {
- $r = DBA::fetch_first("SELECT
+ $r = DBA::fetchFirst("SELECT
`contact`.*,
`user`.`prvkey` AS `uprvkey`,
`user`.`timezone`,
}
// We now have some contact, so we fetch it
- $target_importer = DBA::fetch_first("SELECT *, `name` as `senderName`
+ $target_importer = DBA::fetchFirst("SELECT *, `name` as `senderName`
FROM `contact`
WHERE NOT `blocked` AND `id` = ? LIMIT 1",
$cid);