Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.

Join them; it only takes a minute:

Sign up
Join the Stack Overflow community to:
  1. Ask programming questions
  2. Answer and help your peers
  3. Get recognized for your expertise

This question already has an answer here:

I'm pretty new to PHP, and after typing up a few lines and testing I ran into an error that I have no idea on how to fix:

Parse error: syntax error, unexpected T_VARIABLE in /home/nil/public_html/php/getuids.php on line 10

<?php

$connection = mysql_connect("localhost", "root", "") or die("connection unsuccessful");
mysql_select_db("nil_chatModerators")

$query = "SELECT * FROM moderators";
$result = mysql_query($query);

echo $result;

mysql_close();

?>

Here's a screenshot of everything from phpMyAdmin:

(can't post images yet..) http://i.imgur.com/LG4Km33.png

Thanks for any help in advance!

share|improve this question

marked as duplicate by Rizier123 php Jan 10 at 4:13

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

up vote 0 down vote accepted

Semicolon missing in line 4. See my updated code

 <?php

    $connection = mysql_connect("localhost", "root", "") or die("connection unsuccessful");
    mysql_select_db("nil_chatModerators");

    $query = "SELECT * FROM moderators";
    $result = mysql_query($query);

    echo $result;

    mysql_close();
    ?>
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.