Welcome Guest, Not a member yet? Register   Sign In
MySQL trigger, table alias problem
#1

[eluser]deczo[/eluser]
Hi there,
There is a problem when doing INSERT on a MySQL table with trigger set up.

The query works just fine without the trigger, but whenever I use the trigger it returns this error:

Code:
A Database Error Occurred

        
Error Number: 1146

Table 'DB_NAME_HERE.t' doesn't exist

INSERT INTO serwis_sales SET status_id=1...
the query is invoked like this (and it is OK):
Code:
$this->db->query(sprintf('INSERT INTO serwis_sales SET status_id=1 ...

I have no idea why CI renames/aliases the table.

BTW the trigger works fine when inserting data in phpmyadmin and mysql cli.

Any suggestion appreciated!
#2

[eluser]deczo[/eluser]
Anybody?
Has no one ever used mysql triggers with CI?

Oh c'mon Smile

Any hints will do!
#3

[eluser]tonanbarbarian[/eluser]
since you are using sprintf with the query command it might help if you gave the complete command you are trying to run
to my knowledge CI does not alias tables so maybe something is going wrong with your sprintf




Theme © iAndrew 2016 - Forum software by © MyBB