Queries / variables

What is the correct syntax for this?

$description =
mysql_result($image_result,0,"photo_gallery_index.descriptio n_{$language}");

I am offering a web page in multiple languages. $language is what
language the user is requesting. There is a matching column in the
table for each language.

For example I may be trying to get the value of description_french

I am trying to use the variable instead of having several mysql_result
lines

Ron




--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Ron Piggott [ Sa, 06 Dezember 2008 21:16 ] [ ID #1980041 ]

Re: Queries / variables

Ron Piggott wrote:

> What is the correct syntax for this?
>
> $description =
>
mysql_result($image_result,0,"photo_gallery_index.descriptio n_{$language}");
>
> I am offering a web page in multiple languages. $language is what
> language the user is requesting. There is a matching column in the
> table for each language.
>
> For example I may be trying to get the value of description_french
>
> I am trying to use the variable instead of having several mysql_result
> lines
>
> Ron

mysql_result($image_result,0,"photo_gallery_index.descriptio n_$language");

Should work, I think. However, it seems you are returning all the language
fields for each query but only using one. Why not just retrieve the
specified language instead, based on the content of $language?


Cheers
--
David Robley

Circular Definition: see Definition, Circular.
Today is Sweetmorn, the 49th day of The Aftermath in the YOLD 3174.


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
David Robley [ So, 07 Dezember 2008 08:14 ] [ ID #1980123 ]
PHP » gmane.comp.php.database » Queries / variables

Vorheriges Thema: Yet another Call to Undefined Function help request
Nächstes Thema: oracle pooling