EllisLab text mark
Advanced Search
     
ASK: how to get table name of the current query
Posted: 02 June 2008 07:45 AM
Joined: 2008-06-02
2 posts

i’m new bie here… please some body help me to fix this problem..
i’d like to retrieve table name of the current query..
i used to use mysql_field_table().. but i’don’t know how to do that in CI..
please somebody help me.

 
Posted: 02 June 2008 07:59 AM   [ # 1 ]   [ Rating: 0 ]
Joined: 2006-07-14
4237 posts

Custom Function Calls

 
Posted: 02 June 2008 08:34 AM   [ # 2 ]   [ Rating: 0 ]
Joined: 2008-06-02
2 posts

thanks for the solution..
i’ve try use the custom function call..
there are some error reports says:
“An Error Was Encountered This feature is not available for the database you are using”
do i write the wrong code or something?
here are my codes:

<?
$query= $this->db->query(‘select * from sub where id=2’);
$row = $query->row();
echo $this->db->call_function(‘mysql_field_table’,’$query’,’$row->id’);
?>

thanks..

 
Posted: 02 June 2008 08:44 AM   [ # 3 ]   [ Rating: 0 ]
Joined: 2006-07-14
4237 posts

you have to remove the mysql_ part that is added by the method

 
Posted: 02 June 2008 09:36 AM   [ # 4 ]   [ Rating: 0 ]
Avatar
Joined: 2006-10-18
503 posts

And probably the single quotes around $query and $row->id

 Signature 

Once in a while I remember I use Twitter