<?php
$host = "localhost";
$user = "root";
$pass = "";
$databaseName = "foresight";
$tableName = "userinfo";
$con = mysql_connect($host,$user,$pass);
$dbs = mysql_select_db($databaseName, $con);
$result = mysql_query("SELECT * FROM $tableName where flag != 1"); //query
$email = mysql_fetch_row($result); //fetch result
mysql_close( $con );
?>
<?php
$connection = mysql_connect("192.232.240.245","root","causealmedus-1608");
if (!$connection)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("foresight", $connection);
while($email)
{
$sql="INSERT INTO userinfo ('email')
VALUES
('" . $email['email'] . "')";
if (!mysql_query($sql,$connection))
{
die('Error: ' . mysql_error());
}
echo $email;
//and using connection of localhost you have to update same record with status 1 at localhost.
}
mysql_close($con)
?>
i face the following error:Could not connect: No connection could be made because the target machine actively refused it.
nileshbhanu 0 Nilesh bhanushali
veedeoo 474 Junior Poster Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.