How to import and export a mysql database from the command line
Sometimes you need to use the command line to export or import a mysql database.
Here is how you do it:
mysqldump -u theUser -p theDataBaseName > /path/to/dump/to/export.dump
mysql -u theUser -p theDataBaseName < /path/to/dump/to/import.dump
- liviu's blog
- Login or register to post comments
- Read more
How to reindex an array in php
If you have an array and want to reindex it to have the keys starting from 0 and be consecutive, you can use array_values, which does just that.
You can use it when lets say you want to iterate through it with a for (and not a foreach).
- liviu's blog
- Login or register to post comments
How to make an image with php
This is a nice example of how to make an image with php using the GD extension.
It was taken from
| Programming PHP, 2nd Edition | ||
| By Rasmus Lerdorf, Peter MacIntyre, Kevin Tatroe |
"
- liviu's blog
- Login or register to post comments
- Read more
Querying a mysql database with php example
This example was taken from
| Programming PHP, 2nd Edition | ||
| By Rasmus Lerdorf, Peter MacIntyre, Kevin Tatroe | ||
| ............................................... | ||
- liviu's blog
- Login or register to post comments
- Read more
How to disable right click with javascript
I don't remember where i found this script to disable right click using javascript.
- liviu's blog
- Login or register to post comments
- Read more
How to have ie6 and ie7 both installed
If you're in the field of site creation you will often need to check how a site looks and behaves in different browsers. Usually Firefox and internet explorer 7 and 6. But you can't install ie6 if you have ie7. A way around that is to use a great program, Multiple Ie. This program will install for you IE3 IE4.01 IE5 IE5.5 and IE6.
You can find a download link at the bottom of this page, and more information related to the project.
- liviu's blog
- Login or register to post comments
How to add an event to an element in javascript
You can add events in javascript to elements. I don't know if i ever saw this used but it can be very useful. I've seen this done a lot in actionscript.
To add an event to an element you get he element first in a variable (usually with document.getElementById(id) ) and then use the method addEventListener.
Here is an example:
<a href="#" id="link1">click here</a>
- liviu's blog
- Login or register to post comments
- Read more
How to speed up your mysql queries
Ran into this while reading Ubuntu Linux Unleashed, 2008 Edition. It's a great book about linux mainly, but also has some basics about mysql, apache, php, pearl, python and some other goodies (definitely worth buying of you are a programmer and wanna get into linux).
At some point it had some tips on how to optimize queries in mysql:
- liviu's blog
- Login or register to post comments
- Read more
Firebug for internet explorer (ie)
Ever needed firebug but for internet explorer?
Well such a thing exists; it's called Internet Explorer Developer Toolbar (yey for ie).
It has about the same functionality as firebug, so it's a great tool.
Somehow it's not as cool as firebug but it does it's job.
- liviu's blog
- Login or register to post comments
- Read more
A nice Marquee example
The marquee tag is nice for advertising. It should be used i think on the web, because the effect is decent and it's very easy to implement.
Example:
- liviu's blog
- Login or register to post comments
- Read more