$collection-toArray()
Regards,
Bill Karwin
the
fetchAll() method if you want an array of all rows returned in one call.
See both fetchArray() and fetchAll() documented here:
http://www.doctrine-project.org/docs/dbal/2.0/en/reference/data-retrieval-and-manipulation.html#fetchall
Regards,
Bill Karwin
--
List: fw-general@lists.zend.com
Info
.
Regards,
Bill Karwin
input from my website.
I'd build a filter that wraps HtmlPurifier, to be honest...
+1 to Matthew; do not reinvent the wheel when it comes to security,
unless you are a bona fide security expert.
Regards,
Bill Karwin
no community code
review.
You're right, HtmlPurifier is not perfect of course -- I suppose it
will only be 95% effective at helping you avoid the security
vulnerabilities you are about to spend days or weeks coding from
scratch.
Good luck!
Regards,
Bill Karwin
. This is almost
never true, unless you're only developing a demo.
Form processing is complex because information is complex. There is
no form processing that is as simple as you describe, while also
supporting the range of options that developers need.
Regards,
Bill Karwin
/manual/en/zend.registry.using.html
Regards,
Bill Karwin
is really the greatest bottleneck in your application. Hint:
it's probably not.
When it comes to performance, don't be penny wise and pound foolish.
Focus on your application's areas of greatest performance cost before
giving attention to micro-optimizations.
Regards,
Bill Karwin
they don't get documented in that page
of the manual.
I don't have a recommendation at this time for any One True Way of
autoloading classes - either Models or Tables.
Regards,
Bill Karwin
, and postpone loading code to the point when the
class is referenced.
Regards,
Bill Karwin
with a LIMIT clause is not standard SQL, and as far as I know
it's supported only by MySQL.
Any solutions?
DELETE statements with vendor-specific syntax you should build
manually as strings, and execute them with $db-query().
Regards,
Bill Karwin
for quoting values, not identifiers.
Regards,
Bill Karwin
On Sep 3, 2010, at 7:38 AM, Hector Virgen wrote:
Zend_Db_Adapter_Abstract#update() will automatically quote
identifiers in the $data array (aka $bind), but not the $where
array. Have you tried without manually quoting the $data array
is
found. Knowing the salt for a given password hash is crucial for that
process, but it still doesn't mean the attacker can get the password
in one step.
Regards,
Bill Karwin
. Don't even favor
security by obscurity. In some ways, I think it's better *not* to
make your code or database obscure at all, if that encourages you to
strengthen more effective security measures to prevent attackers from
gaining access.
Regards,
Bill Karwin
possibilities:
- The files in svn contain an error, and your local copy has fixed
files.
- The files on the server have been modified, and aren't in sync with
svn.
- The imbalanced brace is in some other file on the server, besides
those that you track in svn.
Regards,
Bill Karwin
://stackoverflow.com/questions/1968253/zend-log-in-application-ini/2034893#2034893
In that answer I posted a workaround of creating the Log manually in a
bootstrap init handler, and adding a db writer to the Log.
Regards,
Bill Karwin
parser for the SQL
grammar. This would take many weeks, assuming you know how to write
parsers from scratch (without the aid of a parser generator like yacc,
bison, or ANTLR). Have you taken a class in Compiler Design?
Regards,
Bill Karwin
On Aug 12, 2010, at 9:28 AM, Andrei Iarus wrote:
I
On Aug 12, 2010, at 9:41 AM, Jigal sanders wrote:
2.Select `user`.* FROM `user` WHERE( usr_email = `em...@adres.com`)
LIMIT 1
For one thing, use single-quotes for string literals. The back-ticks
are for table names and column names.
Regards,
Bill Karwin
));
$result = $stmt-rowCount();
Regards,
Bill Karwin
in
the profiler. See documentation for example code.
Regards,
Bill Karwin
On Aug 12, 2010, at 2:11 PM, Jigal sanders wrote:
Bill Thanks for your time.
Do you suggest that i paste the code below in an controllerAction
and then execute it?
.
Basically, you need to get more diagnostic information about the
query. We can stare all day at PHP code that generates SQL without
diagnosing the problem.
Regards,
Bill Karwin
on the functional requirements
and the usage patterns of your app.
Sorry to say it, but internet resources like this mailing list can
only tell you how to use a given technology, not whether that
technology is right for your app.
Regards,
Bill Karwin
like small images,
javascript, and CSS.
Use a paid delivery network (e.g. Akamai) for large media like
videos. They should give you a simple interface to request a given
media file. Then they take care of optimizing for geography/
topology. Don't try to do that yourself.
Regards,
Bill
with EXPLAIN (or equivalent) and profile carefully
with sample data of realistic size.
Regards,
Bill Karwin
| PRIMARY | j |2 |
++-+-+--+
Regards,
Bill Karwin
the result set on successive executions.
Regards,
Bill Karwin
connections on your production website, it's most likely you have
15 concurrent requests.
However, if you're getting the error on your development/test
environment, and you are certain that only one request is active,
that's a different matter.
Regards,
Bill Karwin
that application
architecture matters far more than technical details like the choice
of API.
I would recommend against micro-optimizing, and especially premature
micro-optimizing.
Regards,
Bill Karwin
-trips as a
significant performance factor, because it discourages people from
using prepared queries when they should.
Regards,
Bill Karwin
a
garbage collection problem.
Setting a valid fetch mode should not close the cursor, it only
changes the fetch mode for subsequent fetches. I.e. you can (in
theory) change the fetch mode several times as you fetch rows from the
same result set.
Regards,
Bill Karwin
On May 25, 2010
a new connection only if you weren't connected yet. This is
part of the lazy-connection logic.
Regards,
Bill Karwin
On May 24, 2010, at 7:14 AM, Саша Стаменковић wrote:
I'm asking because I see quote method in exception trace:
2010-05-20T10:08:40+02:00 ERR (3): exception
difficult to
write a quoting function that's safe.
Read
http://shiflett.org/blog/2006/jan/addslashes-versus-mysql-real-escape-string
Regards,
Bill Karwin
change to some other storage engine.
Regards,
Bill Karwin
On Mar 29, 2010, at 3:54 AM, Guillaume ORIOL wrote:
Hi,
I was working on an application that uses cascade delete and
discovered a bug that was already known and reported.
I was wondering why the corresponding issue
http
and probably better.
Regards,
Bill Karwin
On Mar 29, 2010, at 9:21 AM, Jared Williams wrote:
Sqlite 3.6.19 and later have RI,
http://www.sqlite.org/foreignkeys.html .
Jared
-Original Message-
From: Bill Karwin [mailto:b...@karwin.com]
Sent: 29 March 2010 17:03
To: fw-general@lists.zend.com
I think it would be a good idea to deprecate cascading update delete
from Zend_Db, but I suppose too many people rely on it now.
Perhaps it can be a goal of Zend Framework 2.0.
Regards,
Bill Karwin
On Mar 29, 2010, at 10:11 AM, Guillaume ORIOL wrote:
Thank you for your advice.
I am using
\FactoryFactoryFactory? :-)
Regards,
Bill Karwin
, because it discourages people from
using prepared queries when they should.
Regards,
Bill Karwin
-is-fastest-in-php-mysql-or-mysqli/171445#171445
Regards,
Bill Karwin
encapsulated it in a
Model class, instead of littering your Controller with business rules.
Regards,
Bill Karwin
.
Regards,
Bill Karwin
-A, rather than IS-A.
See my blog for more of my comments on this.
Or don't trust my opinion, but read Martin Fowler's discussion of the
Anemic Domain Model antipattern.
Regards,
Bill Karwin
.
Regards,
Bill Karwin
of
Zend_Db_Table. It solves the problem with a single declaration, so
you don't have to write any code.
Regards,
Bill Karwin
that if you do this, your table name should conform to PEAR class
naming conventions. E.g. a class named bugs_tbl should be defined
in file bugs/tbl.php.
Regards,
Bill Karwin
common cases. Not every interface needs to support
every bit of functionality.
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/Passing-custom-options-to-findManyToManyRowset-tp19778865p19785382.html
Sent from the Zend Framework mailing list archive at Nabble.com.
Bill Karwin wrote:
If you need options to be in effect, you can either build those into the
class definition for your related table, or else you can forget about
table-relationships methods and instead instantiate tables yourself.
Actually, I have to correct myself. There is a way
it. :-)
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/multiple-models-with-same-name-%28m1-models-pages.php-and-m2-models-pages.php%29-tp19607614p19632344.html
Sent from the Zend Framework mailing list archive at Nabble.com.
=
outer.foo
Note I had to suppress columns from t2, or else the derived table would have
duplicate columns.
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/Zend_Db_Select%3A-nested-joins-tp19636627p19637378.html
Sent from the Zend Framework mailing list archive
. :-)
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/Zend_Db_Select%3A-nested-joins-tp19636627p19638152.html
Sent from the Zend Framework mailing list archive at Nabble.com.
for
in the last place you look -- naturally, because there's no need to keep
looking after you've found it! :-)
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/multiple-models-with-same-name-%28m1-models-pages.php-and-m2-models-pages.php%29-tp19607614p19611162.html
Sent
modules to create friendly URL's like
/myapp/admin/controller/action but you can do this by creating custom
router rules. You don't have to use modules simply to define URL's.
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/multiple-models-with-same-name-%28m1-models
José de Menezes Soares Neto wrote:
There is a way to find similar queries?
http://php.net/soundex
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/Soundex-tp19619868p19619905.html
Sent from the Zend Framework mailing list archive at Nabble.com.
off indexing your text data with a real search engine like
Lucene or Sphinx. Lucene even has a PHP implementation in Zend Framework.
If you use MySQL's MyISAM storage engine, you can also use FULLTEXT indexing
as a feature of the database.
Regards,
Bill Karwin
--
View this message in context
Jason Webster wrote:
That's not necessary. I believe you. I was more curious if it would,
rather than attempting to point out an error.
:-) Well, *I* sometimes don't believe me, so it's usually worth doing a
quick experiment to be sure.
Trust but verify!
Regards,
Bill Karwin
--
View
Nikolay Alexeev wrote:
SELECT *,'aaa' AS product
FROM tablename
$select = $db-select()-from('tablename',
array(
new Zend_Db_Expr('*'),
new Zend_Db_Expr('aaa')
)
);
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/Zend_Db_Select
(Zend_Db_Adapter_Pdo_Oci), it should support both ?
and :bindName parameters for Oracle.
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/Zend-Db-Table-Relation-on-Oracle-database-tp18987000p18987759.html
Sent from the Zend Framework mailing list archive at Nabble.com.
for the change, it's not going to
happen until at least ZF 2.0.
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/Overriding-Zend_Loader%3A%3AloadClass%28%29-tp18905575p18909243.html
Sent from the Zend Framework mailing list archive at Nabble.com.
that access.
Zend_Db has the lastSequenceId() function, which in turn queries SELECT
sequencename.CURRVAL FROM dual (given a sequence called sequencename).
But of course this requires that you have the privilege to call the function
on the sequence.
Regards,
Bill Karwin
--
View this message
to hear about it, since I'm not an Oracle expert specifically.
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/Zend_Db-PDO-OCI-Oracle-%2B-RETURNING-clause-tp18852478p18855926.html
Sent from the Zend Framework mailing list archive at Nabble.com.
on this topic because I think your earlier statements indicate
that you think there's a concurrency issue with using sequences in a
high-volume environment. I don't think you need to worry, sequences are
designed to solve this issue. You can talk to your DBA to confirm this.
Regards,
Bill Karwin
--
View
evaluates to true for all rows,
this would explain why the update is being applied to all rows.
The code you show above is the example out of the manual. I assume your
actual code and database structure is different. So I can't tell why your
code is acting the way it is.
Regards,
Bill Karwin
is the responsibility of the application,
not the framework (or the language). Only the application developer knows
when it's the right thing to do.
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/Cross-site-scripting-in-Zend_Db_Statement_Exception-handling-tp18716897p18738104
some other types of calculations in mind, you're going to have
to be more explicit.
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/IP-calculations-tp18717349p18743238.html
Sent from the Zend Framework mailing list archive at Nabble.com.
internals.
The example given is that E_DEPRECATED will be triggered if you try to use
the is_a() function.
Also, until ZF officially requires PHP 5.3 as a minimum version, ZF should
not make use of features that are new in that version.
Regards,
Bill Karwin
--
View this message in context
SELECT queries internally, so you don't
have an opportunity to append the FOR UPDATE clause in that case. You can't
specify this clause for queries run by Zend_Db_Table objects (except if
you're willing to hack the internals of this class, and also
Zend_Db_Table_Row).
Regards,
Bill Karwin
.
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/Zend_Deprecation-is-ready-for-community-review.-tp18513175p18514041.html
Sent from the Zend Framework mailing list archive at Nabble.com.
deprecated! ;-)
You'd want a static method to do the above, so why not add it to Zend_Debug,
which many folks have complained is a bit thin anyway.
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/Zend_Deprecation-is-ready-for-community-review.-tp18513175p18517017.html
to serialize the access to the tables, by using table or
row locking, or by managing access with an interprocess semaphore.
It's likely that you can redesign your application architecture so you don't
encounter this conflict.
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com
to
undefined variables raise an E_USER_NOTICE error.
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/some-simple-questions-tp18448329p18449186.html
Sent from the Zend Framework mailing list archive at Nabble.com.
($select);
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/select-...-from-...-where-...-in-tp18280581p18283075.html
Sent from the Zend Framework mailing list archive at Nabble.com.
or can't
automate.
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/Why-haven%27t-you-reviewed-the-Zend_Tool-proposals--tp18221384p18266535.html
Sent from the Zend Framework mailing list archive at Nabble.com.
and Acceptance Criteria
- only one Use Case written
- nothing written under Class Skeletons
Zend_Tool_Rpc:
- only four lines under Requirements and Acceptance Criteria (two of which
are will not exclusions)
- nothing written under Use Cases
- nothing written under Class Skeletons
Regards,
Bill
this information.
Zend_Db_Select makes it pretty easy to do this safely (quoting table
identifiers, etc.).
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/Extendable-models-with-MySQL%2C-Zend_Db_Table-and-Zend_Form-tp18105740p18125630.html
Sent from the Zend Framework
question marks inside strings in your query. So you are
bound to get results like the following:
SELECT * FROM mytable WHERE id = :idvalue AND quotation = 'Et tu, brute%s'
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/Zend_Db--%3E-last-query-with-values
.
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/Zend_Db--%3E-last-query-with-values-tp17738679p17986125.html
Sent from the Zend Framework mailing list archive at Nabble.com.
#zend.db.adapter.select.fetchpairs
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/How-i-can-fetch-array-only-with-desired-data--tp17780211p17784524.html
Sent from the Zend Framework mailing list archive at Nabble.com.
, $value6) );
If you need to insert multiple rows, you need to spell out the SQL yourself:
$stmt = $table-getAdapter()-prepare('INSERT INTO tablename (col1, col2,
col3) VALUES (?, ?, ?), (?, ?, ?)');
$stmt-execute( array($value1, $value2, $value3, $value4, $value5,
$value6) );
Regards,
Bill Karwin
Mark Steudel-3 wrote:
Is there a way outsde of the profiler to get the sql string with parameter
values? like the select __toString() method?
No, this information is not synthesized anywhere in Zend_Db classes, because
it would be wrong.
Regards,
Bill Karwin
--
View this message
:
$sqlExpr = $db-quoteInto('WHERE bigintColumn = ?', '2147483648',
Zend_Db::BIGINT_TYPE);
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/Quote-all-database-query-parameters-tp16002047s16154p16004872.html
Sent from the Zend Framework mailing list archive at Nabble.com.
$this-objDb-commit();
}
protected function _saveUserGroups()
{
// no transaction controls - rely on caller
$this-objDb-insert( ... );
...
}
}
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/Zend_Db-Transactions---How-to-get-a-initiate-transaction
is the dependent. You are querying the
reverse relationship, which does not exist in this example.
Use this:
$article-findParentRow('Author');
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/Zend_Db_Table%3A-Problem-with-Relatationships-tp15882889s16154p15883753.html
Sent
. However, if one of these values is in turn an
array, it passes that to quoteInto() and it uses that method's support for
comma-separated lists.
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/Passing-array-of-values-to-db-statement-tp15813319s16154p15815470.html
the pattern of expr as alias and assumes it should use the
latter word as an alias as if you had given it as an assoc array key.
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/Zend_Db_Table-I-have-problems-reading-columns%27-alliases-tp15779311s16154p15780877.html
Sent
Jora wrote:
How can I get the sql which has been excuted by Zend_Db_Table?
Enable the Zend_Db_Profiler before you do a Table query.
See http://framework.zend.com/manual/en/zend.db.profiler.html
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/about
from
strangers on the internet. Get an opinion from a qualified legal
professional about this issue before you make business decisions.
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/License-Compatibility-tp15742503s16154p15743500.html
Sent from the Zend Framework
Jordan Moore wrote:
I pulled the following excerpt from the full license
(http://creativecommons.org/licenses/by-sa/3.0/legalcode), and it
seems to me that it does have an as-is clause.
Aha! I see now. I didn't notice the link to the full license in that web
page.
Regards,
Bill Karwin
of is to use a parameter for the
pattern string in your LIKE predicate. But this doesn't work if PDO is
emulating parameters by interpolating the parameter values into the
SQL string at execute time.
Regards,
Bill Karwin
Julian Davchev wrote:
Yep, seems so. If only mysqli wasn't eating
this:
$stmt = $db-prepare(INSERT INTO words (word) VALUES (';?'));
$stmt-execute();
mysql SELECT * FROM words;
+-+
| word|
+-+
| ;? |
+-+
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/Quesion-mark-breaks
noticing that the parameter
placeholder is inside a quoted string.
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/Quesion-mark-breaks-queries-as-it-expects-to-bound-them-tp15586615s16154p15624052.html
Sent from the Zend Framework mailing list archive at Nabble.com.
frameworks for the benefit they give to development
and maintenance. But don't expect the opcode cache to be a magical way to
make everything run faster.
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/Caching-of-MVC-and-other-ZF-components-tp15576554s16154p15599812.html
you
are trying to form.
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/Quesion-mark-breaks-queries-as-it-expects-to-bound-them-tp15586615s16154p15600217.html
Sent from the Zend Framework mailing list archive at Nabble.com.
all files in 5.3+, regardless of how and when and in which way
they were included.
Great to hear! If only Achilles had been able to upgrade his heel in a
similar way. :-)
Will that be for Zend Platform's opcode cache only, or will it also help APC
and Xcache?
Regards,
Bill Karwin
--
View
/browse/ZF-1498
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/Zend_Db_Table_Abstract-is-making-Apache-Segmentation-Fault-With-LONGTEXT-columns-in-Mysqli-tp15602697s16154p15603336.html
Sent from the Zend Framework mailing list archive at Nabble.com.
extension, or ODBC, JDBC,
etc.
The solution you found using BEGIN/END seems to be the recommended solution.
See this article about executing Oracle SP's from PHP:
http://www.oracle.com/technology/pub/articles/oracle_php_cookbook/fuecks_sps.html
Regards,
Bill Karwin
--
View this message in context
than doing inserts in a loop.
See also http://dev.mysql.com/doc/refman/5.1/en/insert-speed.html for more
tips.
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/Zend-DB-tp15459316s16154p15461543.html
Sent from the Zend Framework mailing list archive at Nabble.com.
attributes you mention, collation and extra are not
returned in the information set.
Regards,
Bill Karwin
Romeo-Adrian Cioaba wrote:
is there a way to find out the field, type, collation, attributes, null,
default and extra for a specific row returned by $object-fetchRow('$id =
1')?
--
View
at the command-line yourself.
As Darby mentioned, you must have phpDocumentor installed on your system.
Note that generating the phpdoc for the entire ZF library takes a large
amount of memory, so you'll probably have to edit your php.ini to increase
your memory_limit.
Regards,
Bill Karwin
Darby
If you define the sequence name yourself, try using the lastSequenceId()
method, and pass the name of the sequence as the argument to that method.
Regards,
Bill Karwin.
Jan Pieper wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: RIPEMD160
I tried to use Zend_Db with PDO_PGSQL. After
, and also preserve backward compatibility:
where('a IN (?) AND b = ?', array(10, 20, 30), 'foo')
Yields:
WHERE a IN ('10', '20', '30') AND b = 'foo'
Regards,
Bill Karwin
--
View this message in context:
http://www.nabble.com/Zend_Db_Select%3A%3Awhere%28%29-malfunction-tf4842393s16154.html
separately as parameters, so they are combined with
the query at execute-time on the RDBMS server. No quoting is needed.
The identifiers (table and column names) are quoted as delimited
identifiers, according to the syntax used by the RDBMS to which you're
connected.
Regards,
Bill Karwin
-Original
1 - 100 of 378 matches
Mail list logo