PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
bruceg
Forum Contributor
Posts: 174 Joined: Wed Mar 16, 2005 11:07 am
Location: Morrisville, NC
Contact:
Post
by bruceg » Tue Jul 12, 2005 10:34 pm
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...
Burrito
Spockulator
Posts: 4715 Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah
Post
by Burrito » Tue Jul 12, 2005 10:43 pm
change line 7 to the variables you set above it:
Code: Select all
$success = mysql_pconnect ($mysql_host, $mysql_user, $mysql_password);
hawleyjr
BeerMod
Posts: 2170 Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA
Post
by hawleyjr » Tue Jul 12, 2005 10:43 pm
This is invalid:
Code: Select all
$success = mysql_pconnect ($server-10.existhost.com,
hawleyjr
BeerMod
Posts: 2170 Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA
Post
by hawleyjr » Tue Jul 12, 2005 10:44 pm
Man Burrito, I was there first...BTW Amost Wednsday it is...
bruceg
Forum Contributor
Posts: 174 Joined: Wed Mar 16, 2005 11:07 am
Location: Morrisville, NC
Contact:
Post
by bruceg » Tue Jul 12, 2005 10:54 pm
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...
hawleyjr
BeerMod
Posts: 2170 Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA
Post
by hawleyjr » Tue Jul 12, 2005 10:56 pm
Replace line 7 with exactly what Burrito Posted:
Code: Select all
$success = mysql_pconnect ($mysql_host, $mysql_user, $mysql_password);
theda
Forum Contributor
Posts: 332 Joined: Sat Feb 19, 2005 8:35 am
Location: USA
Post
by theda » Wed Jul 13, 2005 12:07 am
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!