本文整理汇总了PHP中COM::execute方法的典型用法代码示例。如果您正苦于以下问题:PHP COM::execute方法的具体用法?PHP COM::execute怎么用?PHP COM::execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类COM
的用法示例。
在下文中一共展示了COM::execute方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: COM
$myPass = "WU0509Brc";
$myDB = "IABAS2014_ACS_set";
//create an instance of the ADO connection object
$conn = new COM ("ADODB.Connection")
or die("Cannot start ADO");
//define connection string, specify database driver
$connStr = "PROVIDER=SQLOLEDB;SERVER=".$myServer.";UID=".$myUser.";PWD=".$myPass.";DATABASE=".$myDB;
$conn->open($connStr); //Open the connection to the database
//declare the SQL statement that will query the database
$query = "SELECT * FROM CANDIDATOS";
//execute the SQL statement and return records
$rs = $conn->execute($query);
$num_columns = $rs->Fields->Count();
echo $num_columns . "<br>";
for ($i=0; $i < $num_columns; $i++) {
$fld[$i] = $rs->Fields($i);
}
echo "<table>";
while (!$rs->EOF) //carry on looping through while there are records
{
echo "<tr>";
for ($i=0; $i < $num_columns; $i++) {
echo "<td>" . $fld[$i]->value . "</td>";
示例2: getInvitationList
/**
* Get Invitation List from database
**/
function getInvitationList()
{
// Require DB Config
require_once "../lib/picasa/config.php";
// Records Array
$allRec = array();
// Create an instance of ADO connection object
$conn = new COM("ADODB.Connection") or die("Cannot start ADO");
// Define connection string, specify database driver
$connStr = "PROVIDER=SQLOLEDB;SERVER=" . $server . ";UID=" . $username . ";PWD=" . $passwd . ";DATABASE=" . $db;
$conn->open($connStr);
//Open the connection to the database
//SQL statement that will query the database
$query = "SELECT * FROM tbl_picasa";
//execute SQL statement and return records
$rs = $conn->execute($query);
$num_columns = $rs->Fields->Count();
for ($i = 0; $i < $num_columns; $i++) {
$fld[$i] = $rs->Fields($i);
}
while (!$rs->EOF) {
$rec = array();
for ($i = 0; $i < $num_columns; $i++) {
array_push($rec, $fld[$i]->value);
}
array_push($allRec, $rec);
$rs->MoveNext();
//move on to the next record
}
//close the connection and recordset objects freeing up resources
$rs->Close();
$conn->Close();
$rs = null;
$conn = null;
return $allRec;
}
示例3: COM
}
}
////////////////////////////../PHP/certificado.php
//create an instance of the ADO connection object
$conn = new COM("ADODB.Connection") or die("Cannot start ADO");
//define connection string, specify database driver
//$connStr = "Microsoft.ACE.OLEDB.12.0;Data Source=D:\inetpub\wwwroot\Dropbox\BDs\Arrendamientos.mdb";
//Siteserver//$connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Domains\ventayrenta.info\database\Arrendamientos.mdb";
$connStr = "provider= Microsoft.ACE.OLEDB.12.0;Data Source=D:\\inetpub\\wwwroot\\Dropbox\\BDs\\Arrendamientos.mdb";
$conn->open($connStr);
//Open the connection to the database
//declare the SQL statement that will query the database
$query = "SELECT r.*, a.CalleYNumeroDelDomicilio, a.Colonia, a.CodigoPostal, a.DelegacionOMunicipio, a.Ciudad, a.Estado, a.GiroDelInmuebleArrendado, a.PropietarioCve, a.estado FROM registro_proteccion r, arrendamientos a WHERE r.arrcve=a.arrcve AND r.REGCVE='" . $_REQUEST['arrcve'] . "' AND r.NoAutorizacion=" . $_REQUEST['NoAutorizacion'];
//echo($query."<p>");
//execute the SQL statement and return records
$rs = $conn->execute($query);
if (!$rs->EOF) {
//echo $query;
$num_columns = $rs->Fields->Count();
//echo($num_columns);
for ($i = 0; $i < $num_columns; $i++) {
$fld[$i] = $rs->Fields($i);
}
$Gtomadeposecion = "15,000.00";
$diasN = "20";
$calle = ucwords(strtolower($fld[48]->value));
$Colonia = ucwords(strtolower($fld[49]->value));
$Del_Mun = ucwords(strtolower($fld[51]->value));
$Estado = ucwords(strtolower(NEstados($fld[53]->value)));
$CP = $fld[50]->value;
$GiroInm = $fld[54]->value;