Re: Question about $_GET
| From: | Jason k Larson | Date: | Wed, 15 Jan 2003 11:09:36 +0000 |
| Subject: | Re: Question about $_GET | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-131675@lists.php.net to get a copy of this message | ||
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