Re: Unexpected T-VARIABLE



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);
}
?>
.



Relevant Pages

  • Re: Have A Head-Bangin Saturday!
    ... I'm givin' er, hon, I'm givin' er! ... Sarah and Steve ... She was a fast machine ... She kept her motor clean ...
    (alt.support.stop-smoking)
  • evaluate this
    ... both givin different results ... Prev by Date: ...
    (comp.lang.c)
  • Re: Top 5 Dusty-isms
    ... "He's got him tied up to tha tree o' woe!" ... "He's givin' him the belly welly stomp!" ... Prev by Date: ...
    (rec.sport.pro-wrestling)
  • Re: Formula solution????
    ... This is what I was givin. ... > Thank You to anyone that replies. ... > Steve S's Profile: ...
    (microsoft.public.excel)
  • Formula solution????
    ... I'm new to excel and have a problem that I need solved. ... This is what I was givin. ... Steve S ...
    (microsoft.public.excel)