Commit 7dd24bec authored by Dries's avatar Dries

- SQL query maintenance: '%d' -> %d.

parent c2fcb6d5
......@@ -173,10 +173,10 @@ function _locale_import_po($file, $lang, $mode) {
// Get the plural formula
if ($hdr["Plural-Forms"] && $p = _locale_import_parse_plural_forms($hdr["Plural-Forms"], $file->filename)) {
list($nplurals, $plural) = $p;
db_query("UPDATE {locales_meta} SET plurals = '%d', formula = '%s' WHERE locale = '%s'", $nplurals, $plural, $lang);
db_query("UPDATE {locales_meta} SET plurals = %d, formula = '%s' WHERE locale = '%s'", $nplurals, $plural, $lang);
}
else {
db_query("UPDATE {locales_meta} SET plurals = '%d', formula = '%s' WHERE locale = '%s'", 0, '', $lang);
db_query("UPDATE {locales_meta} SET plurals = %d, formula = '%s' WHERE locale = '%s'", 0, '', $lang);
}
}
else {
......
......@@ -187,13 +187,13 @@ function contact_admin_edit($cid = NULL) {
}
if (!form_get_errors()) {
db_query("DELETE FROM {contact} WHERE cid = '%d'", $cid);
db_query("DELETE FROM {contact} WHERE cid = %d", $cid);
db_query("INSERT INTO {contact} (category, recipients, reply) VALUES ('%s', '%s', '%s')", $edit['category'], $edit['recipients'], $edit['reply']);
drupal_goto('admin/contact');
}
}
else {
$category = db_fetch_object(db_query("SELECT * FROM {contact} WHERE cid = '%d'", $cid));
$category = db_fetch_object(db_query("SELECT * FROM {contact} WHERE cid = %d", $cid));
$edit['cid'] = $category->cid;
$edit['category'] = $category->category;
$edit['recipients'] = $category->recipients;
......@@ -209,7 +209,7 @@ function contact_admin_edit($cid = NULL) {
}
function contact_admin_delete($cid) {
$info = db_fetch_object(db_query("SELECT cid, category FROM {contact} WHERE cid = '%d'",$cid));
$info = db_fetch_object(db_query("SELECT cid, category FROM {contact} WHERE cid = %d",$cid));
if ($_POST['op'] != t('Delete')) {
return confirm_form('contact_admin_delete', array(),
t('Are you sure you want to delete %category?', array('%category' => theme('placeholder', $info->category))),
......@@ -219,7 +219,7 @@ function contact_admin_delete($cid) {
t('Cancel'));
}
else {
db_query("DELETE FROM {contact} WHERE cid = '%d'", $cid);
db_query("DELETE FROM {contact} WHERE cid = %d", $cid);
drupal_goto('admin/contact');
}
}
......
......@@ -187,13 +187,13 @@ function contact_admin_edit($cid = NULL) {
}
if (!form_get_errors()) {
db_query("DELETE FROM {contact} WHERE cid = '%d'", $cid);
db_query("DELETE FROM {contact} WHERE cid = %d", $cid);
db_query("INSERT INTO {contact} (category, recipients, reply) VALUES ('%s', '%s', '%s')", $edit['category'], $edit['recipients'], $edit['reply']);
drupal_goto('admin/contact');
}
}
else {
$category = db_fetch_object(db_query("SELECT * FROM {contact} WHERE cid = '%d'", $cid));
$category = db_fetch_object(db_query("SELECT * FROM {contact} WHERE cid = %d", $cid));
$edit['cid'] = $category->cid;
$edit['category'] = $category->category;
$edit['recipients'] = $category->recipients;
......@@ -209,7 +209,7 @@ function contact_admin_edit($cid = NULL) {
}
function contact_admin_delete($cid) {
$info = db_fetch_object(db_query("SELECT cid, category FROM {contact} WHERE cid = '%d'",$cid));
$info = db_fetch_object(db_query("SELECT cid, category FROM {contact} WHERE cid = %d",$cid));
if ($_POST['op'] != t('Delete')) {
return confirm_form('contact_admin_delete', array(),
t('Are you sure you want to delete %category?', array('%category' => theme('placeholder', $info->category))),
......@@ -219,7 +219,7 @@ function contact_admin_delete($cid) {
t('Cancel'));
}
else {
db_query("DELETE FROM {contact} WHERE cid = '%d'", $cid);
db_query("DELETE FROM {contact} WHERE cid = %d", $cid);
drupal_goto('admin/contact');
}
}
......
......@@ -851,7 +851,7 @@ function user_login($edit = array(), $msg = '') {
watchdog('user', t('Session opened for %name.', array('%name' => theme('placeholder', $user->name))));
// Update the user table timestamp noting user has logged in.
db_query("UPDATE {users} SET login = '%d' WHERE uid = '%s'", time(), $user->uid);
db_query("UPDATE {users} SET login = %d WHERE uid = '%s'", time(), $user->uid);
user_module_invoke('login', $edit, $user);
......@@ -1029,7 +1029,7 @@ function user_pass_reset($uid, $timestamp, $hashed_pass) {
watchdog('user', t('One time login URL used for %name with timestamp %timestamp.', array('%name' => "<em>$account->name</em>", '%timestamp' => $timestamp)));
// Update the user table noting user has logged in.
// And this also makes this hashed password a one-time-only login.
db_query("UPDATE {users} SET login = '%d' WHERE uid = %d", time(), $account->uid);
db_query("UPDATE {users} SET login = %d WHERE uid = %d", time(), $account->uid);
// Now we can set the new user.
$user = $account;
// And proceed with normal login, going to user page.
......
......@@ -851,7 +851,7 @@ function user_login($edit = array(), $msg = '') {
watchdog('user', t('Session opened for %name.', array('%name' => theme('placeholder', $user->name))));
// Update the user table timestamp noting user has logged in.
db_query("UPDATE {users} SET login = '%d' WHERE uid = '%s'", time(), $user->uid);
db_query("UPDATE {users} SET login = %d WHERE uid = '%s'", time(), $user->uid);
user_module_invoke('login', $edit, $user);
......@@ -1029,7 +1029,7 @@ function user_pass_reset($uid, $timestamp, $hashed_pass) {
watchdog('user', t('One time login URL used for %name with timestamp %timestamp.', array('%name' => "<em>$account->name</em>", '%timestamp' => $timestamp)));
// Update the user table noting user has logged in.
// And this also makes this hashed password a one-time-only login.
db_query("UPDATE {users} SET login = '%d' WHERE uid = %d", time(), $account->uid);
db_query("UPDATE {users} SET login = %d WHERE uid = %d", time(), $account->uid);
// Now we can set the new user.
$user = $account;
// And proceed with normal login, going to user page.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment