
I need a php script which inserts data into two databases
4776
£10(approx. $13)
- Posted:
- Proposals: 10
- Remote
- #255870
- Archived
PHP | MYSQL | Node | Angular| Wordpress | CodeIgniter | Jquery | HTML | CSS | Javascript

Php/MySql, Angular Ionic Framework, React-Native, X-Cart, JQuery, AWS, Laravel, AWS, Magento 2, Wordpress
Web, Graphic, Animation, Programming, Database and many other digital solutions
I am highly experienced in various Open Source technology. Already worked on very high volume open source projects for big companies. I will provide you a quality code which can bear any circumstances
2879464090503898994485633984991265298881423920295791350653
Description
Experience Level: Entry
Hi I need a php script which inserts data into two databases, attached is the code I have so far however I cant get it to work :)
include('config.php');
// Passkey that got from link
$passkey=$_GET['passkey'];
$tbl_name1="temp_users";
// Retrieve data from table where row that match this passkey
$sql1="SELECT * FROM $tbl_name1 WHERE confirm_code ='$passkey'";
$result1=mysql_query($sql1);
// If successfully queried
if($result1){
// Count how many row has this passkey
$count=mysql_num_rows($result1);
// if found this passkey in our database, retrieve data from table "temp_users"
if($count==1){
$rows=mysql_fetch_array($result1);
$domain_id=$rows['domain_id'];
$user=$rows['user'];
$forward_email=$rows['forward_email'];
$password=$rows['password'];
$source=$rows['user'];
$destination=$rows['forward_email'];
$tbl_name2="virtual_users";
$sql2 = "INSERT INTO `$tbl_name2` (`user`,`password`,`destination`) VALUES ('$user','$password','$destination')";
$result2 = mysql_query($sql2,$conn) or die('[ERR:'.__LINE__.']: '.mysql_error());
$tbl_name3="virtual_aliases";
// Insert data that retrieves from "temp_members_db" into table "virtual_aliases"
$sql3 = "INSERT INTO `$tbl_name3` (`domain_id`,`sorce`,`destination`) VALUES ('$domain_id','$source','$destination')";
$result3 = mysql_query($sql3,$conn) or die('[ERR:'.__LINE__.']: '.mysql_error());
}
// if not found passkey, display message "Wrong Confirmation code"
else {
echo "Wrong Confirmation code";
}
// if successfully moved data from table"temp_users" to table "registered_members" displays message "Your account has been activated" and don't forget to delete confirmation code from table "temp_members_db"
if($result3){
echo "Your account has been activated";
// Delete information of this user from table "temp_members_db" that has this passkey
$sql4="DELETE FROM $tbl_name1 WHERE confirm_code = '$passkey'";
$result4=mysql_query($sql4);
}
}
include('config.php');
// Passkey that got from link
$passkey=$_GET['passkey'];
$tbl_name1="temp_users";
// Retrieve data from table where row that match this passkey
$sql1="SELECT * FROM $tbl_name1 WHERE confirm_code ='$passkey'";
$result1=mysql_query($sql1);
// If successfully queried
if($result1){
// Count how many row has this passkey
$count=mysql_num_rows($result1);
// if found this passkey in our database, retrieve data from table "temp_users"
if($count==1){
$rows=mysql_fetch_array($result1);
$domain_id=$rows['domain_id'];
$user=$rows['user'];
$forward_email=$rows['forward_email'];
$password=$rows['password'];
$source=$rows['user'];
$destination=$rows['forward_email'];
$tbl_name2="virtual_users";
$sql2 = "INSERT INTO `$tbl_name2` (`user`,`password`,`destination`) VALUES ('$user','$password','$destination')";
$result2 = mysql_query($sql2,$conn) or die('[ERR:'.__LINE__.']: '.mysql_error());
$tbl_name3="virtual_aliases";
// Insert data that retrieves from "temp_members_db" into table "virtual_aliases"
$sql3 = "INSERT INTO `$tbl_name3` (`domain_id`,`sorce`,`destination`) VALUES ('$domain_id','$source','$destination')";
$result3 = mysql_query($sql3,$conn) or die('[ERR:'.__LINE__.']: '.mysql_error());
}
// if not found passkey, display message "Wrong Confirmation code"
else {
echo "Wrong Confirmation code";
}
// if successfully moved data from table"temp_users" to table "registered_members" displays message "Your account has been activated" and don't forget to delete confirmation code from table "temp_members_db"
if($result3){
echo "Your account has been activated";
// Delete information of this user from table "temp_members_db" that has this passkey
$sql4="DELETE FROM $tbl_name1 WHERE confirm_code = '$passkey'";
$result4=mysql_query($sql4);
}
}
Michael B.
100% (9)Projects Completed
15
Freelancers worked with
15
Projects awarded
46%
Last project
23 Oct 2017
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies