Forms have two distinct methods. GET and POST. if the form has a method of POST vars are stored in $_POST, ditto for GET.

Use $_POST['id'] not $_GET['id'] if your form uses the POST method.

HTH,
Jason k Larson


Jason k Larson wrote:

$query = "SELECT Newsheadline, News, Contact FROM news WHERE Newsid =
'$_GET['id']'";

It looks like here that again $_GET['id'] has an empty value;

Jason k Larson


Frank Keessen wrote:

> Thanks, but not working:
>
> The error message:
> Error in query: SELECT Newsheadline, News, Contact FROM news WHERE
> Newsid =
> . You have an error in your SQL syntax near '' at line 1
>
> Here are both lines:
>
> $query = "SELECT Newsheadline, News, Contact FROM news WHERE Newsid =
> {$_GET['id']}";
>
>
>  $result = mysql_query($query) or die ("Error in query: $query. " .
> mysql_error());
>
> Regards,
>
> Frank
> ----- Original Message -----
> From: "Danny Shepherd"
> To: "Frank Keessen" ;
> Sent: Wednesday, January 15, 2003 11:54 AM
> Subject: Re: [PHP] Question about $_GET
>

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

Reply via email to