Re: A real problem
| From: | Phpu | Date: | Mon, 26 Apr 2004 19:16:02 +0000 |
| Subject: | Re: A real problem | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-184687@lists.php.net to get a copy of this message | ||
I don't quite understand... Can you show me on this example?
PS. I need java todo this, because i do not know java.
----- Original Message -----
From: "Daniel Clark" <dclark@nwlink.com>
To: "Phpu" <phpu@go.ro>
Cc: <php-general@lists.php.net>
Sent: Monday, April 26, 2004 9:53 PM
Subject: Re: [PHP] A real problem
> Yes, put your shop_models query and output within your shop_brands.
>
> > Hi
> >
> > I have this list that interogates the database and display the name of
the
> > brand.
> > <select name="brand">
> > <?
> >
> > $query = "SELECT id, name FROM shop_brands";
> >
> > $result = mysql_query($query) or die("error in query - $query -
> > ".mysql_error());
> >
> > while($row = mysql_fetch_row($result)) {
> >
> > list($brand_id, $brand_name) = $row;
> >
> > $query2 = "SELECT * FROM shop_models WHERE brand_id = $brand_id";
> >
> > $result2 = mysql_query($query2) or die("error in query -
$query2 -
> > ".mysql_error());
> >
> > $rows = mysql_num_rows($result2);
> >
> > if($rows) {
> >
> > $brand_name = htmlspecialchars(stripslashes($brand_name));
> >
> > if(!$save_brand_id) $save_brand_id = $brand_id;
> >
> > echo("<option
> > value='$brand_id'>$brand_name</option>");
> >
> > }
> >
> > }
> > ?>
> >
> > each brand has more than one model.
> > when i chose one of the brands i want to be displayed o form like this
(in
> > real time):
> >
> > $query = "SELECT id, name FROM shop_models WHERE
> > brand_id=$save_brand_id";
> >
> > $result = mysql_query($query) or die("error in query - $query -
> > ".mysql_error());
> >
> > while($row = mysql_fetch_row($result)) {
> >
> > list($model_id, $model_name) = $row;
> > echo ("<input type='checkbox'
> > value=\"$model_id\">$model_name\n");
> >
> >
> > };
> >
> >
> > How can i do this? (maybe java could help me but i do not know how to do
> > it)
> >
> > Can someone plese help me?
> >
> >
> > Thanks for your reply
> >
> >
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>