lunes, 30 de noviembre de 2009

JQuery Ajax: resultado sincronico

var html = $.ajax({
url: "some.php",
async: false
}).responseText;

jueves, 26 de noviembre de 2009

MySQL

tengo:

t1 t2
-- --
a b
b c
c
d
e

quiero:
los de t1 que no esten en t2

res
---
a
c
e

solucion:
SELECT *
FROM t1
WHERE t1.name NOT IN (SELECT NAME FROM t2)

viernes, 20 de noviembre de 2009

JQuery limitar caracteres - keyup - enter

$("#img_title").keyup(function(){
var max = 13;
if($("#img_title").val().length>max){
$("#img_title").val($("#img_title").val().substr(0, max));
alert("Number of caracters max allowed is: "+ max);
}
});

$('#input_text').keyup(function(e) {
//alert(e.keyCode);
if(e.keyCode == 13) {
alert('Enter key was pressed.');
}
});

martes, 17 de noviembre de 2009

PHP Archivos y Carpetas

<?php
$path = "pepito/";

if( !file_exists($path) )
{
    if(mkdir($path, 0777)) {echo "carpeta creada satisfactoriamente!";}
    
}
else
{
    echo "la carpeta ya existe";
}

?>

jueves, 5 de noviembre de 2009

PHP stactic class

<?php
class Foo {
    public static function aStaticMethod() {
        // ...
    }
}

Foo::aStaticMethod();
?>