Click here to Skip to main content
15,902,189 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
what's this error :syntax error, unexpected T_CLASS
this is a part of my code :
PHP
<?php
	$connection2 = mysql_connect("localhost","login_h","1234");
	$db = "login_sys";
	mysql_select_db($db , $connection2) 
class Blogpost{
		public $id;
		public $title;
		public $post;
		public $author;
		public $tags;
		public $dateposted;
		public $images;
Posted
Updated 10-Sep-12 11:31am
v2
Comments
enhzflep 10-Sep-12 17:27pm    
It's a syntax error, which, without context means pretty much nothing.
Like C, the error can appear to point to a line that's some distance away from the actual error. If you could show the smallest example of code that exhibits this error, you're likely to get a prompt response. :)

1 solution

It looks like you've missed the ; from the mysql_select_db line.
Sine this line isn't terminated, the PHP pre-processor is surprised to see
PHP
class Blogpost


Hence the message 'unexpected T_CLASS'
 
Share this answer
 
Comments
Hysen Ndregjoni 10-Sep-12 17:51pm    
thanks a lot !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
enhzflep 10-Sep-12 18:02pm    
You're welcome. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900