[TriLUG] Help!

David Rasch rasch at raschnet.com
Thu Jun 16 09:00:55 EDT 2005


On Thu, Jun 16, 2005 at 08:56:57AM -0400, Brian McCullough <bdmc at bdmcc-us.com> wrote:
> Group,
> 
> This is getting me very frustrated.
> 
> 
> What does the one-word MySQL error "mismatch" mean?
> 
> I am trying to do an insert into a table that I have created and have
> tried both prepare-execute and query.  Both get that error.  I have
> several Not NULL columns and a few NULL ones.  Most of the columns are
> Varchar, with a couple of integer ( short, I think ) and Datetime
> columns as well. The primary key is an autoincrement integer column.
> 
> My insert, in Pear-PHP, is attempting to insert a single row, of course,
> by filling all of the Not NULL columns with appropriate values.
> 
> I was able to insert a row into the table using PHPMySQLAdmin so that
> much seems right.

Brian,

This isn't actually a MySQL, rather it's an error from the PEAR DB
framework indicating the number of parameter slots typically designated
with a ? does not match the number of parameters being passed in the
array.  For example:

$prepared = $db->prepare("select * from mytable where a=? and b=?");
$db->execute($prepared, array(4));

This will generate a mismatch error since i'm only passing in one
argument and the framework is expecting 2.

I also offer a shameless plug for TriPUG as an alternative forum for
questions regarding PHP.

-David
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://www.trilug.org/pipermail/trilug/attachments/20050616/14714527/attachment.pgp>


More information about the TriLUG mailing list