Reply to Re: Newbie: If then statement and expiring listings

Your name:

Reply:


Posted by Ivαn Sαnchez Ortega on 09/28/68 11:36

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mikey P wrote:

> right now this is the code i have:
>
> <?php echo('<b>' . $row['company'] . '</b>' . '<br>' . $row['address']
> . '<br>' .$row['city'] . ' ' . $row['state'] . ', ' . $row['zip'] .
> '<br>' . '<a href="http://' . $row['website'] . '">' .
> $row['website'] . '</a>' . '<br>' . $row['phone'] . '<br>' .
> $row['description'] . '</font></li></p><p> <a
>
href="http://www.mapquest.com/maps/map.adp?searchtype=address&country=US&addtohistory=&searchtab=home&address='.
> $row['address'] . '&city=' . $row['city'] . '&state=' . $row['state']
> .'&zipcode=' . $row['zip'] .'" target="_blank"><img
> src="assets/images/itl/map.gif" width="135" height="25" ></a>');
> ?>

This really needs some cleanup...

echo "<b>{$row['company']}</b><br/>
{$row['address']}<br/>
{$row['city']} {$row['state']}, {$row['zip']}<br/>
<a href='http://{$row['website']}'>{$row['website']}</a><br/>
{$row['phone']}<br/>
{$row['description']} </font></li></p><p>
<a
href='http://www.mapquest.com/maps/map.adp?searchtype=address&country=US&addtohistory=&searchtab=home&address={$row['address']}&city={$row['city']}&state={$row['state']}&zipcode={$row['zip']}'
target='_blank'><img src='assets/images/itl/map.gif' width='135'
height='25' ></a>";


Now that I can read all that chunk of code, why the hell are you echoing
'</font></li></p><p>' ??



> How do i get it to disregard the tables with no information in them?

Tables with no information? Huh?

> Also, these listings have a created date on them. how can i query only
> listings that range from todays date back to 2 years. And everything 2
> years old or older will be disregarded?

If you're using SQL, use some WHERE clauses....

> Any help would be greatly appreciated.

- --
- ----------------------------------
IvΓ‘n SΓ‘nchez Ortega -i-punto-sanchez--arroba-mirame-punto-net

La dicha estΓ‘ constituida por esos huecos cerebrales sin historia.
-- Manuel Vicent.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFDu+3B3jcQ2mg3Pc8RAuCAAJ9ESkSssAVJblKVOkN5ypTC3opKJQCfaXDk
GIvCvM6zaUZ94GPvU1MtkOQ=
=BaEO
-----END PGP SIGNATURE-----

[Back to original message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация