Re: Ambiguous?
| From: | Stuart Dallas | Date: | Fri, 09 Aug 2013 12:02:33 +0000 |
| Subject: | Re: Ambiguous? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-321826@lists.php.net to get a copy of this message | ||
On 9 Aug 2013, at 13:00, Karl-Arne Gjersøyen <karlarneg@gmail.com> wrote:
> 1) query
> foreach($varenr_inn_pa_lager as $vnr){
> include('../../tilkobling.php');
> $sql = "SELECT * FROM exan,dynamit WHERE varenr = '$vnr' LIMIT
> 1";
> $resultat = mysql_query($sql, $tilkobling) or
> die(mysql_error());
>
> 2) Result:
> Column 'varenr' in where clause is ambiguous
>
> 3) Tables in MySQL database
>
> mysql> SELECT * FROM exan;
> +------------+-------------+-------+----------+----------+-------------+
> | leverandor | valgt_lager | un_nr | varenavn | varenr | kg_pa_lager |
> +------------+-------------+-------+----------+----------+-------------+
>
> mysql> SELECT * FROM dynamit;
>
> +------------+-------------+---------------+--------+-------+---------------------+------------+-------------+
> | leverandor | valgt_lager | type | dim_mm | un_nr |
> varenavn | varenr | kg_pa_lager |
>
> +------------+-------------+---------------+--------+-------+---------------------+------------+-------------+
>
> 4) My question:
> What means with "ambiguous" here?
The field exists in both tables, so you need to specify which one you mean.
Please learn how to use Google, it knows the answer to almost everything!
-Stuart
--
Stuart Dallas
3ft9 Ltd
http://3ft9.com/