Vindex
07-19-2003, 11:34 PM
here, you can, (i hope :oops: )
diplay, creation AND expiration date
But, dont forget to change "default_" if you have need
test it !
// for creation date
function getCreationDate($listingID)
{
// get the main data for a given listing
global $conn, $lang;
$listingID = make_db_extra_safe($listingID);
$sql = "SELECT ID, creation_date FROM default_listingsDB WHERE (default_listingsDB.ID = $listingID)";
$recordSet = $conn->Execute($sql);
if ($recordSet === false) log_error($sql);
// get main listings data
while (!$recordSet->EOF)
{
$formatted_creation = $recordSet->UserTimeStamp($recordSet->fields[creation_date],'d m Y');
$recordSet->MoveNext();
} // end while
echo "Date Added : ".$formatted_creation;
} // function getCreationDate
// for Expiration date
function getExpiration ($listingID)
{
// get the main data for a given listing
global $conn, $lang;
$listingID = make_db_extra_safe($listingID);
$sql = "SELECT ID, expiration FROM default_listingsDB WHERE (default_listingsDB.ID = $listingID)";
$recordSet = $conn->Execute($sql);
if ($recordSet === false) log_error($sql);
// get main listings data
while (!$recordSet->EOF)
{
$formatted_creation = $recordSet->UserTimeStamp($recordSet->fields[expiration],'d m Y');
$recordSet->MoveNext();
} // end while
echo "Expiration : ".$formatted_creation;
} // function getExpiration
include in "listinview.php"
<?php
getCreationDate($listingID)
?>
<?php
getExpiration($listingID)
?>
result here:
http://ariege-pyrenees.info/immo/listingview.php?listingID=1
PS:
i dont use ".$config[table_prefix]." because it seem to not working
with: ".$config[table_prefix]."
http://ariege-pyrenees.info/immo/listingviewDate2.php?listingID=2
without: ".$config[table_prefix]."
http://ariege-pyrenees.info/immo/listingviewDate2.php?listingID=2
sorry, but the last night, i was so tired.........
BUT, ...RealtyOne is here........... :wink:
diplay, creation AND expiration date
But, dont forget to change "default_" if you have need
test it !
// for creation date
function getCreationDate($listingID)
{
// get the main data for a given listing
global $conn, $lang;
$listingID = make_db_extra_safe($listingID);
$sql = "SELECT ID, creation_date FROM default_listingsDB WHERE (default_listingsDB.ID = $listingID)";
$recordSet = $conn->Execute($sql);
if ($recordSet === false) log_error($sql);
// get main listings data
while (!$recordSet->EOF)
{
$formatted_creation = $recordSet->UserTimeStamp($recordSet->fields[creation_date],'d m Y');
$recordSet->MoveNext();
} // end while
echo "Date Added : ".$formatted_creation;
} // function getCreationDate
// for Expiration date
function getExpiration ($listingID)
{
// get the main data for a given listing
global $conn, $lang;
$listingID = make_db_extra_safe($listingID);
$sql = "SELECT ID, expiration FROM default_listingsDB WHERE (default_listingsDB.ID = $listingID)";
$recordSet = $conn->Execute($sql);
if ($recordSet === false) log_error($sql);
// get main listings data
while (!$recordSet->EOF)
{
$formatted_creation = $recordSet->UserTimeStamp($recordSet->fields[expiration],'d m Y');
$recordSet->MoveNext();
} // end while
echo "Expiration : ".$formatted_creation;
} // function getExpiration
include in "listinview.php"
<?php
getCreationDate($listingID)
?>
<?php
getExpiration($listingID)
?>
result here:
http://ariege-pyrenees.info/immo/listingview.php?listingID=1
PS:
i dont use ".$config[table_prefix]." because it seem to not working
with: ".$config[table_prefix]."
http://ariege-pyrenees.info/immo/listingviewDate2.php?listingID=2
without: ".$config[table_prefix]."
http://ariege-pyrenees.info/immo/listingviewDate2.php?listingID=2
sorry, but the last night, i was so tired.........
BUT, ...RealtyOne is here........... :wink: