How do we do the verification in front end? We send down only html but not
data so there is no original string to compare with after user change it.
Currently I am using a hidden input to submit section id, if we want to
bring back more info like id we have to either add one more hidden input or
use some format we have to parse on server.

I mean, I thought about that... but since our app is not write-intensive I
guess the perf hit to db is acceptable. Let me know if there is better
alternative solution.

Tianyu


On Fri, Apr 18, 2014 at 11:22 AM, leirocky <notifications@github.com> wrote:

> In application/models/prayer_model.php:
>
> > +    		$scriptureQuery = $this->db->get_where($this->
> scriptureTable, array('date' => $maxDate));
> > +    		return $scriptureQuery->row_array();
> > +    	}
> > +    	return null;
> > +    }
> > +
> > +    /**
> > +     * get_prayerItem
> > +     *
> > +     * Check if the given description already exists as a prayer item, if it does return the row,
> > +     * otherwise return null.
> > +     *
> > +     */
> > +    function get_prayerItem($description)
> > +    {
> > +    	$itemQuery = $this->db->get_where($this->itemTable, array('description' => $description));
>
> If description is a long string, this will take long time to query. it is
> better to just insert this one as a new item. or you could do this
> verification in the front end. or remember the id and use id to query if
> user doesn't change the content.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/Triassic/XiaoLongBao/pull/98/files#r11781633>
> .
>