Computing.Net > Forums > Programming > Php connection parse error

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Php connection parse error

Reply to Message Icon

Name: mrdamncool
Date: June 21, 2009 at 00:43:29 Pacific
OS: Windows Vista
Subcategory: General
Comment:

I have made php connection but when i run,it gives me parse error on line 3. Below i show the code:-

<?php

&host="localhost";

&user="root";
&password="";

mysql_connect(&host,&user,&password);
mysql_select_db("sample");
session_start()

?>



Sponsored Link
Ads by Google

Response Number 1
Name: shutat
Date: June 23, 2009 at 02:56:06 Pacific
Reply:

Unless you're using reference (&$some_var), php vars are declared with $, so


    <?php

    $host="localhost";

    $user="root";
    $password="";

    mysql_connect($host,$user,$password);
    mysql_select_db("sample");
    session_start()

    ?>


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Php connection parse error

parse error www.computing.net/answers/programming/parse-error/12417.html

parse error before `foo' www.computing.net/answers/programming/parse-error-before-foo/3511.html

php mysql connect to database parse www.computing.net/answers/programming/php-mysql-connect-to-database-parse/14233.html