Welcome Guest, Not a member yet? Register   Sign In
pushing $_post data into an array
#1

[eluser]dan.syme[/eluser]
I was looking through the scaffolding framework to see how CI handled $_POST data to insert into a database.

I haven't been able to get the same methods to work however.

this is what I have.

function insert()
{

$this->db->insert($table, $_POST);

}

so far a no go. thoughts?

Thanks,
#2

[eluser]danmontgomery[/eluser]
Maybe you can provide some details...? The query being generated? Error messages? Values in $_POST?
#3

[eluser]Colin Williams[/eluser]
That's only going to work if $_POST matches your DB table schema exactly.

Think about it; see the data moving around in your head. You're throwing mud against a wall, and when it doesn't stick, you throw your hands up and say, "It didn't stick!? What's wrong. Someone help."
#4

[eluser]dan.syme[/eluser]
ya the $_POST data does match exactly. It actually works fine but was having issues elsewhere pertaining to an incorrect switch statement running the wrong query. all fine now.




Theme © iAndrew 2016 - Forum software by © MyBB