Where with POST next insert in mysql database table

I want to get a number from POST and check it against the id column in my table and get the name of this row. In the following code outputting with print_r works, but each of the values I stored in the table order just with the value 0 (but in print_r values them not 0 and is same what i want) how can fix this problem? (i use codeigniter)

$query_cu    = $this->db->get_where('info', array(
    'id' => $this->input->post('number')
))->row();
$query_re    = $this->db->get_where('info', array(
    'id' => $this->input->post('recommend')
))->row();
$query_urf = $this->db->get_where('foreign', array(
    'id' => $this->input->post('name')
))->row();

$data  = array(
    'name' => $query_urf->name,
    'recommend' => $query_re->name,
    'number' => $query_cu->name       
);
$this->db->insert('order', $data);

echo '<pre>';
echo print_r($data1);

Answers


What is the structure of your 'order' table? If print_r($data) has the correct info I would double check that the columns have the proper format (text, varchar, etc) to handle the data.


Need Your Help

Semi-distinct union

mysql union union-all

There are UNION and UNION ALL operators in SQL. The first one drops all the duplicates, the second one doesn't. I want to drop only duplicates which originated in different subqueries, but keep those

How are records stored in erlang, and how are they mutated?

optimization erlang

I recently came across some code that looked something like the following:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.