Re: switch and while

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Emiliano Boragina wrote:
Thanks Arie...
But I need to do "category1" be the ID of my table.
Using this way I have CASE number_ID_table echo string_CATEGORY_FIELD_table,
and will be automatic... Many CASES as ID I having in the database

If the $selectCategory is part of the database query, then you need to do it like that.

switch ($selectCategory)
{
  case 'category1':
    $query = .....;
  break;

  case 'category2':
    $query = .....;
  break;
}

You haven't really explained what you're trying to achieve so it's a bit hard to suggest anything.

--
Postgresql & php tutorials
http://www.designmagick.com/


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux