943,169 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 42
  • PHP RSS
Sep 3rd, 2010
0

form values are not storing in the database

Expand Post »
the problem is town and user values is not adding to the database,other than this feilds,other thuings are working down.......
please,give me your suggestions.

//database.php//


function addReceipe($resname,$restype,$rescatg,$resing,$resmethod){
if(!get_magic_quotes_gpc()){
$resname = addslashes($resname);
$restype = addslashes($restype);
$rescatg = addslashes($rescatg);
$resing = addslashes($resing);
$resmethod = addslashes($resmethod);
}
$q = "INSERT INTO ".TBL_RECEIPE."(rescp_name,rescp_type,rescp_catg,rescp_ing,rescp_method) VALUES ('$resname','$restype', '$rescatg', '$resing', '$resmethod')";
return mysql_query($q, $this->connection);
}

function addTown($townname,$pincode){
if(!get_magic_quotes_gpc()){
$townname = addslashes($townname);
$pincode = addslashes($pincode);

}
$q = "INSERT INTO ".poovai_townlist."(townname,pincode) VALUES ('$townname','$pincode') ";
return mysql_query($q, $this->connection);

}

function addUser($name,$homeno,$address1,$address2,$address3,$city,$pincode){
if(!get_magic_quotes_gpc()){
$name = addslashes($name);
$homeno = addslashes($homeno);
$address1 = addslashes($address1);
$address2 = addslashes($address2);
$address3 = addslashes($address3);
$city = addslashes($city);
$pincode = addslashes($pincode);
}
$q = "INSERT INTO ".Cust_Address."(name,townid,city,homeno,address1,address2,address3,pincode) VALUES ('$name',(select townid from poovai_townlist where townname='$city'),'$city','$homeno','$address1','$address2','$address3','$pincode')";
return mysql_query($q, $this->connection);
}



//the form of the above database is adminprocess.php//



/* Admin submitted to add receipe */
else if(isset($_POST['addrescp'])){
$this->procAddReceipe();
}

/* Admin submitted to add news */
else if(isset($_POST['addnews'])){
$this->procAddNews();
}



/*users added in the Cust_address list syed added*/
else if(isset($_POST['adduser'])){
$this->procAddUser();
}


/* procAddtown - Adds the townname to the townlist table */
procAddtown - Adds the townname, pincode to the townlist table and sub-town name and pincode to the subtownlist table */
function procAddTown(){
global $session,$database;
$s = $database->addTown($_POST['townname'] , $_POST['pincode']);

if(isset($_POST['subtownname'])){
if($_POST['subtownname']){
$st = $database->addSubTown($_POST['pincode'] , $_POST['subtownname'], $_POST['subtownpincode']);
}
else{
$st=2;
}
}
header("Location:".$session->referrer."?tbl=13&queryR=".$s."&queryRR=".$st);
}



/*procAddUser - Adds the user history in Cust_Address table*/
function procAddUser(){
global $session, $database;
$s = $database->addUser($_POST['name'], $_POST['homeno'], $_POST['address1'], $_POST['address2'], $_POST['address3'], $_POST['city'], $_POST['pincode']);
header("Location:".$session->referrer);
}
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
d.jobinraj is offline Offline
2 posts
since Sep 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: form values are not storing in the database
Next Thread in PHP Forum Timeline: Translation using php script





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC