本文整理匯總了PHP中Objects::calculateTakiPage方法的典型用法代碼示例。如果您正苦於以下問題:PHP Objects::calculateTakiPage方法的具體用法?PHP Objects::calculateTakiPage怎麽用?PHP Objects::calculateTakiPage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Objects
的用法示例。
在下文中一共展示了Objects::calculateTakiPage方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: objectnames
$sql = "INSERT INTO objectnames ( objectname, catalog, catindex ) VALUES (\"M 51\", \"\", \"Whirlpool Galaxy\")";
$run = mysql_query($sql) or die(mysql_error());
$sql = "INSERT INTO objectnames ( objectname, catalog, catindex ) VALUES (\"IC 4593\", \"\", \"White Eyed Pea\")";
$run = mysql_query($sql) or die(mysql_error());
$sql = "INSERT INTO objectnames ( objectname, catalog, catindex ) VALUES (\"M 11\", \"\", \"Wild Duck Cluster\")";
$run = mysql_query($sql) or die(mysql_error());
$sql = "INSERT INTO objectnames ( objectname, catalog, catindex ) VALUES (\"M 40\", \"\", \"Winnecke 4 (WNC4)\")";
$run = mysql_query($sql) or die(mysql_error());
$sql = "INSERT INTO objectnames ( objectname, catalog, catindex ) VALUES (\"IC 2118\", \"\", \"Witch Head Nebula\")";
$run = mysql_query($sql) or die(mysql_error());
$sql = "INSERT INTO objectnames ( objectname, catalog, catindex ) VALUES (\"NGC 2264\", \"\", \"X-mas Tree Cluster\")";
$run = mysql_query($sql) or die(mysql_error());
$sql = "INSERT INTO objectnames ( objectname, catalog, catindex ) VALUES (\"Blanco 1\", \"\", \"Zeta Sculptoris Cluster\")";
$run = mysql_query($sql) or die(mysql_error());
$sql = "INSERT INTO objectnames ( objectname, catalog, catindex ) VALUES (\"UGC 6955\", \"\", \"Zwicky #2\")";
$run = mysql_query($sql) or die(mysql_error());
// Insert the taki pages
$object = new Objects();
$sql = "ALTER TABLE objects ADD COLUMN taki varchar(3) NOT NULL default ''";
$run = mysql_query($sql) or die(mysql_error());
$sql = "SELECT * FROM objects";
$run = mysql_query($sql) or die(mysql_error());
while ($get = mysql_fetch_object($run)) {
$ra = $get->ra;
$dec = $get->decl;
$taki = $object->calculateTakiPage($ra, $dec);
$name = $get->name;
$sql2 = "UPDATE objects SET taki = \"{$taki}\" WHERE name = \"{$name}\"";
$run2 = mysql_query($sql2) or die(mysql_error());
}
echo "Database was updated succesfully!\n";
示例2: database
<?php
include_once "../lib/database.php";
include_once "../lib/objects.php";
$db = new database();
$db->login();
$object = new Objects();
// Insert the taki pages
$sql = "ALTER TABLE objects ADD COLUMN taki varchar(3) NOT NULL default ''";
$run = mysql_query($sql) or die(mysql_error());
$sql = "SELECT * FROM objects";
$run = mysql_query($sql) or die(mysql_error());
while ($get = mysql_fetch_object($run)) {
$ra = $get->ra;
$dec = $get->decl;
$taki = trim($object->calculateTakiPage($ra, $dec));
$name = $get->name;
$sql2 = "UPDATE objects SET taki = \"{$taki}\" WHERE name = \"{$name}\"";
$run2 = mysql_query($sql2) or die(mysql_error());
}