Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

silwalprabin on "Insert to custom Table does not Work"

$
0
0

My complete code is:

[insert_php]
global $wpdb;
$name = $_POST[txt_name];
$middlename = $_POST[txt_name];
$surname = $_POST[txt_surname];
$username = $_POST[txt_username];
$password = $_POST[txt_password];
$email = $_POST[txt_email];
$phone = $_POST[txt_phone];
$securityq = $_POST[txt_securityq];
$securitya = $_POST[txt_securitya];
$offerid = 1;
if($wpdb->query( $wpdb->prepare( "INSERT INTO $wpdb->user_reg( Name,Middle_Name,Last_Name,username,password,email,mobile,security_q,security_a)
                    VALUES (%s,%s,%s,%s,%s,%s,%d,%s,%s)",$name,$middlename,$surname,$username,$password,$email,$phone,$securityq,$securitya)))
echo "Sucess";
else
echo "NO";

[/insert_php]
<form class="reg_form" action="" method="post" enctype="multipart/form-data">

	Name:<input type="text" name="txt_name" id="txt_name">
	Sur Name: <input type="text" name="txt_surname" id="txt_surname">
       UserName <input type="text" name="txt_username" id="txt_username">
	Password:<input type="password" name="txt_password" id="txt_password">
	Email: <input type="text" name="txt_email" id="txt_email">
	Phone:<input type="text" name="txt_phone" id="txt_phone">
	Security Question<input type="text" name="txt_securityq" id="txt_securityq">
	Security Answer<input type="text" name="txt_securitya" id="txt_securitya">
	<input type="submit" name="btn_submit" id="btn_submit" value=:"Register">
</form>

[Moderator Note: Please post code or markup between backticks or use the code button. Or better still - use a pastebin. Your posted code may now have been permanently damaged by the forum's parser.]


Viewing all articles
Browse latest Browse all 8245

Trending Articles