Go Back   CodingForums.com > :: Server side development > MySQL

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-28-2012, 10:29 AM   PM User | #1
KazeFlame
New Coder

 
Join Date: Sep 2012
Location: Philippines
Posts: 11
Thanks: 9
Thanked 0 Times in 0 Posts
KazeFlame is an unknown quantity at this point
Question [HELP]Parse error: syntax error, unexpected T_VARIABLE

Hello guys. I'm having trouble with the error on my codes. Please can someone help me with this problem?

The Error:


MySQL:


My Code:
PHP Code:
<?php

//Connect to our Database
$connect mysql_connect("localhost","root","") or die("Could not connect to database!");
if(!
$connect)
    die(
"No Database!");
if(!
mysql_select_db("animecore",$connect))
    die(
"No Database Selected!")

//Selecting Table from Database

//Templates
$tem1 "SELECT templates FROM config";
$tem2 mysql_query($tem1) or die ("Could not select template!");
$template mysql_fetch_array($tem2);

?>
I am using WAMPSERVER 2.2
Thanks in Advance!
KazeFlame is offline   Reply With Quote
Old 11-28-2012, 02:44 PM   PM User | #2
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,498
Thanks: 18
Thanked 361 Times in 360 Posts
sunfighter is on a distinguished road
Code:
if(!mysql_select_db("animecore", $connect))
		die("No Database Selected!");
Add the ; to the above.

Five more char. added to satisfy the editor, disregard this.
sunfighter is offline   Reply With Quote
Users who have thanked sunfighter for this post:
KazeFlame (11-29-2012)
Old 11-28-2012, 07:17 PM   PM User | #3
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,564
Thanks: 62
Thanked 4,056 Times in 4,025 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
By the by, this has nothing to do with MySQL.

Any time you see a message that includes T_VARIABLE or other T_xxx elements it is strictly a PHP error.

If it were a MySQL error, it would say so.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is online now   Reply With Quote
Users who have thanked Old Pedant for this post:
KazeFlame (11-29-2012)
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:27 PM.


Advertisement
Log in to turn off these ads.