Filed Under (Others) by admin on 23-01-2012
To display the executed query using the codeigniter database class
insert the line of code below
echo $this->db->last_query();
$this->db->last_query(); //returns the last executed query
————————————————————————————————-
So if your code is like this
$this->db->select('*');
$this->db->from('sales');
$query = $this->db->get();
echo $this->db->last_query();
// Adding echo $this->db->last_query(); will output the query on the page like this
// SELECT * FROM sales;
Filed Under (Others) by admin on 18-01-2012
mysqldump -u username -p Password database_name | gzip > database_backup.sql.gz
Filed Under (Others) by admin on 29-12-2011
When we backup we want to add a date on the filename to know when the file was created
Try this line
tar -zcvf database_backup_$(date +%m-%d-%Y).tar.gz /DB/data
Filed Under (Others, mysql) by admin on 14-12-2011
Tagged Under : mysql
Example errors:
“Duplicate entry ’123711155′ for key ‘PRIMARY’” or “Duplicate entry ’14676163′ for key ’1′”
Most likely this happens for tables with more than 5 million records
THE FIX
The fix is to use repair table
REPAIR TABLE <TABLE_NAME>;
Note: Sometimes the duplicate error is also caused by your field type having the maximum value already, for example in tinyint which has the maximum value of 127 so it better to use bigint for your auto ids, if this is not the case you can try the solution above.
Filed Under (Others) by admin on 09-11-2011
1. Go to your titanium project folder
then
2. Run this command
python titanium.py run --platform=android --android=/path/to/android-sdk
3. It’s Done
Note: Your titanium project folder should have the ff:
build build.log LICENSE manifest README Resources tiapp.xml
Filed Under (Others) by admin on 29-08-2011
Most likely this is caused by a closed svn port on your svn server
Login to your svn server then do the following
1. Check first if svn is running
ps aux | grep svnserve
2. If it is not running restart the svn service
svnserve -d -r path_of_svn
Filed Under (Others) by admin on 10-08-2011
Tagged Under : android
Delete an android virtual device a.k.a AVD
Type this on the terminal
android delete avd -n name_of_device
Filed Under (Others) by admin on 19-07-2011
Hide the android window title bar on Titanium mobile
var win_home = Titanium.UI.createWindow({navBarHidden:true});
Filed Under (Others) by admin on 19-07-2011
Possible cause you did not use the reverse domain name for the “–id” flag (i.e com.itlivewire.MyProject)
In creating your titanium mobile project “–id” should be in reverse domain format
e.g.
python titanium.py create --platform=android --android=/path/to/android-sdk --id=com.itlivewire.MyProject --name=MyProject
Filed Under (Others) by admin on 19-07-2011
Create a titanium mobile android project using command line
titanium create --platform=android --android=/path/to/android-sdk --id=com.itlivewire.MyProject --name=MyProject
or
python titanium.py create --platform=android --android=/path/to/android-sdk --id=com.itlivewire.Myproject --name=MyProject