I'm new and i want to ask you something.This is the code i have


<?php
$dbhost = 'fdb2.agilityhoster.com';
$dbuser = 'i dont give username in this thread';
$dbpass = 'i dont give password in this thread';
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die                      ('Error connecting to mysql');
mysql_query("CREATE DATABASE my_db",$con)
mysql_select_db("my_db", $con);
$sql = "CREATE TABLE Persons
(
FirstName varchar(15),
LastName varchar(15),
Age int
)";

mysql_query($sql,$con);
mysql_close($conn);
?>

As you can see this code is coppied from tutorials,but hosting,username,and password are changed.There is one problem.When i open the page,it says:

Parse error: syntax error, unexpected T_STRING in /home/www/heyaa.agilityhoster.com/index.php on line 8

    Guests please register and help me faster!!!Users please help me :-(

      helpMep;10918798 wrote:

      Guests please register and help me faster!!!Users please help me :-(

      All of us are here to volunteer our time, and every thread here is just as important as the next; be patient. Using "HELP ME" or "URGENT" or etc. in your thread titles/messages may actually drive away the regulars.

      As for your problem, you're missing a semicolon after the mysql_query() statement.

        bradgrafelman;10918853 wrote:

        All of us are here to volunteer our time, and every thread here is just as important as the next; be patient. Using "HELP ME" or "URGENT" or etc. in your thread titles/messages may actually drive away the regulars.

        As for your problem, you're missing a semicolon after the mysql_query() statement.

        Thank you for all bradgrafelman!!!!

          ooops!

          Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/www/heyaa.agilityhoster.com/index.php on line 7

          Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/www/heyaa.agilityhoster.com/index.php on line 8

          Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/www/heyaa.agilityhoster.com/index

          
          <?php
          $dbhost = 'fdb2.agilityhoster.com';
          $dbuser = '282863_base';
          $dbpass = 'surfer';
          $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die                      ('Error connecting to mysql');
          mysql_query("CREATE DATABASE my_db",$con);
          mysql_select_db("my_db", $con);
          $sql = "CREATE TABLE Persons
          (
          FirstName varchar(15),
          LastName varchar(15),
          Age int
          )";
          
          mysql_query($sql,$con);
          mysql_close($conn);
          ?> 
          
            Write a Reply...