本文整理汇总了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());
}