Categories
Uncategorized Zend Framework 1.12

Go Back to Referring page Zend Framework

Tutorial on how to go back to previous page Zend Framework Controller: $request = $this->getRequest(); $referrer = $request->getHeader(‘referer’); $this->view->referer = $referer; View:

Categories
SQL

Connecting MySQL Workbench to Server MySQL

Use: GRANT ALL ON *.* to root@’%’ IDENTIFIED BY ‘your-root-password’; Use % as host if you don’t know where user is connecting from. Also make sure Mysql is running and that iptables is not blocking the port. The above solves this error: Host … is not allowed to connect to this MySQL server

Categories
Zend Framework 1.12

How to use count(*) in Zend Select Statement

public function getCount() { $select = $this->select(); $select->from($this, array(‘count(*) as amount’)); $rows = $this->fetchAll($select); return($rows[0]->amount); }

Categories
Zend Framework 1.12

Zend Executing a straight SQL query without a Model

How to Execute a straight SQL query without the hassle of a model. #application/controlers/MyController.php I assume the Database is setup in the config file, Application.ini. $dbAdapter = Zend_Db_Table::getDefaultAdapter(); $sql =’SELECT * FROM users WHERE id > 23′; $statement = $dbAdapter->query($sql); $row = $statement->fetch(); if ($arr[‘id’] == 45) $this->view->response = ‘yes’; else $this->view->response = ‘no’; If […]

Categories
git

How to remove a tracked file after a .gitignore update

git update-index –assume-unchanged source: stackoverflow