Page 1 of 1

why am I getting this parse error?

Posted: Tue Jul 12, 2005 10:34 pm
by bruceg
I get the following error:

Parse error: parse error, unexpected T_STRING in /hsphere/local/home/bruceg/inspired-evolution.com/search/include/connect.php on line 7

here is the code

Code: Select all

<?php
	$database="bruceg_search";
	$mysql_user = "bruceg_webmaster";
	$mysql_password = "password"; 
	$mysql_host = "server-10.existhost.com";
	$mysql_table_prefix = "";
	$success = mysql_pconnect ($server-10.existhost.com, $bruceg_search, $password);
	if (!$success)
		die ("<b>Cannot connect to database, check if username, password and host are correct.</b>");
    $success = mysql_select_db ($database);
	if (!$success) {
		print "<b>Cannot choose database, check if database name is correct.";
		die();
	}
?>
thanks for any hints...

Posted: Tue Jul 12, 2005 10:43 pm
by Burrito
change line 7 to the variables you set above it:

Code: Select all

$success = mysql_pconnect ($mysql_host, $mysql_user, $mysql_password);

Posted: Tue Jul 12, 2005 10:43 pm
by hawleyjr
This is invalid:

Code: Select all

$success = mysql_pconnect ($server-10.existhost.com,

Posted: Tue Jul 12, 2005 10:44 pm
by hawleyjr
Man Burrito, I was there first...BTW Amost Wednsday it is...

Posted: Tue Jul 12, 2005 10:54 pm
by bruceg
confused, I now am....

What I have now is:

Code: Select all

<?php
	$database="bruceg_search";
	$mysql_user = "bruceg_webmaster";
	$mysql_password = "password"; 
	$mysql_host = "server-10.existhost.com";
	$mysql_table_prefix = "";
	$success = mysql_pconnect ($bruceg_search, $bruceg_webmaster, $password, $server-10.existhost.com);
	if (!$success)
		die ("<b>Cannot connect to database, check if username, password and host are correct.</b>");
    $success = mysql_select_db ($database);
	if (!$success) {
		print "<b>Cannot choose database, check if database name is correct.";
		die();
	}
?>
Changed line 7 to variables above, but get same error...

Posted: Tue Jul 12, 2005 10:56 pm
by hawleyjr
Replace line 7 with exactly what Burrito Posted:

Code: Select all

$success = mysql_pconnect ($mysql_host, $mysql_user, $mysql_password);

Posted: Wed Jul 13, 2005 12:07 am
by theda
In other words:

Code: Select all

<?php
    $database="bruceg_search";
    $mysql_user = "bruceg_webmaster";
    $mysql_password = "password"; 
    $mysql_host = "server-10.existhost.com";
    $mysql_table_prefix = "";
    $success = mysql_pconnect ($mysql_host, $mysql_user, $mysql_password);
    if (!$success)
        die ("<b>Cannot connect to database, check if username, password and host are correct.</b>");
    $success = mysql_select_db ($database);
    if (!$success) {
        print "<b>Cannot choose database, check if database name is correct.";
        die();
    }
?>
Voila!