Re: Re: php/mysql weblog - addnews function problems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've tried playing around with it a bit but I'm getting quite confused now.
It still doesn't like my declaration of variables and I'm not sure how to
declare 'id' either as it isn't used in the form as a field of entry - just
an index in the database.

Any help would greatly be appreciated cause I'm using this as an inclusion
in a piece of coursework I'm doing and the deadline is looming! :/

thanks

slippy


"Doug Thompson" <dthompson@xxxxxxxxxxxxx> wrote in message
news:200402181302.i1ID2E6i029403@xxxxxxxxxxxxxxxx
> On Wed, 18 Feb 2004 09:35:22 -0000, Slippyaah wrote:
>
> >Well basically I think it's a problem with the declaration of variables
> >and/or the way they are being processed by the form.
> >
> >Here is the individual addNews function:
> >
> >function addNews() {
> >       global $db;
> >
> >       /* declare variables here? */
> >
> >
> >
> >       /* insert the new news entry */
> >       $query = "INSERT INTO news" .
> >          "VALUES('',$id,'{$_POST['postdate']}'," .
> >          "'{$_POST['title']}',".
> >          "'{$_POST['newstext']}')";
>
> I haven't been following this thread, but you need to do your part to help
the parser.
>
> $query = "INSERT INTO news ";
> $query .= "VALUES('',$id,'".$_POST['postdate']."',";
> $query .= "'".$_POST['title']."',";
> $query .= "'".$_POST['newstext']."')";
>
> You should also add some db error checking and reporting, then you
wouldn't get the erroneous "success" message.
>
> hth,
> Doug

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux