Welcome Guest, Not a member yet? Register   Sign In
codeigniter query
#1

[eluser]Zied[/eluser]
how can i save the codeigniter query & simple query in sql file without to execute ?
#2

[eluser]Zied[/eluser]
I need to have file.sql contain :

UPDATE `tbl_shop` SET `page_url` = 'http://www.sfsfsdf' WHERE `tbl_shop`.`id_shop` =10484;
UPDATE `tbl_shop` SET `page_url` = 'http://rrrrrrrbdgb' WHERE `tbl_shop`.`id_shop` =10455;
UPDATE `tbl_shop` SET `page_url` = 'http://www.sfsfsdf' WHERE `tbl_shop`.`id_shop` =10484;
UPDATE `tbl_shop` SET `page_url` = 'http://rrggdgrbdgb' WHERE `tbl_shop`.`id_shop` =10455;

to run this query in another database.
#3

[eluser]Atharva[/eluser]
For backing up db, have a look at database utilities class

http://ellislab.com/codeigniter/user-gui...tml#backup
#4

[eluser]Zied[/eluser]
Think you, but this is not my question.
My question is the way to save the query lines in simple file.
I found the solution, is to create the query with:
Code:
$query=$this->db->query($sql);
return $sql;
#5

[eluser]LuckyFella73[/eluser]
When using the active record class you can get the query like this:
Code:
$my_query = $this->db->last_query();




Theme © iAndrew 2016 - Forum software by © MyBB