Page 1 of 1

GPS Coordinates , data not saving

Posted: 29 Apr 2010, 14:02
by dwainm
Good Day

I have modified the Pocha Gallery backend by adding fields for GPS coordinates, I have added the fields in the database
namely sc1, sc2,sc3 (south coordinate) and ec1,ec2,ec3( east coordinate). The form field names are the same as the database field names.

Everything works to the point where the data is posted( look the line below )

//line code

Code: Select all

$id	= $model->store($post); //you get id and you store the table data
The $post contains the the data I desire , but when It gets to the following, it does not to link the data in the post to the row. and subsequently all other data is saved but not the custom fields.

Code: Select all

	
function store($data) {  ....
	$row =& $this->getTable();
                
		// Bind the form fields to the Phoca gallery table
		if (!$row->bind($data)) {
			$this->setError($this->_db->getErrorMsg());
			return false;
		}

   .....
		// Store the Phoca gallery table to the database
		if (!$row->store()) {
			$this->setError($this->_db->getErrorMsg());
			return false;
		}

Re: GPS Coordinates , data not saving

Posted: 29 Apr 2010, 22:00
by Jan
Hi, it is not so easy, you need to:

- add the columns to database
- set the column names in table file (see table folder in administration)
- se the column names to model while donwloading default values.

Jan