- Tidied up some SQL queries.

4.2.x
Dries Buytaert 2003-01-21 22:31:37 +00:00
parent a7b5d34cf5
commit 966f0811a2
3 changed files with 5 additions and 5 deletions

View File

@ -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;

View File

@ -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() {
}
}
?>
?>

View File

@ -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() {
}
}
?>
?>