php-general Digest 10 Aug 2013 14:42:50 -0000 Issue 8328

Topics (messages 321825 through 321835):

Ambiguous?
        321825 by: Karl-Arne Gjersøyen
        321826 by: Stuart Dallas
        321827 by: Floyd Resler
        321828 by: richard gray

fpdf problem?
        321829 by: Jim Giner
        321830 by: Tamara Temple
        321831 by: Jim Giner
        321832 by: Jim Giner
        321833 by: Jan Ehrhardt
        321834 by: Jim Giner

'buffer sizes' ?
        321835 by: Lester Caine

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
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?

Thanks.
Karl

--- End Message ---
--- Begin Message ---
On 9 Aug 2013, at 13:00, Karl-Arne Gjersøyen <karlar...@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/

--- End Message ---
--- Begin Message ---

On Aug 9, 2013, at 8:00 AM, Karl-Arne Gjersøyen <karlar...@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?
> 
> Thanks.
> Karl

Your field "varenr" is in both tables you are joining.  Therefore, MySQL 
doesn't know which table it should use the field from.  So, you need to qualify 
it by putting the table name in front of the field.  Such as:
SELECT * FROM exan,dynamit WHERE exan.varenr='$vnr' LIMIT 1

Take care,
Floyd


--- End Message ---
--- Begin Message ---

On 09/08/2013 14:00, Karl-Arne Gjersøyen 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?

Thanks.
Karl
a field named 'varenr' exists in both tables - your sql query needs to specify from which table you are selecting the data.

