the statement should look like this:

$result = mysql_query("select * from table where type = 'Base' and x = 'x' and
y = 'y'");

"Ryan Fischer" <[EMAIL PROTECTED]> wrote in message 
01d901c1101e$9cd43220$80c93fd0@ryan">news:01d901c1101e$9cd43220$80c93fd0@ryan...
> You wrote:
> > I have a table that looks like
> >
> > Name | Type | X | Y
> >
> > Foo    | Ship  | 9 | 29
> > Bar    | Base  | 9 | 29
> >
> > Is there any way I can write a query that selects
> > everything with Type = Base, and X and Y = Foo's X and Y?
> >
> > ie
> >
> > "Select * from table where type = Base and X = {Foo:X} and Y =
> {Foo:Y}";
> 
> $result = mysql_query("select x, y from table where name = 'Foo'");
> $info = mysql_fetch_object($result);
> $x = $info->x;
> $y = $info->y;
> mysql_free_result($result);
> $result = mysql_query("select * from table where type = 'Base', x = 'x',
> y = 'y'");
> $info = mysql_fetch_object($result);
> // Use properties of $info here.
> mysql_free_result($result);
> 
> I think your reasoning is a little jumbled, though.  There may be some
> way to do what you want to do with one query.  There usually is for the
> simple things.  I'm not quite sure what you want to accomplish, though.
> HTH.  :)
> 
> --
>  -Ryan :: ICQ - 595003 :: GigaBoard - http://www.gigaboard.net/
> 
> 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to