CodeIgniter Forums
ASK: how to get table name of the current query - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: ASK: how to get table name of the current query (/showthread.php?tid=8820)



ASK: how to get table name of the current query - El Forum - 06-02-2008

[eluser]Unknown[/eluser]
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.


ASK: how to get table name of the current query - El Forum - 06-02-2008

[eluser]xwero[/eluser]
Custom Function Calls


ASK: how to get table name of the current query - El Forum - 06-02-2008

[eluser]Unknown[/eluser]
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..


ASK: how to get table name of the current query - El Forum - 06-02-2008

[eluser]xwero[/eluser]
you have to remove the mysql_ part that is added by the method


ASK: how to get table name of the current query - El Forum - 06-02-2008

[eluser]Seppo[/eluser]
And probably the single quotes around $query and $row->id