summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2003-01-21 22:31:37 +0000
committerDries Buytaert <dries@buytaert.net>2003-01-21 22:31:37 +0000
commit966f0811a21f558bbaf9665eedfe55805efe10c2 (patch)
treec74e912650c4530a25b84ac48977fc15c3385407
parenta7b5d34cf5cf458cc67f532a204254da20866718 (diff)
downloadbrdo-966f0811a21f558bbaf9665eedfe55805efe10c2.tar.gz
brdo-966f0811a21f558bbaf9665eedfe55805efe10c2.tar.bz2
- Tidied up some SQL queries.
-rw-r--r--modules/bloggerapi.module2
-rw-r--r--modules/search.module4
-rw-r--r--modules/search/search.module4
3 files changed, 5 insertions, 5 deletions
diff --git a/modules/bloggerapi.module b/modules/bloggerapi.module
index 1b0adc76c..0502357be 100644
--- a/modules/bloggerapi.module
+++ b/modules/bloggerapi.module
@@ -272,7 +272,7 @@ function bloggerapi_node_recent($num) {
global $user;
if (($num == 0) or ($num > 100)) $num = 50;
- $result = db_query("SELECT n.*, u.name FROM node n LEFT JOIN users u ON n.uid = u.uid WHERE n.uid = '$user->uid' ORDER BY n.nid DESC LIMIT ". $num);
+ $result = db_query("SELECT n.*, u.name FROM node n LEFT JOIN users u ON n.uid = u.uid WHERE n.uid = '%d' ORDER BY n.nid DESC LIMIT %d", $user->uid, $num);
if ($result) {
while ($blog = db_fetch_object($result)) {
$body = "<title>$blog->title</title>\n". $blog->body;
diff --git a/modules/search.module b/modules/search.module
index 4e964b0d0..d6acc1b71 100644
--- a/modules/search.module
+++ b/modules/search.module
@@ -261,7 +261,7 @@ function update_index($search_array) {
** the search index
*/
foreach ($newwords as $key => $value) {
- db_query("INSERT INTO search_index VALUES('$key', ". $node["lno"] .", '$node_type', $value)");
+ db_query("INSERT INTO search_index VALUES('%s', '%s', '%s', '%s')", $key, $node["lno"], $node_type, $value);
}
// Zap the weighted words array, so we don't add multiples.
@@ -374,4 +374,4 @@ function search_page() {
}
}
-?> \ No newline at end of file
+?>
diff --git a/modules/search/search.module b/modules/search/search.module
index 4e964b0d0..d6acc1b71 100644
--- a/modules/search/search.module
+++ b/modules/search/search.module
@@ -261,7 +261,7 @@ function update_index($search_array) {
** the search index
*/
foreach ($newwords as $key => $value) {
- db_query("INSERT INTO search_index VALUES('$key', ". $node["lno"] .", '$node_type', $value)");
+ db_query("INSERT INTO search_index VALUES('%s', '%s', '%s', '%s')", $key, $node["lno"], $node_type, $value);
}
// Zap the weighted words array, so we don't add multiples.
@@ -374,4 +374,4 @@ function search_page() {
}
}
-?> \ No newline at end of file
+?>