Jump to content

[SOLVED] Parse Error: Unexpected '{'


waiwai933

Recommended Posts

Hi. I'm experiencing some problems with the following code, which is outputting a "Parse error: syntax error, unexpected '{' in /blablabla/example.php on line 13"

 

<?php include("../example.org/header.html"); ?>
    <h1 align="left"> Main Content </h1>
    <p align="left"><?php
$hostname = "databases.example.org";
$username = "bluefire";
$password = "jellybird";
$database = "admin"; 
$link = mysql_connect($hostname,$username,$password);
mysql_select_db($database) or die("Unable to select database");
$query = "SELECT username FROM authentication WHERE authorized is (1)";
$result = mysql_query($query);
while ($row = mysql_fetch_assoc($result)
{ echo $row['value']; }
?>
<?php include("../example.org/footer.html"); ?>

 

I have, of course changed some of the authentication details to prevent hacking.

 

Link to comment
Share on other sites

SELECT username FROM authentication WHERE authorized is (1)

 

Never seen syntax like this before... shouldn''t it be

 

SELECT username FROM authentication WHERE authorized = 1

 

[edit]

 

According to manual it should be

 

SELECT username FROM authentication WHERE authorized is TRUE

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.