cvs: php-master-web /manage user-notes.php
| From: | Gabor Hojtsy | Date: | Mon, 02 Feb 2004 09:33:43 +0000 |
| Subject: | cvs: php-master-web /manage user-notes.php | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-23292@lists.php.net to get a copy of this message | ||
goba Mon Feb 2 04:33:43 2004 EDT
Modified files:
/php-master-web/manage user-notes.php
Log:
allow user note search by ID
http://cvs.php.net/diff.php/php-master-web/manage/user-notes.php?r1=1.34&r2=1.35&ty=u
Index: php-master-web/manage/user-notes.php
diff -u php-master-web/manage/user-notes.php:1.34 php-master-web/manage/user-notes.php:1.35
--- php-master-web/manage/user-notes.php:1.34 Sat Nov 15 14:45:47 2003
+++ php-master-web/manage/user-notes.php Mon Feb 2 04:33:43 2004
@@ -95,7 +95,11 @@
}
if (isset($keyword)) {
- $sql = 'SELECT *,UNIX_TIMESTAMP(ts) AS ts FROM note WHERE note LIKE "%' .
addslashes($keyword) . '%" LIMIT 20';
+ $sql = 'SELECT *,UNIX_TIMESTAMP(ts) AS ts FROM note WHERE note LIKE "%' .
addslashes($keyword) . '%"';
+ if (is_numeric($keyword)) {
+ $sql .= ' OR id = ' . (int)$keyword;
+ }
+ $sql .= ' LIMIT 20';
@mysql_connect("localhost","nobody","")
or die("unable to connect to database");
@mysql_select_db("php3")
@@ -132,7 +136,7 @@
<form method="post" action="<?php echo $PHP_SELF;?>">
<table>
<tr>
- <th align="right">Keyword :</th>
+ <th align="right">Keyword or ID:</th>
<td><input type="text" name="keyword" value="<?php echo
$searched; ?>" size="10" maxlength="32" /></td>
</tr>
<tr>