"Willy Mularto" <[EMAIL PROTECTED]> wrote:
> Dear Midgarders,
>
> We just created an article in Aegir from X company. And then we also made a login
> page, we loggod on as the X company administrator. There is a list of articles, we
> click one of them to edit.
>
> And by using the mgd_update_article() taken from the example on the midgard-project
> website we process the modification we made from the article. And we got "Article X
> is updated" message, and we also capture all the values to make sure, and all
> captured well. But the big question is, the article is not changed, what's wrong?
You do check for mgd_errno instead of update.
> Below is the code we use :
>
> <?
> $id = $_REQUEST["id"];
> $score = $_REQUEST["score"];
> $type = $_REQUEST["type"];
> $name = $_REQUEST["name"];
> $abstract = $_REQUEST["abstract"];
> $topic = $_REQUEST["topic"];
> $extra2= $_REQUEST["extra2"];
> $extra3= $_REQUEST["extra3"];
> $title = $_REQUEST["title"];
> $content = $_REQUEST["isi"];
>
> if(! $article = mgd_get_article( $id ))
> {
> echo "<center><font color=\"red\"><strong>Could not get article
> $article->title.<br>\n";
> echo "reason: " . mgd_errstr()."</strong></font></center>";
> }
else
{
$article->title = $_REQUEST["title"];
$article->topic = $topic = $_REQUEST["topic"];
// and so on
if (! $update = $article->update() )
print " Article is not updated cause of: ";
print mgd_errstr();
}
Piotras
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]