php-windows Digest 1 Aug 2007 12:24:34 -0000 Issue 3300
Topics (messages 28296 through 28306):
Re: Error reporting
28296 by: Bruce Cowin
28300 by: Gustav Wiberg
Small Help
28297 by: Stephen
28298 by: Stephen
28301 by: Gustav Wiberg
28303 by: Aleksandar Vojnovic
28306 by: Tom Hearn
Re: ORDER BY is not sorting
28299 by: Gustav Wiberg
28302 by: Aleksandar Vojnovic
28304 by: M. Sokolewicz
28305 by: Luis Moreira (ESI-GSQP)
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
Ha ha....well....that's slightly embarrassing! But turns out it's not
the issue after all. It must be the permissions issue, but
unfortunately I haven't had a chance to get back and test it.
Thanks for that.
Regards,
Bruce
>>> Gustav Wiberg <[EMAIL PROTECTED]> 30/07/2007 6:14:00 p.m. >>>
Hi!
I don't know if that if this would have any effect, but it might. The
html is not written with correct standard.
<html>
<title><head></head></title>
<body>
Should be
<html>
<head><title>test</title></head>
<body>
Best regards
/Gustav Wiberg
-----Original Message-----
From: Bruce Cowin [mailto:[EMAIL PROTECTED]
Sent: Monday, July 30, 2007 1:02 AM
To: Stut
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] Error reporting
Thanks for the quick response. I load the page by going to the URL,
not
by doing a file/open. I checked the phpinfo page and there is only
one
php.ini mentioned there. I think your 3rd scenario is the most likely
so I'll look into that.
Thanks again.
Regards,
Bruce
>>> Stut <[EMAIL PROTECTED]> 30/07/2007 9:52 a.m. >>>
Bruce Cowin wrote:
> I originally sent this to the general list with no replies. As I'm
it
> concerns writing to the Windows event log, I thought I'd try my luck
on
> this list.
>
> I'm running PHP 5.1 on IIS. My dev environment is all local on my
> machine. My php.ini has the following error reporting settings:
>
> error_reporting = E_ALL
> display_errors = Off
> display_startup_errors = Off
> log_errors = On
> log_errors_max_len = 1024
> ignore_repeated_errors = Off
> ignore_repeated_source = Off
> report_memleaks = On
> track_errors = Off
> error_log = syslog
>
> To test, I've written a little script that divides by 0. When I run
> the script from the command line, I get entries in my Event Log as
> expected, but if I load the page into my browser (Firefox), no error
> is
> reported in the Event Log.
>
> I've checked http://www.php.net/manual/en/ref.errorfunc.php but
can't
> find anything there. I figure I must be missing something pretty
> obvious but not sure what it is. The script and logged error from
the
> command line are below. Thanks for any help.
>
> script:
> <html>
> <title><head></head></title>
> <body>
> <?php
>
> $a = 5;
> $b = 0;
> $c = $a / $b;
> echo $c;
> ?>
> </body>
> </html>
>
> logged error from command line:
> The description for Event ID ( 2 ) in Source ( PHP-5.1.2 ) cannot be
> found. The local computer may not have the necessary registry
> information or message DLL files to display messages from a remote
> computer. You may be able to use the /AUXSOURCE= flag to retrieve
this
> description; see Help and Support for details. The following
> information
> is part of the event: php[2132], PHP Warning: Division by zero in
> C:\Inetpub\wwwroot\PHP\Testing\error.php on line 11.
Three possible reasons I can think of...
1) How are you "load[ing] the page into [your] browser"? If you are
using File->Open to open the PHP script that's never going to work
because Firefox doesn't know how to execute PHP
2) CLI is using a different php.ini than the web server - check this
with a phpinfo page (http://php.net/phpinfo
3) Permissions are preventing the web server process from writing to
the
event log
-Stut
--
http://stut.net/
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.476 / Virus Database: 269.10.25/926 - Release Date:
2007-07-29 23:14
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi!
I really didn't thought that would be the issue, but I thought I had to mention
it anyway :-)
Best regards
/Gustav Wiberg
-----Original Message-----
From: Bruce Cowin [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 01, 2007 12:55 AM
To: 'Stut'; Gustav Wiberg
Cc: '[EMAIL PROTECTED]'
Subject: RE: [PHP-WIN] Error reporting
Ha ha....well....that's slightly embarrassing! But turns out it's not
the issue after all. It must be the permissions issue, but
unfortunately I haven't had a chance to get back and test it.
Thanks for that.
Regards,
Bruce
>>> Gustav Wiberg <[EMAIL PROTECTED]> 30/07/2007 6:14:00 p.m. >>>
Hi!
I don't know if that if this would have any effect, but it might. The
html is not written with correct standard.
<html>
<title><head></head></title>
<body>
Should be
<html>
<head><title>test</title></head>
<body>
Best regards
/Gustav Wiberg
-----Original Message-----
From: Bruce Cowin [mailto:[EMAIL PROTECTED]
Sent: Monday, July 30, 2007 1:02 AM
To: Stut
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] Error reporting
Thanks for the quick response. I load the page by going to the URL,
not
by doing a file/open. I checked the phpinfo page and there is only
one
php.ini mentioned there. I think your 3rd scenario is the most likely
so I'll look into that.
Thanks again.
Regards,
Bruce
>>> Stut <[EMAIL PROTECTED]> 30/07/2007 9:52 a.m. >>>
Bruce Cowin wrote:
> I originally sent this to the general list with no replies. As I'm
it
> concerns writing to the Windows event log, I thought I'd try my luck
on
> this list.
>
> I'm running PHP 5.1 on IIS. My dev environment is all local on my
> machine. My php.ini has the following error reporting settings:
>
> error_reporting = E_ALL
> display_errors = Off
> display_startup_errors = Off
> log_errors = On
> log_errors_max_len = 1024
> ignore_repeated_errors = Off
> ignore_repeated_source = Off
> report_memleaks = On
> track_errors = Off
> error_log = syslog
>
> To test, I've written a little script that divides by 0. When I run
> the script from the command line, I get entries in my Event Log as
> expected, but if I load the page into my browser (Firefox), no error
> is
> reported in the Event Log.
>
> I've checked http://www.php.net/manual/en/ref.errorfunc.php but
can't
> find anything there. I figure I must be missing something pretty
> obvious but not sure what it is. The script and logged error from
the
> command line are below. Thanks for any help.
>
> script:
> <html>
> <title><head></head></title>
> <body>
> <?php
>
> $a = 5;
> $b = 0;
> $c = $a / $b;
> echo $c;
> ?>
> </body>
> </html>
>
> logged error from command line:
> The description for Event ID ( 2 ) in Source ( PHP-5.1.2 ) cannot be
> found. The local computer may not have the necessary registry
> information or message DLL files to display messages from a remote
> computer. You may be able to use the /AUXSOURCE= flag to retrieve
this
> description; see Help and Support for details. The following
> information
> is part of the event: php[2132], PHP Warning: Division by zero in
> C:\Inetpub\wwwroot\PHP\Testing\error.php on line 11.
Three possible reasons I can think of...
1) How are you "load[ing] the page into [your] browser"? If you are
using File->Open to open the PHP script that's never going to work
because Firefox doesn't know how to execute PHP
2) CLI is using a different php.ini than the web server - check this
with a phpinfo page (http://php.net/phpinfo
3) Permissions are preventing the web server process from writing to
the
event log
-Stut
--
http://stut.net/
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.476 / Virus Database: 269.10.25/926 - Release Date:
2007-07-29 23:14
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.476 / Virus Database: 269.11.0/927 - Release Date: 2007-07-30 17:02
--- End Message ---
--- Begin Message ---
I'm kind of trying to do this quickly. Can anyone give me some PHP code that
will let me link to a different image if $veriable = blah blah blah. I need
it for 4 different options.
--- End Message ---
--- Begin Message ---
also when the user registers. is there a peice of code that will let me send
myself and e-mail informing me?
""Stephen"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm kind of trying to do this quickly. Can anyone give me some PHP code
> that will let me link to a different image if $veriable = blah blah blah.
> I need it for 4 different options.
--- End Message ---
--- Begin Message ---
Hi!
If you need help in programming an application from scratch this might not be
the list for you :-)
Best regards
/Gustav Wiberg
-----Original Message-----
From: Stephen [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 01, 2007 4:41 AM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Re: Small Help
also when the user registers. is there a peice of code that will let me send
myself and e-mail informing me?
""Stephen"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm kind of trying to do this quickly. Can anyone give me some PHP code
> that will let me link to a different image if $veriable = blah blah blah.
> I need it for 4 different options.
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.476 / Virus Database: 269.11.0/927 - Release Date: 2007-07-30 17:02
--- End Message ---
--- Begin Message ---
Sorry I don't understand what your request is about?
- Aleksander
Gustav Wiberg wrote:
Hi!
If you need help in programming an application from scratch this might not be
the list for you :-)
Best regards
/Gustav Wiberg
-----Original Message-----
From: Stephen [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 01, 2007 4:41 AM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Re: Small Help
also when the user registers. is there a peice of code that will let me send
myself and e-mail informing me?
""Stephen"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
I'm kind of trying to do this quickly. Can anyone give me some PHP code
that will let me link to a different image if $veriable = blah blah blah.
I need it for 4 different options.
--- End Message ---
--- Begin Message ---
Stephen,
Generally speaking this list isn't for people to write code for you, but
this is a very simple thing to do.
For emailing, check the mail() function on php.net documentation. You will
need to make sure your SMTP server is properly configured.
For changing an image with 4 different options, I don't really know how you
want it called, but you could call it in the query string.
For example:
<img src="images/image<?=$imagenumber?>.jpg">
And your url would be http://www.someurl.com/picture.php?imagenumber=4
I think that is what you wanted.
Tom
-----Original Message-----
From: Aleksandar Vojnovic [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 01, 2007 5:22 AM
To: Gustav Wiberg
Cc: 'Stephen'; '[EMAIL PROTECTED]'
Subject: Re: [PHP-WIN] Re: Small Help
Sorry I don't understand what your request is about?
- Aleksander
Gustav Wiberg wrote:
> Hi!
>
> If you need help in programming an application from scratch this might not
be the list for you :-)
>
> Best regards
> /Gustav Wiberg
>
>
> -----Original Message-----
> From: Stephen [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 01, 2007 4:41 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] Re: Small Help
>
> also when the user registers. is there a peice of code that will let me
send
> myself and e-mail informing me?
> ""Stephen"" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>
>> I'm kind of trying to do this quickly. Can anyone give me some PHP code
>> that will let me link to a different image if $veriable = blah blah blah.
>> I need it for 4 different options.
>>
>
>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.476 / Virus Database: 269.11.0/927 - Release Date: 7/30/2007
5:02 PM
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.476 / Virus Database: 269.11.0/927 - Release Date: 7/30/2007
5:02 PM
--- End Message ---
--- Begin Message ---
Hi!
I can't see anything with your code either. Mysql_fetch_array should work fine
yes. No indexes are needed to sort fields, but are recommended for speeding up
the process :-)
How does the table users look like? (Please send a link to a screenshot or
something like that)
Sometimes I have noticed that PHP isn't that good of getting right results when
using $variable inside ""-chars
You could try doing this:
$table_name ='users';
// Select records
$result = mysql_query("SELECT * FROM " . $table_name . " ORDER BY rowID
DESC");
// Loop through the record set
while($row = mysql_fetch_array($result))
print 'rowID =' .$row['rowID']. '<br />'
There might be some issues regarding permissons of MySQL. Have you tried doing
another sql-select statement on another table?
Best regards
/Gustav Wiberg
-----Original Message-----
From: Mark Abrams [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 01, 2007 12:50 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] ORDER BY is not sorting
Is mysql_fetch_array the proper function to access sorted data? The
problem is consistent on my test server and my ISPs mySQL DB.
rowID is the primary key. Do I need to have an index attribute on a field I
want to sort?
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>I can't really see anything wrong with what you have there. It shouldn't
>matter that your SQL is inside the query function, although I like to build
>the query in a variable outside the query function, but either way it
>should work.
>
> And you're obviously getting data and not an error, right?
>
> What happens if you leave the "DESC" off? Does it come back 4, 3, 2, 1?
> or still 1, 2, 3, 4?
>
> You might try displaying more data from the result set to see if there's
> some other issue.
>
> And have you tested the SQL statement just using MySQL via command line,
> phpMyAdmin, WinSQL, Navicat, or something like that?
>
> -TG
>
> = = = Original message = = =
>
> Sorry, this seams very trivial but I can not sort the result set for any
> field. What am I doing wrong?
>
>
> php & mySQL 5
>
>
> <?php
>
> ...
>
> $table_name ='users';
>
> // Select records
> $result = mysql_query("SELECT * FROM $table_name ORDER BY rowID DESC");
>
>
> // Loop through the record set
> while($row = mysql_fetch_array($result))
> print 'rowID =' .$row['rowID']. '<br />'
>
>
> ?>
>
> 1
> 2
> 3
> 4
>
>
> TIA
> Mark
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> ___________________________________________________________
> Sent by ePrompter, the premier email notification software.
> Free download at http://www.ePrompter.com.
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.476 / Virus Database: 269.11.0/927 - Release Date: 2007-07-30 17:02
--- End Message ---
--- Begin Message ---
What kind of field is the keyID? is it int, char, varchar?
- Aleksander
Mark Abrams wrote:
Is mysql_fetch_array the proper function to access sorted data? The
problem is consistent on my test server and my ISPs mySQL DB.
rowID is the primary key. Do I need to have an index attribute on a field I
want to sort?
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
I can't really see anything wrong with what you have there. It shouldn't
matter that your SQL is inside the query function, although I like to build
the query in a variable outside the query function, but either way it
should work.
And you're obviously getting data and not an error, right?
What happens if you leave the "DESC" off? Does it come back 4, 3, 2, 1?
or still 1, 2, 3, 4?
You might try displaying more data from the result set to see if there's
some other issue.
And have you tested the SQL statement just using MySQL via command line,
phpMyAdmin, WinSQL, Navicat, or something like that?
-TG
= = = Original message = = =
Sorry, this seams very trivial but I can not sort the result set for any
field. What am I doing wrong?
php & mySQL 5
<?php
...
$table_name ='users';
// Select records
$result = mysql_query("SELECT * FROM $table_name ORDER BY rowID DESC");
// Loop through the record set
while($row = mysql_fetch_array($result))
print 'rowID =' .$row['rowID']. '<br />'
?>
1
2
3
4
TIA
Mark
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.
--- End Message ---
--- Begin Message ---
Gustav Wiberg wrote:
Hi!
I can't see anything with your code either. Mysql_fetch_array should work fine
yes. No indexes are needed to sort fields, but are recommended for speeding up
the process :-)
How does the table users look like? (Please send a link to a screenshot or
something like that)
Sometimes I have noticed that PHP isn't that good of getting right results when using
$variable inside ""-chars
what do you mean by that??? You mean PHP is having trouble getting
'right results' from a mysql database if _somewhere_ in the code there's
an interpolated string? Sounds a bit iffy to me...
- Tul
You could try doing this:
$table_name ='users';
// Select records
$result = mysql_query("SELECT * FROM " . $table_name . " ORDER BY rowID
DESC");
// Loop through the record set
while($row = mysql_fetch_array($result))
print 'rowID =' .$row['rowID']. '<br />'
There might be some issues regarding permissons of MySQL. Have you tried doing
another sql-select statement on another table?
Best regards
/Gustav Wiberg
-----Original Message-----
From: Mark Abrams [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 01, 2007 12:50 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] ORDER BY is not sorting
Is mysql_fetch_array the proper function to access sorted data? The
problem is consistent on my test server and my ISPs mySQL DB.
rowID is the primary key. Do I need to have an index attribute on a field I
want to sort?
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
I can't really see anything wrong with what you have there. It shouldn't
matter that your SQL is inside the query function, although I like to build
the query in a variable outside the query function, but either way it
should work.
And you're obviously getting data and not an error, right?
What happens if you leave the "DESC" off? Does it come back 4, 3, 2, 1?
or still 1, 2, 3, 4?
You might try displaying more data from the result set to see if there's
some other issue.
And have you tested the SQL statement just using MySQL via command line,
phpMyAdmin, WinSQL, Navicat, or something like that?
-TG
= = = Original message = = =
Sorry, this seams very trivial but I can not sort the result set for any
field. What am I doing wrong?
php & mySQL 5
<?php
...
$table_name ='users';
// Select records
$result = mysql_query("SELECT * FROM $table_name ORDER BY rowID DESC");
// Loop through the record set
while($row = mysql_fetch_array($result))
print 'rowID =' .$row['rowID']. '<br />'
?>
1
2
3
4
TIA
Mark
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.
--- End Message ---
--- Begin Message ---
Just one thought :
The code itself, as shown, looks good, but is PHP getting what WE see ?
Meaning, try to
1) set a string with the SQL query you want
2) check the string before applying it
Maybe, just maybe, you are getting a broken string, and the "order" part is
missing, thus not being applied...
Luis
-----Original Message-----
From: M. Sokolewicz [mailto:[EMAIL PROTECTED]
Sent: quarta-feira, 1 de Agosto de 2007 11:24
To: Gustav Wiberg
Cc: 'Mark Abrams'; '[EMAIL PROTECTED]'
Subject: Re: [PHP-WIN] ORDER BY is not sorting
Gustav Wiberg wrote:
> Hi!
>
> I can't see anything with your code either. Mysql_fetch_array should work
fine yes. No indexes are needed to sort fields, but are recommended for
speeding up the process :-)
>
> How does the table users look like? (Please send a link to a screenshot or
something like that)
>
> Sometimes I have noticed that PHP isn't that good of getting right results
when using $variable inside ""-chars
what do you mean by that??? You mean PHP is having trouble getting
'right results' from a mysql database if _somewhere_ in the code there's
an interpolated string? Sounds a bit iffy to me...
- Tul
>
>
> You could try doing this:
>
> $table_name ='users';
>
> // Select records
> $result = mysql_query("SELECT * FROM " . $table_name . " ORDER BY
rowID DESC");
>
>
> // Loop through the record set
> while($row = mysql_fetch_array($result))
> print 'rowID =' .$row['rowID']. '<br />'
>
>
> There might be some issues regarding permissons of MySQL. Have you tried
doing another sql-select statement on another table?
>
> Best regards
> /Gustav Wiberg
>
>
>
>
> -----Original Message-----
> From: Mark Abrams [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 01, 2007 12:50 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-WIN] ORDER BY is not sorting
>
> Is mysql_fetch_array the proper function to access sorted data? The
> problem is consistent on my test server and my ISPs mySQL DB.
>
> rowID is the primary key. Do I need to have an index attribute on a field
I
> want to sort?
>
>
>
>
> <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> I can't really see anything wrong with what you have there. It shouldn't
>> matter that your SQL is inside the query function, although I like to
build
>> the query in a variable outside the query function, but either way it
>> should work.
>>
>> And you're obviously getting data and not an error, right?
>>
>> What happens if you leave the "DESC" off? Does it come back 4, 3, 2, 1?
>> or still 1, 2, 3, 4?
>>
>> You might try displaying more data from the result set to see if there's
>> some other issue.
>>
>> And have you tested the SQL statement just using MySQL via command line,
>> phpMyAdmin, WinSQL, Navicat, or something like that?
>>
>> -TG
>>
>> = = = Original message = = =
>>
>> Sorry, this seams very trivial but I can not sort the result set for any
>> field. What am I doing wrong?
>>
>>
>> php & mySQL 5
>>
>>
>> <?php
>>
>> ...
>>
>> $table_name ='users';
>>
>> // Select records
>> $result = mysql_query("SELECT * FROM $table_name ORDER BY rowID
DESC");
>>
>>
>> // Loop through the record set
>> while($row = mysql_fetch_array($result))
>> print 'rowID =' .$row['rowID']. '<br />'
>>
>>
>> ?>
>>
>> 1
>> 2
>> 3
>> 4
>>
>>
>> TIA
>> Mark
>>
>> --
>> PHP Windows Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>> ___________________________________________________________
>> Sent by ePrompter, the premier email notification software.
>> Free download at http://www.ePrompter.com.
>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---