delete ONLY the actice user´s posts from mysql
| From: | (Helmut Ott) | Date: | Wed, 06 Sep 2000 18:01:57 +0000 |
| Subject: | delete ONLY the actice user´s posts from mysql | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-15564@lists.php.net to get a copy of this message | ||
I have a user in a forum application logged in with $user_name and $password set in a login page.
Now I want to allow him to admin his posts:
1. see all his posts
2. edit
3. delete
only HIS posts.
The following code only brings an error on line 102:
...
//first I find out his id from table user
line 100: $active_user_id = mysqlquery("mydatabase","SELECT id FROM user WHERE
user_name='$username' AND password='$password'");
// next I use the id from user to select all posts of this user
// the table posts of course has a field user_id
line 101: $result = mysqlquery("mydatabase","DELETE FROM posts WHERE id=$par AND
user_id == $active_user_id");
line 102: $num = mysql_numrows($result);
/*
Simply wont work
I GET AN ERROR MESSAGE FOR THE LINE 102 THOUGH THERE ARE RECORDS IN THE DATABASE
*/
...
Any idea around?
Helmut