Welcome Guest, Not a member yet? Register   Sign In
Can someone "translate" this in plain English to me, please?
#3

[eluser]Blaze Boy[/eluser]
[quote author="cold_fusion" date="1262495063"]
Code:
$update['id'] = (!empty($_POST['id'])) ? $this->input->post('id') : null;

i suppose this line allows the id field to be null. however i need it never to be null. if i remove ": null", it throws
the "unexpected ;" error[/quote]

this line will put $update['id'] with null if it's not sent with post ...
the idea is to show error of it's not sent
if( $this->input->post('id') ) $update['id'] = $this->input->post('id');
else show_error('error: id must be set');


Messages In This Thread
Can someone "translate" this in plain English to me, please? - by El Forum - 01-02-2010, 05:14 PM



Theme © iAndrew 2016 - Forum software by © MyBB