I want to insert a value in table glmast in the field called acname.

The conditions I am using is as follows

```
g.gl_id = p.gl_id AND p.pl_id='$pdidedit' with g as glmast and p as packlist

```

I tried joins, and try the below code.. 

```
INSERT INTO glmast (acname)
VALUES
('$glidnew') SELECT glmast.acname WHERE glmast.gl_id = packlist.gl_id AND packlist='$pdidedit'";

```

Any help highly appreciated..Thanks everyone..