Comandos básicos do SQL

Bom, hoje vou mostrar alguns comandos básicos do SQL que podem ser utilizados na maioria dos bancos de dados


Inserir dados:

INSERT INTO nome_da_tabela (nome_da_coluna_1,nome_da_coluna_2) VALUES(15,'valores');

Para cada coluna que você colocar no insert você deve colocar seu valor na mesma posição nos VALUES

Atualizar dados:

UPDATE nome_da_tabela SET nome_da_coluna_1 = 22, nome_da_coluna_2 = 'novos valores';

No UPDATE nós podemos utilizar o WHERE (onde) que serve para fazermos condições, exemplo:
Atualize todos os dados onde o status do usuário esteja ativo. Mais na frente aprenderemos como utilizar o WHERE.

Apagar dados:

DELETE FROM nome_da_tabela;

Aqui nós também podemos utilizar condições WHERE.

Localizar dados:

SELECT nome_da_coluna_1, nome_da_columa_2 FROM nome_da_tabela;

Aqui nós também podemos utilizar condições WHERE.

Outros Comandos

# WHERE <-- Condição (Onde)
WHERE
    (coluna1 = coluna2 AND status = 1) OR
    (coluna4 IS NOT NULL) OR
    (coluna5 IS NULL) 

# LIMIT <-- (Limite) Limita o numero de resultados em uma consulta
LIMITE 4 <-- Retorna 4 resultados de sua consulta caso haja tais registros

# Tem também o LIMIT dessa forma
LIMIT 10,20
# Pega do registro 10 até o Registro 20

# ORDER BY (Ordena por)

ORDER BY coluna1 DESC # <-- DESC/ASC (Descrecente/Crescente)

Até mais!

240 plugins jquery – Separados por categoria

Form Validation

jQuery Validation.
Auto Help.
Simple jQuery form validation.
jQuery XAV – form validations.
jQuery AlphaNumeric.
Masked Input.
TypeWatch Plugin.
Text limiter for form fields.
Ajax Username Check with jQuery.

File upload

Ajax File Upload.
jQUploader.
Multiple File Upload plugin.
jQuery File Style.
Styling an input type file.
Progress Bar Plugin.

Form – Select Box stuff

jQuery Combobox.
jQuery controlled dependent (or Cascadign) Select List.
Multiple Selects.
Select box manipulation.
Select Combo Plugin.
jQuery – LinkedSelect
Auto-populate multiple select boxes.
Choose Plugin (Select Replacement).

Form Basics, Input Fields, Checkboxes etc.

jQuery Form Plugin.
jQuery-Form.
jLook Nice Forms.
jNice.
Ping Plugin.
Toggle Form Text.
ToggleVal.
jQuery Field Plugin.
jQuery Form’n Field plugin.
jQuery Checkbox manipulation.
jTagging.
jQuery labelcheck.
Overlabel.
3 state radio buttons.
ShiftCheckbox jQuery Plugin.
Watermark Input.
jQuery Checkbox (checkboxes with imags).
jQuery SpinButton Control.
jQuery Ajax Form Builder.
jQuery Focus Fields.
jQuery Time Entry.

Time, Date and Color Picker

jQuery UI Datepicker.
jQuery date picker plugin.
jQuery Time Picker.
Time Picker.
ClickPick.
TimePicker.
Farbtastic jQuery Color Picker Plugin.
Color Picker by intelliance.fr.

Rating Plugins

jQuery Star Rating Plugin.
jQuery Star Rater.
Content rater with asp.net, ajax and jQuery.
Half-Star Rating Plugin.

Search Plugins

jQuery Suggest.
jQuery Autocomplete.
jQuery Autocomplete Mod.
jQuery Autocomplete by AjaxDaddy.
jQuery Autocomplete Plugin with HTML formatting.
jQuery Autocompleter.
AutoCompleter (Tutorial with PHP&MySQL).
quick Search jQuery Plugin.

Inline Edit & Editors

jTagEditor.
WYMeditor.
jQuery jFrame.
Jeditable – edit in place plugin for jQuery.
jQuery editable.
jQuery Disable Text Select Plugin.
Edit in Place with Ajax using jQuery.
jQuery Plugin – Another In-Place Editor.
TableEditor.
tEditable – in place table editing for jQuery.

Audio, Video, Flash, SVG, etc

jMedia – accessible multi-media embedding.
JBEdit – Ajax online Video Editor.
jQuery MP3 Plugin.
jQuery Media Plugin.
jQuery Flash Plugin.
Embed QuickTime.
SVG Integration.

Mais >

Como descobrir Content-Type de arquivo


$arquivo = "caminho/para/o/arquivo/nome-arquivo.ext";
$tipo = mime_content_type($arquivo);
echo $tipo;

simples não??

Valeu!!