You are here: Re: Drop Down Lists « PHP Programming Language « IT news, forums, messages
Re: Drop Down Lists

Posted by TristaSD on 05/16/06 22:30

Very effifient. Mine is a monster - I did a query inside a query:

$locationquery = mysql_query ("SELECT * FROM locations");
$comparequery = mysql_query ("SELECT location FROM reservations WHERE
id=" . $_GET['id']);
while ($compareresult = mysql_fetch_array ($comparequery)) {
while ($locationrow = mysql_fetch_array ($locationquery)) {
echo ("<option");
if ($locationrow['name'] == $compareresult['location']) { //the
magic happens here
echo (" selected");
}
echo (">$locationrow[name]</option>");
}
}

Because $comparequery fetches only one value, any way to retrieve it
BEFORE going into the forst loop?

 

Navigation:

[Reply to this 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

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация