DALLASCAO.COM

Site of Cao Shouguang, English to Chinese translator

jquery post

jquery post
Use html5 to validate email before submit. Forget your username/password? Simply type your email address below and click Submit and you will receive them in an email.Read More

php mysqli store_result

php mysqli store_result
When using prepare to prepare a statement to retrieve LOBs the method order matters. Also, method ‘store_result()’ must be called and be called in correct order. Failure to observe this causes PHP/MySQLi to crash or return an erroneous value. The proper procedure order is: prepare -> execute -> store_result -> bind -> fetchRead More

The idea of mysqli prepare

The idea of mysqli prepare
Notice you do not need to prepare for each row insertion. $db = new mysqli('localhost', 'dbusername', 'dbpassword', 'dbname'); if ($db->connect_error >0) { die('Unable to connect to database [' . $db->connect_error . ']'); } $sql1 = connect_error >0) { die('Unable to connect to database [' . $db->connect_error . ']'); } $sql1 =Read More

Install phpsh on ubuntu

Install phpsh on ubuntu
apt-get install python-setuptools python-dev build-essential apt-get install python2.6-pysqlite2 git clone git://github.com/facebook/phpsh.git cd phpsh python setup.py build python setup.py install phpshRead More

Learn Java: initializer

Learn Java: initializer
public class SavingsAccount { public static void main(String[] args) { AccountCaculation myAccount = new AccountCaculation(1000).deposit(2000); AccountCaculation yourAccount = new AccountCaculation().deposit(5000); myAccount.printBalance(); yourAccount.printBalance(); System.out.println(AccountCaculation.totalBalance); System.out.println(AccountCaculation.usd2Rmb(myAccount.balance)); //Objects(instances) as array members AccountCaculation[] accountArray = new AccountCaculation[3]; for (int i=0; iRead More