I have run to this error while running my project
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
"Fatal error: Uncaught Error: Call to undefined function
mysql_connect() in C:laragonwwwfarmerconfigconfig.php:3 Stack
trace: #0 C:laragonwwwfarmerExecuteExLogin.php(6): include() #1
{main} thrown in C:laragonwwwfarmerconfigconfig.php on line 3"
Here is config.php
<?php
mysql_connect("localhost", "root", "newton2010") or die(mysql_error());
mysql_select_db("farmer") or die(mysql_error());
?>
<?Php
//session_start();
$dbhost_name = "localhost";
$database = "farmer";// database name
$username = "root"; // user name
$password = "newton2010"; // password
//////// Do not Edit below /////////
try {
$dbo = new PDO('mysql:host=localhost;dbname='.$database, $username, $password);
} catch (PDOException $e) {
print "Error!: " . $e->getMessage() . "<br/>";
die();
}
?>
Here is my Exlogin.php
<?php
// Start the session
session_start();
include '../config/config.php';
include '../config/config1.php';
include '../config/connect.php';
$UName = ($_POST["Username"]);
$PW = ($_POST["Password"]);
$status = "Accepted";
$PassWord=0;
$UserName=0;
$quer= mysql_query("SELECT * FROM customers where username='$UName' AND password='$PW' ");
while($ss = mysql_fetch_array($quer))
{
$UserName=$ss['username'];
$PassWord=$ss['password'];
$userid=$ss['customerid'];
$name=$ss['firstnames'];
$activate=$ss['status'];
//$profilepicture=$ss['profilepicture'];
//$IDBranch=$ss['IDBranch'];
$role=$ss['role'];
}
if($PassWord!=$PW || $UserName!=$UName || $activate!=$status ){
echo "<script>alert('You account is disabled or You have entered Incorrect UserName or Password')</script>";
echo "<script>location.href='../index.php'</script>";
}
else
{
$_SESSION["Id"]=$userid;
$_SESSION["name"]=$name;
//$_SESSION["profilepicture"]=$profilepicture;
//$_SESSION["IDBranch"]=$IDBranch;
$_SESSION["role"]=$role;
?>
<!--<script>
var person = prompt("Please enter your name", "Harry Potter");
if (person != null) {
document.getElementById("demo").innerHTML =
"Hello " + person + "! How are you today?";
}
</script>-->
<script>location.href='../dashboard.php'</script>"; -->
<?php } ?>
php mysql
|
show 1 more comment
"Fatal error: Uncaught Error: Call to undefined function
mysql_connect() in C:laragonwwwfarmerconfigconfig.php:3 Stack
trace: #0 C:laragonwwwfarmerExecuteExLogin.php(6): include() #1
{main} thrown in C:laragonwwwfarmerconfigconfig.php on line 3"
Here is config.php
<?php
mysql_connect("localhost", "root", "newton2010") or die(mysql_error());
mysql_select_db("farmer") or die(mysql_error());
?>
<?Php
//session_start();
$dbhost_name = "localhost";
$database = "farmer";// database name
$username = "root"; // user name
$password = "newton2010"; // password
//////// Do not Edit below /////////
try {
$dbo = new PDO('mysql:host=localhost;dbname='.$database, $username, $password);
} catch (PDOException $e) {
print "Error!: " . $e->getMessage() . "<br/>";
die();
}
?>
Here is my Exlogin.php
<?php
// Start the session
session_start();
include '../config/config.php';
include '../config/config1.php';
include '../config/connect.php';
$UName = ($_POST["Username"]);
$PW = ($_POST["Password"]);
$status = "Accepted";
$PassWord=0;
$UserName=0;
$quer= mysql_query("SELECT * FROM customers where username='$UName' AND password='$PW' ");
while($ss = mysql_fetch_array($quer))
{
$UserName=$ss['username'];
$PassWord=$ss['password'];
$userid=$ss['customerid'];
$name=$ss['firstnames'];
$activate=$ss['status'];
//$profilepicture=$ss['profilepicture'];
//$IDBranch=$ss['IDBranch'];
$role=$ss['role'];
}
if($PassWord!=$PW || $UserName!=$UName || $activate!=$status ){
echo "<script>alert('You account is disabled or You have entered Incorrect UserName or Password')</script>";
echo "<script>location.href='../index.php'</script>";
}
else
{
$_SESSION["Id"]=$userid;
$_SESSION["name"]=$name;
//$_SESSION["profilepicture"]=$profilepicture;
//$_SESSION["IDBranch"]=$IDBranch;
$_SESSION["role"]=$role;
?>
<!--<script>
var person = prompt("Please enter your name", "Harry Potter");
if (person != null) {
document.getElementById("demo").innerHTML =
"Hello " + person + "! How are you today?";
}
</script>-->
<script>location.href='../dashboard.php'</script>"; -->
<?php } ?>
php mysql
I guess you're running PHP 7.mysql_connect()
doesn't exist in PHP 7 anymore. You should have a look atmysqli_connect()
instead.
– Dirk Scholten
Nov 16 '18 at 13:29
this is telling you that mysql_* functions are not available in that server, use phpinfo() to check which version of php it is, if it is 7, then it means those functions are removed
– noid
Nov 16 '18 at 13:30
Read this may helpful to you stackoverflow.com/a/13825126/2893413
– Sadikhasan
Nov 16 '18 at 13:37
try mysqli_connect method instead mysql_connect
– Manoj Singh
Nov 16 '18 at 13:39
it may help you stackoverflow.com/questions/34088373/…
– Manoj Singh
Nov 16 '18 at 13:41
|
show 1 more comment
"Fatal error: Uncaught Error: Call to undefined function
mysql_connect() in C:laragonwwwfarmerconfigconfig.php:3 Stack
trace: #0 C:laragonwwwfarmerExecuteExLogin.php(6): include() #1
{main} thrown in C:laragonwwwfarmerconfigconfig.php on line 3"
Here is config.php
<?php
mysql_connect("localhost", "root", "newton2010") or die(mysql_error());
mysql_select_db("farmer") or die(mysql_error());
?>
<?Php
//session_start();
$dbhost_name = "localhost";
$database = "farmer";// database name
$username = "root"; // user name
$password = "newton2010"; // password
//////// Do not Edit below /////////
try {
$dbo = new PDO('mysql:host=localhost;dbname='.$database, $username, $password);
} catch (PDOException $e) {
print "Error!: " . $e->getMessage() . "<br/>";
die();
}
?>
Here is my Exlogin.php
<?php
// Start the session
session_start();
include '../config/config.php';
include '../config/config1.php';
include '../config/connect.php';
$UName = ($_POST["Username"]);
$PW = ($_POST["Password"]);
$status = "Accepted";
$PassWord=0;
$UserName=0;
$quer= mysql_query("SELECT * FROM customers where username='$UName' AND password='$PW' ");
while($ss = mysql_fetch_array($quer))
{
$UserName=$ss['username'];
$PassWord=$ss['password'];
$userid=$ss['customerid'];
$name=$ss['firstnames'];
$activate=$ss['status'];
//$profilepicture=$ss['profilepicture'];
//$IDBranch=$ss['IDBranch'];
$role=$ss['role'];
}
if($PassWord!=$PW || $UserName!=$UName || $activate!=$status ){
echo "<script>alert('You account is disabled or You have entered Incorrect UserName or Password')</script>";
echo "<script>location.href='../index.php'</script>";
}
else
{
$_SESSION["Id"]=$userid;
$_SESSION["name"]=$name;
//$_SESSION["profilepicture"]=$profilepicture;
//$_SESSION["IDBranch"]=$IDBranch;
$_SESSION["role"]=$role;
?>
<!--<script>
var person = prompt("Please enter your name", "Harry Potter");
if (person != null) {
document.getElementById("demo").innerHTML =
"Hello " + person + "! How are you today?";
}
</script>-->
<script>location.href='../dashboard.php'</script>"; -->
<?php } ?>
php mysql
"Fatal error: Uncaught Error: Call to undefined function
mysql_connect() in C:laragonwwwfarmerconfigconfig.php:3 Stack
trace: #0 C:laragonwwwfarmerExecuteExLogin.php(6): include() #1
{main} thrown in C:laragonwwwfarmerconfigconfig.php on line 3"
Here is config.php
<?php
mysql_connect("localhost", "root", "newton2010") or die(mysql_error());
mysql_select_db("farmer") or die(mysql_error());
?>
<?Php
//session_start();
$dbhost_name = "localhost";
$database = "farmer";// database name
$username = "root"; // user name
$password = "newton2010"; // password
//////// Do not Edit below /////////
try {
$dbo = new PDO('mysql:host=localhost;dbname='.$database, $username, $password);
} catch (PDOException $e) {
print "Error!: " . $e->getMessage() . "<br/>";
die();
}
?>
Here is my Exlogin.php
<?php
// Start the session
session_start();
include '../config/config.php';
include '../config/config1.php';
include '../config/connect.php';
$UName = ($_POST["Username"]);
$PW = ($_POST["Password"]);
$status = "Accepted";
$PassWord=0;
$UserName=0;
$quer= mysql_query("SELECT * FROM customers where username='$UName' AND password='$PW' ");
while($ss = mysql_fetch_array($quer))
{
$UserName=$ss['username'];
$PassWord=$ss['password'];
$userid=$ss['customerid'];
$name=$ss['firstnames'];
$activate=$ss['status'];
//$profilepicture=$ss['profilepicture'];
//$IDBranch=$ss['IDBranch'];
$role=$ss['role'];
}
if($PassWord!=$PW || $UserName!=$UName || $activate!=$status ){
echo "<script>alert('You account is disabled or You have entered Incorrect UserName or Password')</script>";
echo "<script>location.href='../index.php'</script>";
}
else
{
$_SESSION["Id"]=$userid;
$_SESSION["name"]=$name;
//$_SESSION["profilepicture"]=$profilepicture;
//$_SESSION["IDBranch"]=$IDBranch;
$_SESSION["role"]=$role;
?>
<!--<script>
var person = prompt("Please enter your name", "Harry Potter");
if (person != null) {
document.getElementById("demo").innerHTML =
"Hello " + person + "! How are you today?";
}
</script>-->
<script>location.href='../dashboard.php'</script>"; -->
<?php } ?>
php mysql
php mysql
edited Nov 16 '18 at 14:23
Eray Balkanli
4,57852347
4,57852347
asked Nov 16 '18 at 13:26
Isaac OngomaIsaac Ongoma
12
12
I guess you're running PHP 7.mysql_connect()
doesn't exist in PHP 7 anymore. You should have a look atmysqli_connect()
instead.
– Dirk Scholten
Nov 16 '18 at 13:29
this is telling you that mysql_* functions are not available in that server, use phpinfo() to check which version of php it is, if it is 7, then it means those functions are removed
– noid
Nov 16 '18 at 13:30
Read this may helpful to you stackoverflow.com/a/13825126/2893413
– Sadikhasan
Nov 16 '18 at 13:37
try mysqli_connect method instead mysql_connect
– Manoj Singh
Nov 16 '18 at 13:39
it may help you stackoverflow.com/questions/34088373/…
– Manoj Singh
Nov 16 '18 at 13:41
|
show 1 more comment
I guess you're running PHP 7.mysql_connect()
doesn't exist in PHP 7 anymore. You should have a look atmysqli_connect()
instead.
– Dirk Scholten
Nov 16 '18 at 13:29
this is telling you that mysql_* functions are not available in that server, use phpinfo() to check which version of php it is, if it is 7, then it means those functions are removed
– noid
Nov 16 '18 at 13:30
Read this may helpful to you stackoverflow.com/a/13825126/2893413
– Sadikhasan
Nov 16 '18 at 13:37
try mysqli_connect method instead mysql_connect
– Manoj Singh
Nov 16 '18 at 13:39
it may help you stackoverflow.com/questions/34088373/…
– Manoj Singh
Nov 16 '18 at 13:41
I guess you're running PHP 7.
mysql_connect()
doesn't exist in PHP 7 anymore. You should have a look at mysqli_connect()
instead.– Dirk Scholten
Nov 16 '18 at 13:29
I guess you're running PHP 7.
mysql_connect()
doesn't exist in PHP 7 anymore. You should have a look at mysqli_connect()
instead.– Dirk Scholten
Nov 16 '18 at 13:29
this is telling you that mysql_* functions are not available in that server, use phpinfo() to check which version of php it is, if it is 7, then it means those functions are removed
– noid
Nov 16 '18 at 13:30
this is telling you that mysql_* functions are not available in that server, use phpinfo() to check which version of php it is, if it is 7, then it means those functions are removed
– noid
Nov 16 '18 at 13:30
Read this may helpful to you stackoverflow.com/a/13825126/2893413
– Sadikhasan
Nov 16 '18 at 13:37
Read this may helpful to you stackoverflow.com/a/13825126/2893413
– Sadikhasan
Nov 16 '18 at 13:37
try mysqli_connect method instead mysql_connect
– Manoj Singh
Nov 16 '18 at 13:39
try mysqli_connect method instead mysql_connect
– Manoj Singh
Nov 16 '18 at 13:39
it may help you stackoverflow.com/questions/34088373/…
– Manoj Singh
Nov 16 '18 at 13:41
it may help you stackoverflow.com/questions/34088373/…
– Manoj Singh
Nov 16 '18 at 13:41
|
show 1 more comment
1 Answer
1
active
oldest
votes
I used the recommendation made by @sadikhasan on using fix.mysql.inc.php
Then I ran into this new error "Parse error: syntax error, unexpected '<', expecting end of file in C:laragonwwwfarmerconfigconfig.php on line 4"
Here is my updated config.php
<?php
include_once('fix_mysql.inc.php');
<?php
mysql_connect("localhost", "root", "newton2010") or die(mysql_error());
mysql_select_db("farmer") or die(mysql_error());
?>
<?Php
//session_start();
$dbhost_name = "localhost";
$database = "farmer";// database name
$username = "root"; // user name
$password = "newton2010"; // password
//////// Do not Edit below /////////
try {
$dbo = new PDO('mysql:host=localhost;dbname='.$database, $username, $password);
} catch (PDOException $e) {
print "Error!: " . $e->getMessage() . "<br/>";
die();
}
?>
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53338807%2fi-have-run-to-this-error-while-running-my-project%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I used the recommendation made by @sadikhasan on using fix.mysql.inc.php
Then I ran into this new error "Parse error: syntax error, unexpected '<', expecting end of file in C:laragonwwwfarmerconfigconfig.php on line 4"
Here is my updated config.php
<?php
include_once('fix_mysql.inc.php');
<?php
mysql_connect("localhost", "root", "newton2010") or die(mysql_error());
mysql_select_db("farmer") or die(mysql_error());
?>
<?Php
//session_start();
$dbhost_name = "localhost";
$database = "farmer";// database name
$username = "root"; // user name
$password = "newton2010"; // password
//////// Do not Edit below /////////
try {
$dbo = new PDO('mysql:host=localhost;dbname='.$database, $username, $password);
} catch (PDOException $e) {
print "Error!: " . $e->getMessage() . "<br/>";
die();
}
?>
add a comment |
I used the recommendation made by @sadikhasan on using fix.mysql.inc.php
Then I ran into this new error "Parse error: syntax error, unexpected '<', expecting end of file in C:laragonwwwfarmerconfigconfig.php on line 4"
Here is my updated config.php
<?php
include_once('fix_mysql.inc.php');
<?php
mysql_connect("localhost", "root", "newton2010") or die(mysql_error());
mysql_select_db("farmer") or die(mysql_error());
?>
<?Php
//session_start();
$dbhost_name = "localhost";
$database = "farmer";// database name
$username = "root"; // user name
$password = "newton2010"; // password
//////// Do not Edit below /////////
try {
$dbo = new PDO('mysql:host=localhost;dbname='.$database, $username, $password);
} catch (PDOException $e) {
print "Error!: " . $e->getMessage() . "<br/>";
die();
}
?>
add a comment |
I used the recommendation made by @sadikhasan on using fix.mysql.inc.php
Then I ran into this new error "Parse error: syntax error, unexpected '<', expecting end of file in C:laragonwwwfarmerconfigconfig.php on line 4"
Here is my updated config.php
<?php
include_once('fix_mysql.inc.php');
<?php
mysql_connect("localhost", "root", "newton2010") or die(mysql_error());
mysql_select_db("farmer") or die(mysql_error());
?>
<?Php
//session_start();
$dbhost_name = "localhost";
$database = "farmer";// database name
$username = "root"; // user name
$password = "newton2010"; // password
//////// Do not Edit below /////////
try {
$dbo = new PDO('mysql:host=localhost;dbname='.$database, $username, $password);
} catch (PDOException $e) {
print "Error!: " . $e->getMessage() . "<br/>";
die();
}
?>
I used the recommendation made by @sadikhasan on using fix.mysql.inc.php
Then I ran into this new error "Parse error: syntax error, unexpected '<', expecting end of file in C:laragonwwwfarmerconfigconfig.php on line 4"
Here is my updated config.php
<?php
include_once('fix_mysql.inc.php');
<?php
mysql_connect("localhost", "root", "newton2010") or die(mysql_error());
mysql_select_db("farmer") or die(mysql_error());
?>
<?Php
//session_start();
$dbhost_name = "localhost";
$database = "farmer";// database name
$username = "root"; // user name
$password = "newton2010"; // password
//////// Do not Edit below /////////
try {
$dbo = new PDO('mysql:host=localhost;dbname='.$database, $username, $password);
} catch (PDOException $e) {
print "Error!: " . $e->getMessage() . "<br/>";
die();
}
?>
answered Nov 16 '18 at 14:58
Isaac OngomaIsaac Ongoma
12
12
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53338807%2fi-have-run-to-this-error-while-running-my-project%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I guess you're running PHP 7.
mysql_connect()
doesn't exist in PHP 7 anymore. You should have a look atmysqli_connect()
instead.– Dirk Scholten
Nov 16 '18 at 13:29
this is telling you that mysql_* functions are not available in that server, use phpinfo() to check which version of php it is, if it is 7, then it means those functions are removed
– noid
Nov 16 '18 at 13:30
Read this may helpful to you stackoverflow.com/a/13825126/2893413
– Sadikhasan
Nov 16 '18 at 13:37
try mysqli_connect method instead mysql_connect
– Manoj Singh
Nov 16 '18 at 13:39
it may help you stackoverflow.com/questions/34088373/…
– Manoj Singh
Nov 16 '18 at 13:41