Jump to content

php error


ma5ect

Recommended Posts

Hi ppl..

 

 

i have a website setup and a database running with it, everything works fine on my desktop pc and now i am trying to get it working on my laptop..

 

but i get the following error when running the website

 

could any1 plz suggest something

 

error:Warning: mysql_pconnect() expects parameter 4 to be long, string given in C:\xampp\htdocs\checklogin.php on line 9

 

Fatal error: in C:\xampp\htdocs\checklogin.php on line 9

 

many thanks

Link to comment
https://forums.phpfreaks.com/topic/127522-php-error/
Share on other sites

check login file:

 

<?

$hostname_mysql_connect = "localhost";
$database_mysql_connect = "website_members";
$username_mysql_connect = "root";
$password_mysql_connect = "******";
$tblname_mysql_connect ="members";

$mysql_connect = mysql_pconnect($hostname_mysql_connect, $username_mysql_connect, $password_mysql_connect, $tblname_mysql_connect) or trigger_error(mysql_error(),E_USER_ERROR); 
mysql_select_db($database_mysql_connect) or die(mysql_error());

$myusername = $_POST['myusername'];
$mypassword = $_POST['mypassword'];

$sql = "SELECT * FROM $tblname_mysql_connect WHERE username= '$myusername' and passwords='$mypassword'"; 
$result = mysql_query($sql) or die(mysql_error());

$count = mysql_num_rows($result);

if($count==1) {
session_register("myusername");
session_register("mypassword");
header("location: login_success_welcome.php");
}
else {
echo "Wrong Username or Password";
}

?>

Link to comment
https://forums.phpfreaks.com/topic/127522-php-error/#findComment-659781
Share on other sites

The only way you can use a programming language effectively is if you read the documentation for the functions you are using - http://us3.php.net/mysql_pconnect

 

The 4th parameter, which the error message and I have both told you is incorrect, it is not a table name.

Link to comment
https://forums.phpfreaks.com/topic/127522-php-error/#findComment-659787
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.