Re: Unexpected T-VARIABLE
- From: "Markus L." <nobody@xxxxxxxxxxxxxxx>
- Date: Thu, 28 Jul 2005 23:29:39 +0200
Am Thu, 28 Jul 2005 09:21:58 -0700 schrieb Maximus:
> <?
> 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
You forgot the brackets:
$sql=mysql_query("SELECT * FROM tbl_posts WHERE post_id ='" .$id. "'");
--
-------------------------------------------------------
Try this: SCA the Smart Class Archive for PHP
http://www.project-sca.org
-------------------------------------------------------
.
- References:
- Unexpected T-VARIABLE
- From: Maximus
- Unexpected T-VARIABLE
- Prev by Date: Good image uploader with thumbnails?
- Next by Date: displaying a varying number of images.. in tables?!
- Previous by thread: Unexpected T-VARIABLE
- Next by thread: Re: Unexpected T-VARIABLE
- Index(es):
Relevant Pages
|