Active record query max length? |
[eluser]bartlomiejr[/eluser]
I have many similar functions to that below but this one doesn't work. SQL is 100% tested. What am i doing wrong? Maybe this query is too long for CI Active record? Model function: Code: public function getActualRank($user_id, $id_quiz) Controller: Code: $rank = $this->Home_model->getActualRank(21, 1);
[eluser]juanvillegas[/eluser]
I think you should discard the "query too long issue". Does that program output something? You should post the error to help us debug that. Just curious here, why are you using raw queries instead of active record? The guys behind active record would be very sad hah
[eluser]bartlomiejr[/eluser]
When i check manual in MySQL i get desired effect: I think my syntax is correct. Error: Code: A Database Error Occurred
[eluser]bartlomiejr[/eluser]
I get yet a similar error in this function below. Both sql inserts shold be together. When I paste sql from CI error in mysqladmin everything works. Please help. Code: public function createUser() Code: A Database Error Occurred
[eluser]Nick_MyShuitings[/eluser]
[quote author="juanvillegas" date="1304740120"]I think you should discard the "query too long issue". Does that program output something? You should post the error to help us debug that. Just curious here, why are you using raw queries instead of active record? The guys behind active record would be very sad hah[/quote] Wrong... the guys behind Active Record would be glad... you do realize Active record is just a crutch for idiots who can't write SQL? Why do you think they've not updated it in the last forever adding in the oh so demanded ability to do nested Where statements or selects within selects. If he is able to write RAW SQL, then he should bloody well do so, and avoid the unnecessary processing overhead of Active Record. He should however, take advantage of query bindings for security. [/end rant]
[eluser]Nick_MyShuitings[/eluser]
That said... have you checked the actual MySQL logs to see what command is being run by CI? I've found there are sometimes issues when using MySQL variables @asdfasdf... and when attempting to run two queries with one $this->db->query() command. This could be due to how the driver is written, but I've never taken the time to slueth that code.
[eluser]bartlomiejr[/eluser]
I solved both problems. the problem was that php mysql_query or $ this-> db-> query () doen't support multiple queries. Solution: Code: public function getRank($id_quiz)
[eluser]Nick_MyShuitings[/eluser]
Kudos... and even better a thanks for having the etiquette to make sure to post the solution. |
Welcome Guest, Not a member yet? Register Sign In |