02.06.2013 Views

Pro PHP and jQuery by Jason Lengstorf.pdf - Computer Science ...

Pro PHP and jQuery by Jason Lengstorf.pdf - Computer Science ...

Pro PHP and jQuery by Jason Lengstorf.pdf - Computer Science ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

194<br />

CHAPTER 5 ■ ADD CONTROLS TO CREATE, EDIT, AND DELETE EVENTS<br />

}<br />

}<br />

try<br />

{<br />

LIMIT 1";<br />

$stmt = $this->db->prepare($sql);<br />

$stmt->bindParam(<br />

":id",<br />

$id,<br />

PDO::PARAM_INT<br />

);<br />

$stmt->execute();<br />

$stmt->closeCursor();<br />

header("Location: ./");<br />

return;<br />

}<br />

catch ( Exception $e )<br />

{<br />

return $e->getMessage();<br />

}<br />

/*<br />

* If not confirmed, sends the user to the main view<br />

*/<br />

else<br />

{<br />

header("Location: ./");<br />

return;<br />

}<br />

/*<br />

* If the confirmation form hasn't been submitted, display it<br />

*/<br />

$event = $this->_loadEventById($id);<br />

/*<br />

* If no object is returned, return to the main view<br />

*/<br />

if ( !is_object($event) ) { header("Location: ./"); }<br />

return

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!