Re: [fw-general] Zend_DB_TABLE and mysqli permission

2007-10-04 Thread mihu

thanks for reply and it's just my mistake.
The database configuration wasn't correct. My bad ... 

thanks all 


mihu wrote:
> 
> Is there some sort of mysqli permission limitation?
> I got a exceptions from Zend_DB_TABLE and I am thinking it might be
> something to do w/ mysqli user permission.
> 
> Can someone clear this for me?
> 
> thanks, 
> 

-- 
View this message in context: 
http://www.nabble.com/Zend_DB_TABLE-and-mysqli-permission-tf4552830s16154.html#a13041803
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] RE : [fw-general] Zend_DB_TABLE and mysqli permission

2007-10-02 Thread Aissam Bazzaoui
i got an amazing error like this yesterday :p

SQLSTATE[42000]: Syntax error or access violation:
1064 You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version
for the right syntax to use near 'to=1)' at line 10#0
/home/aissam/workspace/fotomod/library/Zend/Db/Statement.php(298):
Zend_Db_Statement_Pdo->_execute(Array) #1

after a bit of debugging i found that they have
nothing 
to do with access violation.

in case your made the same mistake as me, i describe
the problem there:

the instruction causing the exception was : 
 $msg->fetchAll(array("to=?"=>$id));

the problem was in field named to, that generate a
query like this :
 SELECT ... WHERE (to=1)
things that mysql doesn't like since "to" is reserved
word 

to resolved  this you must quote identifier :
 $to=$msg->getAdapter()->quoteIdentifier('to');
 $msg->fetchAll(array("$to=?"=>$id));

i don't know if it'll be a good idea if we quote the
identifier automaticly by default on mysql (at least
on Zend_Db_Adapter_Pdo_Mysql). Any way the note appear
clearly on the manuel (RTFM :p)

[
Note

The values and identifiers in the SQL expression are
not quoted for you. If you have values or identifiers
that require quoting, you are responsible for doing
this. Use the quote(), quoteInto(), and
quoteIdentifier() methods of the database adapter. 
]

i hope that this will help :)


--- mihu <[EMAIL PROTECTED]> a écrit :

> 
> Is there some sort of mysqli permission limitation?
> I got a exceptions from Zend_DB_TABLE and I am
> thinking it might be
> something to do w/ mysqli user permission.
> 
> Can someone clear this for me?
> 
> thanks, 
> -- 
> View this message in context:
>
http://www.nabble.com/Zend_DB_TABLE-and-mysqli-permission-tf4552830s16154.html#a12992638
> Sent from the Zend Framework mailing list archive at
> Nabble.com.
> 
> 



RE: [fw-general] Zend_DB_TABLE and mysqli permission

2007-10-01 Thread Bill Karwin
> -Original Message-
> From: mihu [mailto:[EMAIL PROTECTED] 

> I got a exceptions from Zend_DB_TABLE and I am thinking it 
> might be something to do w/ mysqli user permission.
> 
> Can someone clear this for me?

Can you show one of the exceptions?  Have you tried running the same
query from another environment, such as the mysql query tool or
phpmyadmin?  Make sure you try this using the same mysql username that
you use in your ZF app.  Also log into the mysql instance from the host
where you run your ZF apps, because it is possible for the same username
to have different permissions depending on the client host from which
you connect to mysql.

Regards,
Bill Karwin