background image

//实例二[pg_fetch_array]   
//echo "<table border=1>";   
//echo "<tr>";   
//echo "<td>Serial_no</td>";   
//echo"<td>Name</td>";   
//echo"<td>Birthday</td>";   
//echo"</tr>";   
//   
//for($i=0;$i<pg_num_rows($result);$i++)   
//{   
//   
//$row=@pg_fetch_array($result) or die("Can't fetch row from table.");   
//$serial_no= $row['serial_no'];   
//$name= $row['name'];   
//$birthday= $row['birthday'];   
//echo"<tr>";   
//echo"<td>$serial_no</td>";   
//echo"<td>$name</td>";   
//echo"<td>$birthday</td>";   
//echo"</tr>";   
//   
//}   
//echo"</table>";   
  
//增加,删除,

   

修改实例

//$newrow=array("serial_no"=>"1006","name"=>"peter","birthday"=>"1990-07-

03","salary"=>"90","bonus"=>"80");   

//$reusult=@pg_insert($pg,"employes",$newrow) or die("Can't insert data to table.");   
//if($reusult)   
//{   
//echo "Rechords inserted Sucessfully!";   
//}   
//   
pg_close($pg);   
?>