<code snippet>
       if ($post == "post") {
          postBlog ($post,$input,$title);
       }elseif ($post == "edit"){

          updateBlog ($input,$edit_post);  //  <---- BINGO!
</code snippet>

Just looking at the code you posted to your site, there's only one thing
obvious to me: You want to use $edit_blog in that call to updateBlog
instead of $edit_post?


On Thu, 12 Sep 2002, Jesse Lawrence wrote:

> Hello all,
> I've got a bit of a code problem that's been baffling
> me for a while now.
> I'm working on a basic weblog system for personal use,
> using MySQL.  I've got the "new post" and "delete a
> post" aspects working fine, but for some reason, I
> can't get the "update a post" part happening.
> What happens is I select a post to update, and then
> the post comes up in a textarea box.  You then make
> your update, and submit.
> Doing this calls the following function:
>  function updateBlog($input,$edit_blog) {
>          include 'db_connect.php';
>     $update_query = "update $table set blog='$input'
> where id='$edit_blog'";
>     if(mysql_db_query ($database, $update_query,
> $link)) {
>        print "Successfully Edited!!";
>     }else{
>         print "no";
>     }
>  The variables being passed to the function are:
>   $input = "The body of the post"
>  and
>   $edit_blog =  id # of post
> At this point everything appears to have been a
> success.  The "Successfully Edited!!" confirmation
> appears, and everything seems fine, but when I look at
> my database, nothing has been updated or changed in
> any way.
> Does anyone have any suggestions or help they could
> lend me?  I've been facing this problem for a while
> now, and can't seem to get my head around it.
> You can view the entire code here:
> http://soniceast.d2g.ca/~jalaw/blog/admin.txt

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to