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
https://forums.phpfreaks.com/topic/132884-solved-parse-error-unexpected/
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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.