epiz_30157065
The error is output facing here
whereas working in other PHP processors
according to this code
My code used for PHP
// database connection code
// $con = mysqli_connect('fdb31.biz.ht', '3911959_myd', 'Nithin@123','3911959_myd');
$con = mysqli_connect('fdb31.biz.ht', '3911959_myd', 'Nithin@123','3911959_myd');
// get the post records
$name = $_POST['name'];
$email = $_POST['email'];
$sub = $_POST['sub'];
$message = $_POST['message'];
echo "<p style=color:#333>Hello ".$name." !<br><p>";
// database insert SQL code
$sql = "INSERT INTO `tbl_message` (`Id`, `Name`, `EMail`, `Subject`, `Message`) VALUES ('0', '$name', '$email', '$sub','$message')";
// insert in database
$rs = mysqli_query($con, $sql);
if($rs)
{
echo "<p style=color:green>Thank You !<br>Your Message Recieved<br><p>";
}
else
{
echo "<p style=color:red>Sorry !<br>There is an Error in submitting your message<p><br>";
}
1 Like
@simhaatsimha , you have shared your database password, which means anyone can log into your database and alter anything he/she wishes. Please change your password and remove it from your post.
I believe you cannot connect to external databases here. You can follow these guides (in order):
Many scripts require a MySQL database to work, and you will need to create a new database to use with your script. This article describes how to create a database and get the necessary settings for your script.
Create a new database
Before you can use a database, you need to create it first.
Login to your client area and go to the Accounts list.
Find your hosting account in the list and click Manage.
Click the Control Panel button in the account overview page.
Go to MySQL Databases.
In the fi…
Both the popular PDO and MySQLi libraries are available on all accounts and PHP versions, which are the libraries all (modern) scripts use to connect to a MySQL database. However, to use a database, you need to configure a few things first.
Before you can use a database, you need to create the database first. You can create a database through your control panel in the section called MySQL Databases. Simply enter a desired name in the text box and click Create Database.
To use the database with…
Many websites use MySQL databases to store information and settings. However, there are some reasons why the connection to the database may fail. This article describes some commonly seen error messages when connecting to a database, as well as some general tips to keep in mind when setting up a database connection.
Common Error Messages
Using MySQL is great, but the error message returned if there is an issue logging in to your database can be quite confusing. Here are some commonly seen error…
EDIT: Are you hosting on InfinityFree? because biz.ht is another hosting service.
2 Likes
simhaatsimha:
// $con = mysqli_connect(‘fdb31.biz.ht’, ‘3911959_myd’, ‘Nithin@123’,‘3911959_myd’);
$con = mysqli_connect(‘fdb31.biz.ht’, ‘3911959_myd’, ‘Nithin@123’,‘3911959_myd’);
This is totally incorrect. Please use the data from the control panel and the client area. Also, change your password, as you just publicly exposed it.
2 Likes
system
Closed
October 31, 2021, 3:39pm
4
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.