- Tidied up some SQL queries.
parent
a7b5d34cf5
commit
966f0811a2
|
@ -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;
|
||||
|
|
|
@ -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() {
|
|||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -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() {
|
|||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue