I am trying to INSERT values from 'temp_table' table to another table 'users' both are present in same database i am successfully performing operations on 'temp_table'. when ever i am trying to insert the values into 'users' table it is showing strange error called. Table 'u694572518_libra.INTOusers' doesn't exist. I performed same 'INSERT' operation for another table which also located in same table, i am getting same 'table doesn't exist' error. please solve anyone.
<?php
include ('connections.php');
$passkey=$_GET['passkey']; // getting key from url
$sql1="select * from ".USTEMPN." where confirm_code='".$passkey."'"; // checking for matching key in temp table.
$result1=mysql_query($sql1, $con) or die(mysql_error());
if($result1)// control not entering into if condition.
{
$count=mysql_num_rows($result1);
if($count==1)
{
$rows=mysql_fetch_array($result1);
//echo $rows;
$name = $rows['uname'];
$email=$rows['email'];
$password=$rows['pswd'];
$phone = $rows['phno'];
$address=$rows['adres'];
$dob=$rows['dob'];
$education=$rows['educon'];
$tbl_name2='users';
$sql2="INSERT INTO" .USREG. "(name, email, password, phone, address, dob, education)VALUES('".$name."', '".$email."', '".$password."', '".$phone."', '".$address."', '".$dob."','".$education."')"; // getting error here
$result2=mysql_query($sql2,$con) or die (mysql_error());
}
USREG -> defined as 'users' defined in 'connections.php' file USTEMPN -> defined as 'temp_table' defined in 'connections.php' file and the error is Table 'u694572518_libra.INTOusers' doesn't exist
Aucun commentaire:
Enregistrer un commentaire