Re: Unexpected T-VARIABLE
- From: Steve <ThisOne@xxxxxxxxxx>
- Date: Fri, 29 Jul 2005 16:47:56 +1200
On Thu, 28 Jul 2005 09:21:58 -0700, Maximus wrote:
> <?
> session_start();
> require_once('db.inc.php');
> $id=$_GET['id'];
> if(!$id) {
> header('Location: main.php');
> } else {
>
> mysql_select_db("tbl_posts")
> $sql=mysql_query"SELECT * FROM tbl_posts WHERE post_id ='" .$id. "'";
> $r=mysql_fetch_array($sql);
> }
> ?>
>
> can anyone tell me what's wrong with this code? it keeps givin me:
>
> Parse error: syntax error, unexpected T_VARIABLE in C:\Program
> Files\Apache Group\Apache2\htdocs\secretBox\viewtopic.php on line 10
2 mistakes... and that kind of indentation of braces was designed to save
paper on a teletype. Now I'm old enough to remember using a tty43, but I
don't *ever* use this style!
Steve
<?
session_start();
require_once('db.inc.php');
$id=$_GET['id'];
if(!$id)
{
header('Location: main.php');
}
else
{
mysql_select_db("tbl_posts");
$sql=mysql_query ("SELECT * FROM tbl_posts WHERE post_id ='" .$id. "'");
$r=mysql_fetch_array($sql);
}
?>
.
- References:
- Unexpected T-VARIABLE
- From: Maximus
- Unexpected T-VARIABLE
- Prev by Date: Re: Test for Interface membership
- Next by Date: Re: Any hints for converting from ZIP to ZIP+4 for a street address?
- Previous by thread: Re: Unexpected T-VARIABLE
- Next by thread: |FAQ| Zip code related questions
- Index(es):
Relevant Pages
|