MOVED - When passing variable to DB statement value is changing |
[eluser]RJ[/eluser]
Hi, Having a problem, when I set class variables from input and print the results they are as expected: Code: $this->MSISDN = $this->input->post('MSISDN'); But when I add those to the query below the values are changed to '1'?? Code: $TT->select('devicetype'); Even when I try directly from post, the result is below: Quote:SELECT devicetype, TO_CHAR(subversion) Any idea why this is occurring and how to fix? Thank you. EDIT The only way I can get something other than '1' to pass is by hard coding like below: Code: $TT->where(array( Note no '123456' quotes around the numbers, if there are quotes it doesn't work; other variations of the query I've tried with the same result: Code: //Active Record Method Chaining
[eluser]RJ[/eluser]
I settled with this query: Code: $query = $TT->query("SELECT devicetype, TO_CHAR(subversion) FROM ttdevice WHERE msisdn = '".$this->MSISDN."' AND unitid = '".$this->UNITID."'"); Just can't get the damn thing to return any results. Submitting now Code: $query = $TT->query("SELECT * FROM ttdevice"); the result is -1. I know the db is there, am i missing something?
[eluser]RJ[/eluser]
Object results Quote:CI_DB_odbc_result Object ( [conn_id] => Resource id #123 [result_id] => Resource id #124 [result_array] => Array ( ) [result_object] => Array ( ) [current_row] => 0 [num_rows] => -1 [row_data] => )
[eluser]jedd[/eluser]
What does the profiler reveal about your actual query? I can recommend formatting your ->query stuff to make it more readable - syntax bugs stand out much more obviously, eg. Code: $query = $this->db->query ("SELECT message.id AS message_id, Btw, been meaning to ask for some time, but is the misspelling in your sig some post-modern or ironical reference to enjoying bad-writing?
[eluser]RJ[/eluser]
In all instances the profiler will not display the odbc query, not sure why. I am using multiple databases, default is an sql that does show up in the profiler; when I run this other query, which is a form_validation callback method, it does not show. I moved the thread to here when I finally was able to find the results.. num_rows check is screwing it all up. http://ellislab.com/forums/viewthread/111959/ Good suggestion. Nope, user error! LOL, thanks! |
Welcome Guest, Not a member yet? Register Sign In |