data to be saved in db gets truncated???
Posted: Mon Dec 29, 2008 12:00 pm
Using amfphp and flex, I'm trying to make a service that would register a new customer into a db. Having tested it directly in the amfphp's service browser, the service itself works fine BUT... say the address is "1234 blablah avenue", only "1234" gets saved.
You guys have any idea what I have to change in order to grab the whole address?
I know the code below is very basic, but once it fully works, I'll look into preventing sql injections, etc.
You guys have any idea what I have to change in order to grab the whole address?
I know the code below is very basic, but once it fully works, I'll look into preventing sql injections, etc.
Code: Select all
<?php
include_once("con_sql.php");
class Customer
{
var $dbhost = HOSTNAME;
var $dbname = DATABASE;
var $dbuser = USERNAME;
var $dbpass = PASSWORD;
function Customer()
{
$this->methodTable = array(
"insertCustomer" => array(
"description" => "Inserts a new client",
"access" => "remote", // available values are private, public, remote
"arguments" => array ("eml", "pwd", "fname", "lname", "address", "city", "state", "zip", "phone")
)
);
$this->conn = mysql_pconnect($this->dbhost, $this->dbuser, $this->dbpass);
mysql_select_db ($this->dbname);
}
function insertCustomer($eml, $pwd, $fname, $lname, $dob, $address, $city, $state, $zip, $phone)
{
//Insert query
$result = mysql_query("Insert into customers values('', '".$eml."', '".$pwd."', '".$fname."', '".$lname."', '".$dob."', '".$address."', '".$city."', '".state."', '".$zip."', '".$phone."')");
if($result) return mysql_insert_id($this->conn);
else return "error";
}
}
?>