zend-db

Load Zend Framework Component in Existing Project

自闭症网瘾萝莉.ら 提交于 2019-12-12 06:02:21
问题 I am new to PHP and very new to Zend Framework, so please give me a detailed answer. I have Zend Server (including Zend Framework), Apache, MySql installed on the machine. I have a project created in Eclipse PDT (not with Zend Framework) and I've decided I want to use Zend_Db in my Data Acces Layer. I read many answers here and on other forums, I saw that I should use Zend_Loader but I am not really sure how to begin. I also saw that I need some php extension appropriate to the type of my

How can you translate this query into zend framework 2 syntax?

情到浓时终转凉″ 提交于 2019-12-12 04:36:42
问题 I haven't figure it out, how to translate this query into zend framework syntax, any help would be apreciated. SELECT p.idProyecto,p.nombre, p.nombre, e.nombre, e.apellido, sum(Respuesta.estimado) as estimado, DATE_FORMAT(p.fechaInicio, '%Y/%m/%d') as inicio, DATE_FORMAT(p.fechaFin, '%Y/%m/%d') as fin, sum(DetailTotals.Total) as total FROM Actividad as a LEFT JOIN ( SELECT a2.idActividad, sum(ar2.tiempoEstimado) as estimado FROM actividadResponsable as ar2 JOIN actividad as a2 on ar2

ZF2: How to do this simple query with Zend\Db

馋奶兔 提交于 2019-12-12 03:09:02
问题 I have the following statements but they return an empty result set: $sql = 'SELECT * FROM `industry` WHERE `code` LIKE ?'; $statement = $this->getAdapter()->createStatement($sql, array('A_')); $statement->execute(); What am I doing wrong? I really don't want to use the Zend\Db\Sql\Sql, as it is very verbose. On a related point, where can I go to find out more about the theory of operation for Zend\Db? It's absolutely maddening. Why does it sometimes return a driver result? Sometimes a

How mvc works in Zend framework

不羁的心 提交于 2019-12-12 00:33:56
问题 Thanks for previous replies.. I am trying to print Hello_world using zend framework. I wrote php file in model folder and return string value as a "Hello_world". In controller i access the value of PHP like this $value = new TextReturner(); $this->view->setValue = $value->hello_world(); . i dont know how to access the value from controller to the view php file. I am new to zend framework. I already go through the outline structure of zend framework, i dont know how to access through codings.

Zend Framwork Session on Internet Explorer [duplicate]

自闭症网瘾萝莉.ら 提交于 2019-12-11 18:28:27
问题 This question already has answers here : Zend framework session lost (2 answers) Closed 6 years ago . Still couldn't make it works after post this link: Zend framework session lost I have this Sign up form that allow users to register and redirect them right away to their pages. All work great on every browsers except INTERNET EXPLORER . I have tried different ways, but still can't make it to work. After the user is saved to database the session won't store. But if I take out the save of the

What is wrong with this where clause of zend query

依然范特西╮ 提交于 2019-12-11 15:03:46
问题 Hi I am mad on not understanding the error in this where clause of zend query. My query is $select->where("id=".$get['value']." OR description like '%".$get['value']."%'"); $get['value'] is the query that I want to search. But result is 500 internal server error and it always says the value of get['value'] is unkown column. For example if I have searched testing for description column it always says that testing in unknown columns... why is this happening 回答1: Check this docs zend_db_select

ZF2 / PHPUnit: Mock a Zend/Db/Adapter/Adapter for further usage

为君一笑 提交于 2019-12-11 11:46:51
问题 The goal: Unit test an InputFilter in Zend Framework 2. The problem: A mocked DbAdapter is needed. As I am relatively new to Unit Testing I just got started with mocking classes. After doing a lot of research I'm still unable to find a proper solution for my problem so here we go with my filter to start things off: class ExampleFilter extends Inputfilter { protected $dbAdapter; public function __construct(AdapterInterface $dbAdapter) { $this->dbAdapter = $dbAdapter; } public function init() {

Should dependent rows be fetched in the Model or the Controller?

别等时光非礼了梦想. 提交于 2019-12-11 11:30:13
问题 Let me start with a simple example to show how my data is structured. There are four tables, Employee , Store , Department , and Employee_Department_Permissions . Departments belong to Stores (for example, the Department table might contain a record for the dairy department of store 5). Employees are given the right to work in Departments through the Employee_Department_Permissions table, which contains the Employee id and Department id. Let's say an employee can log in to my application and

zend paginator make other links and Action Calling concatinating with the URL

你。 提交于 2019-12-11 09:46:57
问题 I am NEW to ZF .i used zend paginator in my first project .its working fine that is switching b/w pages with right result but the problem is that i have other links too in that view have a look to my view <?php include "header.phtml"; ?> <h1><?php echo $this->escape($this->title);?></h1> <h2><?php echo $this->escape($this->description);?></h2> <a href="register">Register</a> <table border="1" align="center"> <tr> <th>User Name</th> <th>First Name</th> <th>Last Name</th> <th>Action</th> </tr>

Zend Db / Mysql - Insert with Select

时光毁灭记忆、已成空白 提交于 2019-12-11 06:46:54
问题 I am trying to find the best way to do this, better if I could use Zend_db_table. Basically I am inserting a row and one of the values comes from the same DB, this value changes constantly so I need to be sure the data inserted is valid. I can't query first for the value and then append it to the insert query because between the two queries the data could change and I end up inserting the wrong value. I wonder if LOCKING the table is the way to go or if Zend has a shortcut. I'm using Mysql.