Sae sql operation

1.

$mysql = new SaeMysql();
sql = "select * from CostList";
$data=$mysql->getData($sql);
print_r($data);
$mysql->closeDb()

2.

$newsql="insert into costlist(name,sum,cost,balance,information) values('$User','400','$Costs','$balance','$Information')";
$mysql->runSql($newsql)

3.

function getBalance(){
$mysql=new SaeMysql();
$sql="select balance from costlist where id=(select max(id) from costlist)";
$data=$mysql->getData($sql);
print_r($data);
$mysql->closeDb();
return $data[0]['balance'];

}

4.

Sae Mail()

<?php

$mail = new SaeMail();

$ret = $mail->quickSend("ustclixin@gmail.com", "hello", "test", "yourAccount@gmail.com", "yourPsw");

 

if($ret === false){

var_dump($mail->errno(),$mail->errmsg());

}else{

echo $mail->errno();

echo 'okay';

}

?>

posted @ 2012-08-01 14:52  Epirus  阅读(388)  评论(0编辑  收藏  举报