For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > January 2006 > Re: [PHP-DB] is this possible in one query?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PHP-DB] is this possible in one query?
RaJeSh VeNkAtA

2006-01-14, 6:56 pm

u can have the query as

$query = " select * from $table where nameId = 31 " ;

$result = mysql_query ( $query ) ;

$i = 0 ;

while ( $row = mysql_fetch_array( $result , MYSQL_NUM ) )
{
$array[$i][0] = $row[0] ;
$array[$i][1] = $row[1] ;
$array[$i][2] = $row[2] ;
$i++
}

// now $array has ur required names :-)


rajesh



On Sat, 14 Jan 2006, Sjef Janssen wrote:

> Hi there,
> I have a table that keeps names for different language codes.
> In a short example:
> nameId name languageCode
> 31 House EN
> 31 Wohnung DE
> 32 Piece En
> 32 Stuck De
> 33 Car EN
> 33 PKW DE
>
> What I would like is to have a query that returns for example:
> nameId = 31
> Names = House - Wohnung
>
> Maybe I can even have a result that consists of an array with nameIds and
> Names.
> Or should I fire a bunch of queries after each other to have this result?
>
> I use mysql and php 4.3.8
>
> Tnxs!!
>
>


--

Your absence should be long enough so that someone miss you ,
But it shouldn't be so long enough that
Someone learns to live without you
So keep in touch !
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com