Forum Moderators: coopster
I was moving my website to my new hosting server after copping all the files when i tried to acess my website i get ths error
Parse error: syntax error, unexpected $end in /home/the/public_html/Connections/rs.php on line 10
I found that the programer had programed 1st line of index.php file to access mysql database the the file use to access was called rs.php bellow are the contents of the file
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_rs = "ServerIP";
$database_rs = "Database";
$username_rs = "User";
$password_rs = "Password;
$rs = mysql_pconnect($hostname_rs, $username_rs, $password_rs) or trigger_error(mysql_error(),E_USER_ERROR);
?>
thanks inadvance
as suggested by u i inserted the quotes now i am getting
Warning: mysql_pconnect() [function.mysql-pconnect]: Access denied for user 'username'@'server' (using password: YES) in /home/the/public_html/Connections/rs.php on line 9
Fatal error: Access denied for user 'username'@'server' (using password: YES) in /home/the/public_html/Connections/rs.php on line 9
the user has assigned all privileges to the database
"You should create a database user and grant permissions from the MySQL section and then use that username (exactly as it appears in cpanel prefixed by your cpanel username) and password in your code and not your cpanel login / password.
Also, do not use pconnect (persistent connections) in your code"
i have PHPmyAdmin to acess the database and basically i am not a programmer yet understand the basics ths was programed bymy programmer wo is not with us any more i dont haveany other programer hence i dont know how do i do it if u can provide any help ie if u can give me the querry to run i can do it
use that username (exactly as it appears in cpanel prefixed by your cpanel username)That's telling you to use user_user. You should also use user_databasename.
Also, do not use pconnectThat's telling you to not use the function that you're using here:
instead use mysql_connect (take the p out)
Not being able to use persistent connections may affect the other scripts that your programmer wrote for you; it depends on how they're written - they may all make a connection, meaning worst case you might have to change a bunch of mysql_pconnect calls, but hopefully, given this script's name, this is the only place the connection is made.