How to import and export a mysql database from the command line

Tagged:  

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

How to reindex an array in php

Tagged:  

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).

How to make an image with php

Tagged:  

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

"

Querying a mysql database with php example

Tagged:  
This example was taken from 
Programming PHP, 2nd Edition
By Rasmus Lerdorf, Peter MacIntyre, Kevin Tatroe
...............................................

How to disable right click with javascript

Tagged:  

I don't remember where i found this script to disable right click using javascript.

How to have ie6 and ie7 both installed

Tagged:  

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.

How to add an event to an element in javascript

Tagged:  

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>

How to speed up your mysql queries

Tagged:  

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:

Firebug for internet explorer (ie)

Tagged:  

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.

A nice Marquee example

Tagged:  

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:

Syndicate content