Thursday, July 22, 2010

Cross Table Delete with MySQL

DELETE product.*, productPrice.*
FROM product p, productPrice pp
WHERE p.productId = pp.productId
AND p.created < '2004-01-01'

php curl to access a site


$url = 'http://www.google.com';

//open connection
$options = array(
CURLOPT_RETURNTRANSFER => true, // return web page
CURLOPT_HEADER => false, // don't return headers
CURLOPT_FOLLOWLOCATION => true, // follow redirects
CURLOPT_ENCODING => "", // handle all encodings
CURLOPT_USERAGENT => "spider", // who am i
CURLOPT_AUTOREFERER => true, // set referer on redirect
CURLOPT_CONNECTTIMEOUT => 120, // timeout on connect
CURLOPT_TIMEOUT => 120, // timeout on response
CURLOPT_MAXREDIRS => 10, // stop after 10 redirects
);
$ch = curl_init();

//set the url, number of POST vars, POST data
curl_setopt($ch,CURLOPT_URL,$url);

curl_setopt_array( $ch, $options );
//execute post
$result = curl_exec($ch);
$header = curl_getinfo( $ch );
echo $result;
//close connection
curl_close($ch);
?>

Monday, July 5, 2010

ape server ajax push engine

APE server side module

The APE module is the fastest, most modular and powerful way to exchange data between all users. With a APE module you can :

  • Push data to a client
  • Push data to a channel
  • Set property to user (for example user nickname)
  • Set property on channel (for example save last sent message on the channel)
  • Get information about users connected to APE
  • Get data from a MySQL server
  • Create a socket
  • Do many others things