foreach($varenr_inn_pa_lager as $vnr){
           include('../../tilkobling.php');
           $sql = "SELECT * FROM exan,dynamit WHERE varenr = '$vnr' LIMIT


do you really need to include the file 'tilkobling.php' repeatedly for each iteration over $varenr_inn_pa_lager??

Rich


--- End Message ---
--- Begin Message --- I've been using fpdf to create pdf files for my site. All has been well for over a year. Suddenly I have a problem wherein IE 10 on W7 crashes when I try to print one of these pdfs created by my php scripts.

The pdf files that I create seem fine. If I bring one up in IE and then save it to my drive, I can then exit IE and go open the pdf and print it just fine.

I have removed my pdf printer drivers from my system and that hasn't improved my situation. No luck there.

The exact scenario is:
- script generates pdf and opens it in a new target window;
- user clicks on print toolbar icon or File,Print;
- print dialog opens; here I see some problems in that the (very complex) dialog is not displaying correctly with controls misaligned or overlaying other controls; - click on Ok to execute the print to printer and nothing happens; wait 5 minutes and still nothing; - NOW the problems begin; when the window with the pdf in it is closed, in about 2 seconds I get a dialog box telling me IE has stopped working.

Note that the problem only occurs when I attempt to print. If my script opens the pdf target window and I simply close it - no problems occur. BUT - if I actually open a print dialog I get a crash whether I click OK or Cancel, as soon as I close the window containing the pdf.

My question is does anyone have problems with fpdf lately? Since my files seem to be completely normal to adobe reader I don't think their content is at fault. It seems more like IE is not handling them and I can't find anything online about this.

I'm really hoping this is a problem wtih fpdf rather than IE since solutions are more apt to come out of this forum than the great wizards of M$ Oz.
--- End Message ---
--- Begin Message ---
On Aug 9, 2013, at 10:50 AM, Jim Giner <jim.gi...@albanyhandball.com> wrote:

> I've been using fpdf to create pdf files for my site.  All has been well for 
> over a year.  Suddenly I have a problem wherein IE 10 on W7 crashes when I 
> try to print one of these pdfs created by my php scripts.
> 
> The pdf files that I create seem fine.  If I bring one up in IE and then save 
> it to my drive, I can then exit IE and go open the pdf and print it just fine.
> 
> I have removed my pdf printer drivers from my system and that hasn't improved 
> my situation.  No luck there.
> 
> The exact scenario is:
> - script generates pdf and opens it in a new target window;
> - user clicks on print toolbar icon or File,Print;
> - print dialog opens;  here I see some problems in that the (very complex) 
> dialog is not displaying correctly with controls misaligned or overlaying 
> other controls;
> - click on Ok to execute the print to printer and nothing happens;  wait 5 
> minutes and still nothing;
> - NOW the problems begin;  when the window with the pdf in it is closed, in 
> about 2 seconds I get a dialog box telling me IE has stopped working.
> 
> Note that the problem only occurs when I attempt to print.  If my script 
> opens the pdf target window and I simply close it - no problems occur. BUT - 
> if I actually open a print dialog I get a crash whether I click OK or Cancel, 
> as soon as I close the window containing the pdf.
> 
> My question is does anyone have problems with fpdf lately?  Since my files 
> seem to be completely normal to adobe reader I don't think their content is 
> at fault.  It seems more like IE is not handling them and I can't find 
> anything online about this.
> 
> I'm really hoping this is a problem wtih fpdf rather than IE since solutions 
> are more apt to come out of this forum than the great wizards of M$ Oz.

Does this happen only for pdfs you've generated with fpdf, or any pdf file?


--- End Message ---
--- Begin Message ---
On 8/9/2013 12:06 PM, Tamara Temple wrote:

On Aug 9, 2013, at 10:50 AM, Jim Giner <jim.gi...@albanyhandball.com> wrote:

I've been using fpdf to create pdf files for my site.  All has been well for 
over a year.  Suddenly I have a problem wherein IE 10 on W7 crashes when I try 
to print one of these pdfs created by my php scripts.

The pdf files that I create seem fine.  If I bring one up in IE and then save 
it to my drive, I can then exit IE and go open the pdf and print it just fine.

I have removed my pdf printer drivers from my system and that hasn't improved 
my situation.  No luck there.

The exact scenario is:
- script generates pdf and opens it in a new target window;
- user clicks on print toolbar icon or File,Print;
- print dialog opens;  here I see some problems in that the (very complex) 
dialog is not displaying correctly with controls misaligned or overlaying other 
controls;
- click on Ok to execute the print to printer and nothing happens;  wait 5 
minutes and still nothing;
- NOW the problems begin;  when the window with the pdf in it is closed, in 
about 2 seconds I get a dialog box telling me IE has stopped working.

Note that the problem only occurs when I attempt to print.  If my script opens 
the pdf target window and I simply close it - no problems occur. BUT - if I 
actually open a print dialog I get a crash whether I click OK or Cancel, as 
soon as I close the window containing the pdf.

My question is does anyone have problems with fpdf lately?  Since my files seem 
to be completely normal to adobe reader I don't think their content is at 
fault.  It seems more like IE is not handling them and I can't find anything 
online about this.

I'm really hoping this is a problem wtih fpdf rather than IE since solutions 
are more apt to come out of this forum than the great wizards of M$ Oz.

Does this happen only for pdfs you've generated with fpdf, or any pdf file?

Good question and the answer is: it happens for other pdfs as well, so I guess it's not fpdf.

Sorry for the mis-post here - I'll do more research on Adobe and IE.

--- End Message ---
--- Begin Message ---
On 8/9/2013 12:11 PM, Jim Giner wrote:
On 8/9/2013 12:06 PM, Tamara Temple wrote:

On Aug 9, 2013, at 10:50 AM, Jim Giner <jim.gi...@albanyhandball.com>
wrote:

I've been using fpdf to create pdf files for my site.  All has been
well for over a year.  Suddenly I have a problem wherein IE 10 on W7
crashes when I try to print one of these pdfs created by my php scripts.

The pdf files that I create seem fine.  If I bring one up in IE and
then save it to my drive, I can then exit IE and go open the pdf and
print it just fine.

I have removed my pdf printer drivers from my system and that hasn't
improved my situation.  No luck there.

The exact scenario is:
- script generates pdf and opens it in a new target window;
- user clicks on print toolbar icon or File,Print;
- print dialog opens;  here I see some problems in that the (very
complex) dialog is not displaying correctly with controls misaligned
or overlaying other controls;
- click on Ok to execute the print to printer and nothing happens;
wait 5 minutes and still nothing;
- NOW the problems begin;  when the window with the pdf in it is
closed, in about 2 seconds I get a dialog box telling me IE has
stopped working.

Note that the problem only occurs when I attempt to print.  If my
script opens the pdf target window and I simply close it - no
problems occur. BUT - if I actually open a print dialog I get a crash
whether I click OK or Cancel, as soon as I close the window
containing the pdf.

My question is does anyone have problems with fpdf lately?  Since my
files seem to be completely normal to adobe reader I don't think
their content is at fault.  It seems more like IE is not handling
them and I can't find anything online about this.

I'm really hoping this is a problem wtih fpdf rather than IE since
solutions are more apt to come out of this forum than the great
wizards of M$ Oz.

Does this happen only for pdfs you've generated with fpdf, or any pdf
file?

Good question and the answer is: it happens for other pdfs as well, so I
guess it's not fpdf.

Sorry for the mis-post here - I'll do more research on Adobe and IE.

Update:
Solved my print problem by unchecking an option in Adobe Reader - Display PDF in browser. Solved my garbled dialog box and the printing of the document.

Of course - the down side is that you must close the document and then the now-empty browser window.


--- End Message ---
--- Begin Message ---
Jim Giner in php.general (Fri, 09 Aug 2013 12:33:30 -0400):
>> Good question and the answer is: it happens for other pdfs as well, so I
>> guess it's not fpdf.
>>
>> Sorry for the mis-post here - I'll do more research on Adobe and IE.
>
>Update:
>Solved my print problem by unchecking an option in Adobe Reader - 
>Display PDF in browser.  Solved my garbled dialog box and the printing 
>of the document.

Although it is off-topic: I do not have this problem with PDFs in a IE10
browser window. No garbled print dialogue, prints OK, no crash.

IE 10.0.9200.16635, Update version 10.0.7, W7 Pro 64-bits. Adobe Reader
XI, version 11.0.3.

Jan

--- End Message ---
--- Begin Message ---
On 8/9/2013 1:56 PM, Jan Ehrhardt wrote:
Jim Giner in php.general (Fri, 09 Aug 2013 12:33:30 -0400):
Good question and the answer is: it happens for other pdfs as well, so I
guess it's not fpdf.

Sorry for the mis-post here - I'll do more research on Adobe and IE.

Update:
Solved my print problem by unchecking an option in Adobe Reader -
Display PDF in browser.  Solved my garbled dialog box and the printing
of the document.

Although it is off-topic: I do not have this problem with PDFs in a IE10
browser window. No garbled print dialogue, prints OK, no crash.

IE 10.0.9200.16635, Update version 10.0.7, W7 Pro 64-bits. Adobe Reader
XI, version 11.0.3.

Jan

I have since my last post discovered that XI does indeed solve the problem completely. Too bad M$ doesn't post that info on all the many forum topics complaining about this.


--- End Message ---
--- Begin Message --- I'm not quite sure what is causing an effect I am seeing. I've two machines set up with Apache2.4 and PHP5.4.15 and I'm trying to debug owncloud as it has problems with Apache2.4. This autoloader and routing 'fun' seems totally over the top, and is failing without giving any errors, but the question is "what limits the amount of text displayed using print_r() ?" Where I drop in a print statement causes crashes, but when working I'm not getting a complete printout. One machine is clipping at around 4500 characters, while the other is managing around 9000, and neither is displaying the 'TAG' labels after that block.

It's not something I've seen before ... I've been using this method for many years and normally see all the text. So can anybody throw light on why this may be happening now? Interestingly the two machines are giving different problems with this application which works correctly on Apache 2.2

DON'T answer suggesting continuing to use 2.2 ... at some point 2.4 has to be 
fixed!

--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

--- End Message ---

Reply via email to