You are not logged in.
I'm fairly new to the Zend Frame work and I love your casts :-D
I'm trying to understand some of the decisions you have made during them like:-
In this episode of ZendCasts you used a router to inform the framework that the final item in the URI was the id of the record to be edited or deleted.
Why did you not use a URI like
/index/update/id/7
surely this would lower the risk of failure in the future because you would not have to remember the change to the router.
Thanks in advance
Martin
Offline
Hi martin,
this is the default functionality of the framework, and while its good as a starting point, such a route isn't search-engine optimized. Obviously, any conventions you choose to apply in you application will need to be documented and kept for your own sanity!
Offline
Hi I want ask something about delete Action.
If we want to delete some row but I don;t know the id of PK but I have another 2 condition in where.
Like example I have name & email, in query sql must be :
DELETE FROM users
WHERE name = 'Eric' AND email = 'eric@email.com'
So how to do it in Zend?
Thanks.
Offline
hi Akongz,
Example 18 on the documentation works in a similar way:
http://framework.zend.com/manual/en/zend.db.select.html
$minimumPrice = 100;
$maximumPrice = 500;
$select = $db->select()
->from('products',
array('product_id', 'product_name', 'price'))
->where('price > ?', $minimumPrice)
->where('price < ?', $maximumPrice);
I think you'll want to create a where clause and then pass it into the proper Zend_Db_* class instance.
Offline
Hi jon,
I mean the code example delete is below :
$where = $table->getAdapter()->quoteInto('bug_id = ?', 1234);
$table->update($data, $where);
How to do same if I have 2 condition to delete something.
Are the parameter $where provide something array()?
like example below :
$where[] = $table->getAdapter()->quoteInto('name = ?', $name);
$where[] = $table->getAdapter()->quoteInto('description= ?', $description);
$table->update($data, $where);
And I already googling and I don't find any article about what different of methods quote(), quoteInto(), and quoteIdentifier(). Can u explain different the methods?
Thanks before
Offline