php-general Digest 23 Mar 2002 12:11:05 -0000 Issue 1243
Topics (messages 89765 through 89830):
Re: FAQ
89765 by: J. Scott Johnson
89809 by: Demitrious S. Kelly
Drawing graphs - opinions
89766 by: Lee P Reilly
89768 by: Lee P Reilly
89814 by: michael kimsal
Re: Database Development Price Inquiry?
89767 by: [-^-!-%-
Re: A Language Script?
89769 by: Demitrious S. Kelly
Re: Maillist
89770 by: Ashley M. Kirchner
Variable problem
89771 by: Leif K-Brooks
89772 by: Rick Emery
89774 by: Rick Emery
89779 by: Chris
MySQL query results
89773 by: Ashley M. Kirchner
89775 by: Rick Emery
89777 by: Ashley M. Kirchner
89782 by: Ashley M. Kirchner
89783 by: Chris
89785 by: Rasmus Lerdorf
89786 by: Chris
89787 by: Ashley M. Kirchner
89788 by: Ashley M. Kirchner
89789 by: Ashley M. Kirchner
89792 by: Rasmus Lerdorf
89800 by: Ashley M. Kirchner
89806 by: Justin French
89807 by: Ashley M. Kirchner
Re: included files not reread by php when i edit the files
89776 by: Chris
Double quotes in form fields and submitting them
89778 by: webapprentice
ttf broken?
89780 by: Michael A. Peters
89784 by: Michael A. Peters
Create Email POP accounts with PHP
89781 by: Julian
89791 by: Dan Harrelson
89793 by: ....::: rObEr2 :::....
Does anybody use UltraDev?
89790 by: ....::: rObEr2 :::....
89794 by: Dan Harrelson
Re: Perl NewsGroup?
89795 by: David Duong
89818 by: Don Read
Re: what is the difference between function and language construct?
89796 by: David Duong
What is the PHP version of Grep?
89797 by: David Duong
89798 by: Demitrious S. Kelly
Re: PHP/mySQL hosting
89799 by: bvr
URL information into a variable
89801 by: Phil Schwarzmann
89804 by: Justin French
89805 by: J. Scott Johnson
question - display rows
89802 by: Phil Schwarzmann
89803 by: Justin French
[newman] Whats wrong with this MySql Statement?
89808 by: Philip J. Newman
89820 by: Julio Nobrega
session problem?
89810 by: bob
what's wrong with IE?
89811 by: Alexander Javier
Advice needed
89812 by: James Newkid
89813 by: michael kimsal
89817 by: Daniel Tryba
Retreiving website contents
89815 by: Liam
89826 by: Jason Wong
this mailing list
89816 by: Liam
Configure PHP during RPM install
89819 by: David McInnis
Re: Tool to remove comments??
89821 by: Julio Nobrega
89822 by: Michael A. Peters
89829 by: heinisch.creaction.de
Stripslashes & addslashes question ...
89823 by: John Kelly
assert in php.ini setting.
89824 by: S.Murali Krishna
Crypt Limitation?
89825 by: Steven Walker
89827 by: Rasmus Lerdorf
Re: Jazz problem
89828 by: Jason Wong
php does not understand ->
89830 by: Andy
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 ---
Hi,
New poster, no need to flame unnecessarily...
Following up on James' original posting, I took 2000 or so message headers
from the archive and extracted (Perl, sorry) keywords for about 50% of the
postings. This gave the following metrics on problems:
13 table
65 apache
70 array
17 authentication
19 browser
13 cgi
39 cookie
35 database
9 dates
2 debug
9 editor
7 eval
6 fields
140 file
25 include
33 install
9 ip address
14 javascript
4 jpg
15 ldap
12 login
91 mail
146 mysql
11 oracle
20 pdf
2 PostgreSQL
15 Regex
7 rpm
8 security
93 session
11 socket
50 upload
29 variables
14 while
7 win32
37 xml
10 xsl
It seems like the hotspots are:
Database / Mysql
File handling
Apache
Arrays
XML
When James and I talked off list, he recommended:
>>You're probably also going to be dealing with global built in vars,
$_SESSION, $_POST, $_GET and older vars quite a bit as well.
I'm willing to grovel through old messages and write this up. If anyone has
any other common topics that I'm not finding, please email them to me. When
its done, and useful, we can see about getting it auto posted (which is a
_good_ idea).
Thanks
Scott
J. Scott Johnson
Virtual:
* * * * * * * * * * * * * * * * * * * * * * * * * *
[EMAIL PROTECTED]
http://www.fuzzygroup.com/
Yahoo IM: fuzzygroup
-----Original Message-----
From: Kevin Stone [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 5:24 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] FAQ
Too often novices are expected to know how to find this information by
mental telepathy because they either don't know the keywords to search
for or don't realize that certain common resources exist. If the list
administrators would simply compile a short email containing FAQ and
RESOURCE links then have the system send it to php-general once a week,
then they could reduce a great deal of these repetitious questions.
IMHO, of course.
-Kevin
-----Original Message-----
From: James Taylor [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 1:25 PM
To: Rasmus Lerdorf
Cc: PHP List
Subject: Re: [PHP] FAQ
The PHP FAQ isn't really specific when it comes to most problems. The
'code'
section has like 10 questions, the rest of the FAQ is mainly how to
download/compile, what do these PHP errors mean, migration, etc. A FAQ
that
had answers to questions that people ask on this list on a frequent
basis
would be more helpful.
On Friday 22 March 2002 12:05 pm, you wrote:
> I just don't see what the difference is. This is a PHP mailing list
which
> supposedly gets questions about PHP. Why would the PHP FAQ not be the
> right place for this?
>
> -Rasmus
>
> On Fri, 22 Mar 2002, James Taylor wrote:
> > You are correct sir. The purpose of the FAQ would be so that, like
I
> > said, similar questions that pop up say, once a week, could be
answered
> > in the FAQ instead of on the list - That way I won't get 300
messages a
> > day :)
> >
> > On Friday 22 March 2002 11:36 am, you wrote:
> > > Despite what Rasmus just said, I think that you are saying a PHP
> > > Mailing List faq based on the q's that the mailing list gets, not
the
> > > general PHP faq.
> > >
> > > Scott
> > >
> > > -----Original Message-----
> > > From: James Taylor [mailto:[EMAIL PROTECTED]]
> > > Sent: Friday, March 22, 2002 2:30 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: [PHP] FAQ
> > >
> > >
> > > Has anyone given any thought to possibly maintaining a FAQ
containing
> > > the answers to the most commonly asked PHP questions on this list?
I
> > > notice duplicates roll through every couple of days, and it would
> > > probably be a really nice PHP resource.
> > >
> > > Or, does one already exist? Ha.
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
I'm willing to help host the project...
I'd be on a slack 8 box with a cable connection... only one IP address.
It's my home connection so we'd have to share bandwidth... but I think
it could be a valuable resource...
-----Original Message-----
From: J. Scott Johnson [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 2:40 PM
To: 'Kevin Stone'; [EMAIL PROTECTED]
Subject: RE: [PHP] FAQ
Hi,
New poster, no need to flame unnecessarily...
Following up on James' original posting, I took 2000 or so message
headers
from the archive and extracted (Perl, sorry) keywords for about 50% of
the
postings. This gave the following metrics on problems:
13 table
65 apache
70 array
17 authentication
19 browser
13 cgi
39 cookie
35 database
9 dates
2 debug
9 editor
7 eval
6 fields
140 file
25 include
33 install
9 ip address
14 javascript
4 jpg
15 ldap
12 login
91 mail
146 mysql
11 oracle
20 pdf
2 PostgreSQL
15 Regex
7 rpm
8 security
93 session
11 socket
50 upload
29 variables
14 while
7 win32
37 xml
10 xsl
It seems like the hotspots are:
Database / Mysql
File handling
Apache
Arrays
XML
When James and I talked off list, he recommended:
>>You're probably also going to be dealing with global built in vars,
$_SESSION, $_POST, $_GET and older vars quite a bit as well.
I'm willing to grovel through old messages and write this up. If anyone
has
any other common topics that I'm not finding, please email them to me.
When
its done, and useful, we can see about getting it auto posted (which is
a
_good_ idea).
Thanks
Scott
J. Scott Johnson
Virtual:
* * * * * * * * * * * * * * * * * * * * * * * * * *
[EMAIL PROTECTED]
http://www.fuzzygroup.com/
Yahoo IM: fuzzygroup
-----Original Message-----
From: Kevin Stone [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 5:24 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] FAQ
Too often novices are expected to know how to find this information by
mental telepathy because they either don't know the keywords to search
for or don't realize that certain common resources exist. If the list
administrators would simply compile a short email containing FAQ and
RESOURCE links then have the system send it to php-general once a week,
then they could reduce a great deal of these repetitious questions.
IMHO, of course.
-Kevin
-----Original Message-----
From: James Taylor [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 1:25 PM
To: Rasmus Lerdorf
Cc: PHP List
Subject: Re: [PHP] FAQ
The PHP FAQ isn't really specific when it comes to most problems. The
'code'
section has like 10 questions, the rest of the FAQ is mainly how to
download/compile, what do these PHP errors mean, migration, etc. A FAQ
that
had answers to questions that people ask on this list on a frequent
basis
would be more helpful.
On Friday 22 March 2002 12:05 pm, you wrote:
> I just don't see what the difference is. This is a PHP mailing list
which
> supposedly gets questions about PHP. Why would the PHP FAQ not be the
> right place for this?
>
> -Rasmus
>
> On Fri, 22 Mar 2002, James Taylor wrote:
> > You are correct sir. The purpose of the FAQ would be so that, like
I
> > said, similar questions that pop up say, once a week, could be
answered
> > in the FAQ instead of on the list - That way I won't get 300
messages a
> > day :)
> >
> > On Friday 22 March 2002 11:36 am, you wrote:
> > > Despite what Rasmus just said, I think that you are saying a PHP
> > > Mailing List faq based on the q's that the mailing list gets, not
the
> > > general PHP faq.
> > >
> > > Scott
> > >
> > > -----Original Message-----
> > > From: James Taylor [mailto:[EMAIL PROTECTED]]
> > > Sent: Friday, March 22, 2002 2:30 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: [PHP] FAQ
> > >
> > >
> > > Has anyone given any thought to possibly maintaining a FAQ
containing
> > > the answers to the most commonly asked PHP questions on this list?
I
> > > notice duplicates roll through every couple of days, and it would
> > > probably be a really nice PHP resource.
> > >
> > > Or, does one already exist? Ha.
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi,
I see there a number of PHP scripts/libraries out there for the purpose
of graphing data. Which one is considered to be the best, most powerful
/ easiest to use? I need to plot X/Y graphs for some data sets with
vertical error margin lines going along the y-axis. Any recommendations?
Cheers,
Lee
--- End Message ---
--- Begin Message ---
Lee P Reilly wrote:
> with
> vertical error margin lines going along the y-axis. Any recommendations?
Ahem, the X axis.
--- End Message ---
--- Begin Message ---
Lee P Reilly wrote:
> Hi,
>
> I see there a number of PHP scripts/libraries out there for the purpose
> of graphing data. Which one is considered to be the best, most powerful
> / easiest to use? I need to plot X/Y graphs for some data sets with
> vertical error margin lines going along the y-axis. Any recommendations?
>
By far the strongest I've seen/used is jpgraph. Others here
have picked it up faster than I have - I can't say it's the easiest to
learn, but definitely very powerful (rotated 3d pie charts?!)
Have you looked at it? Is there something it's missing?
--------------------------
Michael Kimsal
http://www.phphelpdesk.com
Guaranteed PHP support
734-480-9961
--- End Message ---
--- Begin Message ---
Yeah, I've ran into a few of those customers. It's even worst when you
find one that doesn't know what they want, yet have many, sometimes
conflicting, restrictions.
Thanks, Miles!
-john
On Fri, 22 Mar 2002, Miles Thompson wrote:
> It depends on the project. I generally charge $50/hr and bill on a two week
> cycle.
>
> Customers invariably want estimates, and I provide them, then warn when the
> requests for "extra functionality" start eating up the estimate. Generally
> they spring for the extra $$.
>
> Worst customers? The ones who don't know what they want, or give the
> vaguest direction, and then you iterate from there. Those bills are usually
> astronomical, in the sense that what they ended up with could have been
> reached with a little more work and commitment at their end.
>
> Regards - Miles Thompson
>
>
> At 10:24 PM 3/21/2002 -0800, Robin Chen wrote:
> >We calculate the charge by $75-$150 per hour depending on complexity of the
> >project, then quote customer the final price. On small projects, < $5000, its
> >usually half before project, and half after project. For project > $5000,
> >it's usually 30% up front, 30% when we have major features completed, 30% when
> >delivered, last 10% when finalized. On even large projects $15k+, we usually
> >go by phases.
> >
> >Robin
> >
> >"[-^-!-%-" wrote:
> >
> > > Hello everyone,
> > >
> > > I'm in the process of revising my db development prices, and was wondering
> > > what the best practices were. I want to keep my prices low, but I often
> > > feel like I'm not charging close to what I should be charging.
> > >
> > > 1) What is the going rate for Database Development (MySQL+PHP
> > > or any other combo)?
> > >
> > > 2) What (or how) do you charge for MySQL+PHP database applications?
> > > 3) What do you factor into your pricing?
> > >
> > > We currently package our prices by the project. Example, we
> > > would charge one flat fee for an online database application.
> > > This would include everything from start to finish. Sometimes
> > > this works out, but other times it gets painful and tedious. I often feel
> > > like I'm not charging as much as I should be.
> > >
> > > 4) What is the best practice for db development pricing?
> > > Flat fee or hourly based? Do you charge based on the number of hours spent
> > > (anticipated) or by the project complexity and/or size?
> > >
> > > 5) Do you charge in stages or upon completion? For example, do you charge
> > > after the planning phase, development phase, etc. Or, after the project
> > > is complete?
> > >
> > > I'm especially interested in hearing from the West Coast (USA) developers.
> > > Any feedback would be greatly appreciated.
> > >
> > > Thanks.
> > >
> > > -john
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
http://vancouver-webpages.com/multilingual/ccodes.txt
http://vancouver-webpages.com/multilingual/iso639a.txt
This seems like useful information for this purpose... and so I've
decided to forward it to the list as well... if this is considered
spamming please let me know so that I can avoid it in the future.
Thanks
Cheers!
-----Original Message-----
From: ...:: Rober2 ::... [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 2:25 PM
To: Demitrious S. Kelly
Subject: Re: [PHP] A Language Script?
Thanks!!
BTW: do you know about any site that provides the e.g. "en-us" tag but
for
other languages? I've tried the W3 but no result.......
--- End Message ---
--- Begin Message ---
"Robert V. Zwink" wrote:
> Then when someone sends back the $unique_id by clicking on your link, you
> can instuct MySQL to disable the record:
>
> "UPDATE users SET send_email = 'NO' WHERE
> MD5(email_address.'ThisIsASecretKey123')=$unique_id "
This works...with a small change (or is it a fix?):
"UPDATE users SET send_email = 'NO' WHERE
MD5(concat(email_address,'ThisIsASecretKey123'))='$unique_id' "
Your example generates a syntax error.
Thanks for the suggestion!
PS: Alternatively, I just stuck '$secret_key' in the query line, this way I
only have to change it in one location, and not have it hardcoded anywhere else.
--
W | I haven't lost my mind; it's backed up on tape somewhere.
+--------------------------------------------------------------------
Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130
IT Director / SysAdmin / WebSmith . 800.441.3873 x130
Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave. #6
http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.
--- End Message ---
--- Begin Message ---
I have a variable name in a print <<< END and then some text after it. The
thing is, php thinks that the text is part of the variable name, which makes
the variable, and the text after it, not show up. But, if I put a space, it
makes my html not work right. Any ideas?
--- End Message ---
--- Begin Message ---
show your code
-----Original Message-----
From: Leif K-Brooks [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 5:18 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Variable problem
I have a variable name in a print <<< END and then some text after it. The
thing is, php thinks that the text is part of the variable name, which makes
the variable, and the text after it, not show up. But, if I put a space, it
makes my html not work right. Any ideas?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
${varable}ABC
-----Original Message-----
From: Leif K-Brooks [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 5:21 PM
To: Rick Emery
Subject: Re: [PHP] Variable problem
on 3/22/02 6:18 PM, Rick Emery at [EMAIL PROTECTED] wrote:
show your code
-----Original Message-----
From: Leif K-Brooks [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 5:18 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Variable problem
I have a variable name in a print <<< END and then some text after it. The
thing is, php thinks that the text is part of the variable name, which makes
the variable, and the text after it, not show up. But, if I put a space, it
makes my html not work right. Any ideas?
It's something like this:
print <<< END
$varableABC
END;
--- End Message ---
--- Begin Message ---
On 22 Mar 2002 at 17:27, Rick Emery wrote:
> ${varable}ABC
in quotes you can help php with
{$(varabl)}ABC
>
>
> -----Original Message-----
> From: Leif K-Brooks [mailto:[EMAIL PROTECTED]]
> Sent: Friday, March 22, 2002 5:21 PM
> To: Rick Emery
> Subject: Re: [PHP] Variable problem
>
>
> on 3/22/02 6:18 PM, Rick Emery at [EMAIL PROTECTED] wrote:
>
>
>
> show your code
>
> -----Original Message-----
> From: Leif K-Brooks [mailto:[EMAIL PROTECTED]]
> Sent: Friday, March 22, 2002 5:18 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Variable problem
>
>
> I have a variable name in a print <<< END and then some text after it. The
> thing is, php thinks that the text is part of the variable name, which makes
> the variable, and the text after it, not show up. But, if I put a space, it
> makes my html not work right. Any ideas?
>
>
>
>
> It's something like this:
> print <<< END
> $varableABC
> END;
>
>
>
--
! please check my email address !
! only my email [EMAIL PROTECTED] works !
! email [EMAIL PROTECTED] is a black hole since januari 2002 !
Chris Hayes - Droef 35 - Wageningen
--- End Message ---
--- Begin Message ---
How can I tell whether anything was matched and changed after a
mysql_db_query?
If I'm in MySQL's console and I perform a query, it comes back and tells me
something like:
Query OK, 0 rows affected (0.00 sec)
Rows matched: 0 Changed: 0 Warnings: 0
And if something matched, 'Rows matched' would be different, and if
anything was changed, 'rows affected' would be different. How can I get that
kind of results back to PHP so I can determine whether the query was actually
successful in changing something (versus just being successful or not).
--
W | I haven't lost my mind; it's backed up on tape somewhere.
+--------------------------------------------------------------------
Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130
IT Director / SysAdmin / WebSmith . 800.441.3873 x130
Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave. #6
http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.
--- End Message ---
--- Begin Message ---
$result = mysql_query(.....)'
mysql_num_rows($result)
-----Original Message-----
From: Ashley M. Kirchner [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 5:28 PM
To: PHP-General List
Subject: [PHP] MySQL query results
How can I tell whether anything was matched and changed after a
mysql_db_query?
If I'm in MySQL's console and I perform a query, it comes back and tells
me
something like:
Query OK, 0 rows affected (0.00 sec)
Rows matched: 0 Changed: 0 Warnings: 0
And if something matched, 'Rows matched' would be different, and if
anything was changed, 'rows affected' would be different. How can I get
that
kind of results back to PHP so I can determine whether the query was
actually
successful in changing something (versus just being successful or not).
--
W | I haven't lost my mind; it's backed up on tape somewhere.
+--------------------------------------------------------------------
Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130
IT Director / SysAdmin / WebSmith . 800.441.3873 x130
Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave. #6
http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Rick Emery wrote:
> $result = mysql_query(.....)'
> mysql_num_rows($result)
Hrm, this is resulting in:
<b>Warning</b>: Supplied argument is not a valid MySQL result resource in
<b>./index.php</b> on line <b>16</b><br>
Rows
The query does get executed, and the record does get changed.
The code looks like this:
$conn = @MYSQL_CONNECT($host,$user,$password) ;
mysql_select_db($database, $conn);
$query = "UPDATE clients SET email_flag='0' WHERE
MD5(concat(email_address,'$key'))='$uniqueID' ";
$result = mysql_query($query, $conn);
$num_rows = mysql_num_rows($result);
echo "$num_rows Rows\n";
--
W | I haven't lost my mind; it's backed up on tape somewhere.
+--------------------------------------------------------------------
Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130
IT Director / SysAdmin / WebSmith . 800.441.3873 x130
Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave. #6
http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.
--- End Message ---
--- Begin Message ---
After a bit of research:
----------
Rick Emery wrote:
> $result = mysql_query(.....)'
> mysql_num_rows($result)
Hrm, this is resulting in:
<b>Warning</b>: Supplied argument is not a valid MySQL result resource in
<b>./index.php</b> on line <b>16</b><br>
Rows
----------
Rightfully so. mysql_query() will only return true/false for UPDATEs
indicating failure/success. And, it's perfectly normal for it to be TRUE even
if absolutely nothing was changed in the DB - the query was successful. And
mysql_num_rows($result) fails because $result=1 (assuming the query was valid).
So, I need a different way to approach this so I can get some type of
indication that something did change in the DB, or whether no records were
found in the first place.
I'd hate to have to do this in two steps, first query the DB with a SELECT
statement, and if something was found, then do an UPDATE.
Anyone have any other ideas?
--
W | I haven't lost my mind; it's backed up on tape somewhere.
+--------------------------------------------------------------------
Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130
IT Director / SysAdmin / WebSmith . 800.441.3873 x130
Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave. #6
http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.
--- End Message ---
--- Begin Message ---
On 22 Mar 2002 at 16:41, Ashley M. Kirchner wrote:
> Rick Emery wrote:
> The query does get executed, and the record does get changed.
>
> The code looks like this:
>
> $conn = @MYSQL_CONNECT($host,$user,$password) ;
> mysql_select_db($database, $conn);
> $query = "UPDATE clients SET email_flag='0' WHERE
> MD5(concat(email_address,'$key'))='$uniqueID' ";
> $result = mysql_query($query, $conn);
> $num_rows = mysql_num_rows($result);
> echo "$num_rows Rows\n";
seems there is something wrong with the query, can you either echo the query and
feed it directly to mysql, (e.g. in phpmyadmin) see what happens?
also, i always do queries like this:
$result=mysql_query($query) or die ('<H1><font color=red>Bad database request
setting email flag </font></H2> in :'
.__FILE__ .' line '.__LINE__
.'<br /><b>The query used was:</b> '.$query
.'<br /><b>MySQL says</b> '.mysql_error() );
I find it is extremely useful in debugging.
--
! please check my email address !
! only my email [EMAIL PROTECTED] works !
! email [EMAIL PROTECTED] is a black hole since januari 2002 !
Chris Hayes - Droef 35 - Wageningen
--- End Message ---
--- Begin Message ---
http://www.php.net/manual/en/function.mysql-affected-rows.php
On Fri, 22 Mar 2002, Ashley M. Kirchner wrote:
>
> After a bit of research:
>
> ----------
> Rick Emery wrote:
>
> > $result = mysql_query(.....)'
> > mysql_num_rows($result)
>
> Hrm, this is resulting in:
>
> <b>Warning</b>: Supplied argument is not a valid MySQL result resource in
> <b>./index.php</b> on line <b>16</b><br>
> Rows
> ----------
>
>
> Rightfully so. mysql_query() will only return true/false for UPDATEs
> indicating failure/success. And, it's perfectly normal for it to be TRUE even
> if absolutely nothing was changed in the DB - the query was successful. And
> mysql_num_rows($result) fails because $result=1 (assuming the query was valid).
>
> So, I need a different way to approach this so I can get some type of
> indication that something did change in the DB, or whether no records were
> found in the first place.
>
> I'd hate to have to do this in two steps, first query the DB with a SELECT
> statement, and if something was found, then do an UPDATE.
>
> Anyone have any other ideas?
>
> --
> W | I haven't lost my mind; it's backed up on tape somewhere.
> +--------------------------------------------------------------------
> Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130
> IT Director / SysAdmin / WebSmith . 800.441.3873 x130
> Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave. #6
> http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
oops. i see then my previous mail will not help in this case. wasn't
there something called 'affected_rows'? search the online manual for
'affected'.
On 22 Mar 2002 at 17:09, Ashley M. Kirchner wrote:
>
> After a bit of research:
>
> ----------
> Rick Emery wrote:
>
> > $result = mysql_query(.....)'
> > mysql_num_rows($result)
>
> Hrm, this is resulting in:
>
> <b>Warning</b>: Supplied argument is not a valid MySQL result resource in
> <b>./index.php</b> on line <b>16</b><br>
> Rows
> ----------
>
>
> Rightfully so. mysql_query() will only return true/false for UPDATEs
> indicating failure/success. And, it's perfectly normal for it to be TRUE even
> if absolutely nothing was changed in the DB - the query was successful. And
> mysql_num_rows($result) fails because $result=1 (assuming the query was valid).
>
> So, I need a different way to approach this so I can get some type of
> indication that something did change in the DB, or whether no records were
> found in the first place.
>
> I'd hate to have to do this in two steps, first query the DB with a SELECT
> statement, and if something was found, then do an UPDATE.
>
> Anyone have any other ideas?
>
> --
> W | I haven't lost my mind; it's backed up on tape somewhere.
> +--------------------------------------------------------------------
> Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130
> IT Director / SysAdmin / WebSmith . 800.441.3873 x130
> Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave. #6
> http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
! please check my email address !
! only my email [EMAIL PROTECTED] works !
! email [EMAIL PROTECTED] is a black hole since januari 2002 !
Chris Hayes - Droef 35 - Wageningen
--- End Message ---
--- Begin Message ---
Rasmus Lerdorf wrote:
> http://www.php.net/manual/en/function.mysql-affected-rows.php
Thanks Rasmus. I did try that as well, same result. If I don't bother with the
$result, everything's fine. Like I said, the query runs, and gets executed. The DB
field gets changed as it should and all. $result is always 1 (since the query is
syntactically valid). But, if I run mysql_affected_rows($result), that's when I run
into an error.
--
W | I haven't lost my mind; it's backed up on tape somewhere.
+--------------------------------------------------------------------
Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130
IT Director / SysAdmin / WebSmith . 800.441.3873 x130
Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave. #6
http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.
--- End Message ---
--- Begin Message ---
Chris wrote:
> > The query does get executed, and the record does get changed.
>
> seems there is something wrong with the query, can you either echo the query and
> feed it directly to mysql, (e.g. in phpmyadmin) see what happens?
Nope, the query's fine. I can run it manually, and through the script and it
DOES run, and DOES make the changes it's told to make. It's the result that won't
work and I think I found out why - if you read my next message.
--
W | I haven't lost my mind; it's backed up on tape somewhere.
+--------------------------------------------------------------------
Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130
IT Director / SysAdmin / WebSmith . 800.441.3873 x130
Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave. #6
http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.
--- End Message ---
--- Begin Message ---
Chris wrote:
> oops. i see then my previous mail will not help in this case. wasn't
> there something called 'affected_rows'? search the online manual for
> 'affected'.
I did. Read my reply to Rasmus as well. :) At this rate, I may just say to heck
with the $result, and always assume something was done.
--
W | I haven't lost my mind; it's backed up on tape somewhere.
+--------------------------------------------------------------------
Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130
IT Director / SysAdmin / WebSmith . 800.441.3873 x130
Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave. #6
http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.
--- End Message ---
--- Begin Message ---
But did you read the documentation? It states:
int mysql_affected_rows ( [resource link_identifier])
That's an optional link identifier. You don't feed it a result resource.
Just call it without any arguments. The affected rows is tied to a
database connection, not a result set.
-Rasmus
On Fri, 22 Mar 2002, Ashley M. Kirchner wrote:
> Rasmus Lerdorf wrote:
>
> > http://www.php.net/manual/en/function.mysql-affected-rows.php
>
> Thanks Rasmus. I did try that as well, same result. If I don't bother with the
> $result, everything's fine. Like I said, the query runs, and gets executed. The DB
> field gets changed as it should and all. $result is always 1 (since the query is
> syntactically valid). But, if I run mysql_affected_rows($result), that's when I run
> into an error.
>
> --
> W | I haven't lost my mind; it's backed up on tape somewhere.
> +--------------------------------------------------------------------
> Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130
> IT Director / SysAdmin / WebSmith . 800.441.3873 x130
> Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave. #6
> http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.
>
>
>
--- End Message ---
--- Begin Message ---
Rasmus Lerdorf wrote:
> But did you read the documentation? It states:
Yes. But, reading it, and my brain actually registering what I was reading, now
that's a different story. :) It _is_ Friday after all. Thanks!
--
H | "Life is the art of drawing without an eraser." - John Gardner
+--------------------------------------------------------------------
Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130
Director of Internet Operations / SysAdmin . 800.441.3873 x130
Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave, #6
http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.
--- End Message ---
--- Begin Message ---
FWIW, straight from my code, with a few snips:
<?
$sql = "SELECT * FROM news ORDER BY id DESC LIMIT $limit";
$result = @mysql_query($sql);
print mysql_error();
if (!$result)
{
echo "No database found.";
}
elseif(mysql_num_rows($result) == 0)
{
echo "No records found.";
}
else
{
while($myrow = mysql_fetch_array($result))
{
//do stuff with the array $myrow
}
}
?>
Justin French
--------------
http://indent.com.au
http://soundpimps.com
http://hinge.net.au
"Ashley M. Kirchner" wrote:
>
> Rasmus Lerdorf wrote:
>
> > But did you read the documentation? It states:
>
> Yes. But, reading it, and my brain actually registering what I was reading, now
>that's a different story. :) It _is_ Friday after all. Thanks!
>
> --
> H | "Life is the art of drawing without an eraser." - John Gardner
> +--------------------------------------------------------------------
> Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130
> Director of Internet Operations / SysAdmin . 800.441.3873 x130
> Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave, #6
> http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Justin French wrote:
> $sql = "SELECT * FROM news ORDER BY id DESC LIMIT $limit";
You're forgetting (or just didn't read my code), I'm UPDATE-ing, not SELECT-ing.
mysql_num_rows() doesn't work on UPDATE.
Anyway, thanks to Rasmus for pointing out my error.
--
H | "Life is the art of drawing without an eraser." - John Gardner
+--------------------------------------------------------------------
Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130
Director of Internet Operations / SysAdmin . 800.441.3873 x130
Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave, #6
http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.
--- End Message ---
--- Begin Message ---
On 22 Mar 2002 at 13:30, Jim Lucas [php] wrote:
> how about giving an example of the error message(s)...
ok Jim. step by step.
1. parse error on line 36 of include.php.
2. then i fixed the error , even made line 36 empty, so the message
should point to line 37.
3. reloaded, and the message stayed identical: parse error on line 36.
(the same happens with typing errors that i correct: the correction
does not show! the old error is echoed.)
4. Then, to try to clean the cache(?), in index.php i made a deliberate
error by adding the # :
#include (include.php);
function_in_that_file();
5. Reload: and i got a got the obvious error message: cannot find
that function_in_that_file().
6. Repaired error in index by removing the #.
7. After a reload often [but not always] the correction in include.php
is accepted.
Reminder: this happens with a new version of the Postnuke CMS, it
now uses sessions.
IE6, caching turned of, and check page every time as well as
'automatic'..
Also reproducable in Opera.
Chris
> ----- Original Message -----
> From: "Chris" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, March 22, 2002 12:59 PM
> Subject: [PHP] included files not reread by php when i edit the files
>
>
> > While editing pages, for some reason (default setting? / configuration
> > problem?) the changes i make in included files (with sometimes quite
> > some nesting) are not recognized when reloading a page. So i see
> > errors that belong to the previous version.
> >
> > What setting could do this?
> >
> > I'm quite sure the browser is not caching the page.
> >
> > Win98 + 'foxserv', that is: apache, mysql. php, zend.
> > Using: Postnuke 0.7.1 with sessions (it did not happen before the
> > sessions, but cannot imagine the sessions do this.).
> > I would suspect zend but it also happened with the normal php 4.06.
> >
> > cheers,
> > Chris
> >
> > --
> > ! please check my email address !
> > ! only my email [EMAIL PROTECTED] works !
> > ! email [EMAIL PROTECTED] is a black hole since januari 2002 !
> >
> > Chris Hayes - Droef 35 - Wageningen
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
! please check my email address !
! only my email [EMAIL PROTECTED] works !
! email [EMAIL PROTECTED] is a black hole since januari 2002 !
Chris Hayes - Droef 35 - Wageningen
--- End Message ---
--- Begin Message ---
Hi,
I have a form with a text field, say userName.
I put a value in that has double quotes (i.e. "foobar") and submit this form.
On output I have this:
<?php echo $HTTP_POST_VARS["userName"]; ?>
The output ends up being a \.
How do I keep the double quotes?
Thanks,
Stephen
--- End Message ---
--- Begin Message ---
Red Hat 7.2
OK- I'm going on ahead w/o T1lib for the moment.
compiled and installed php-4.1.2
Now some font stuff is busted.
Any image where I use ImageTTFText
no longer works.
I used these configure options for my php gd functions-
--with-zlib=/usr \
--with-gd \
--enable-gd-native-ttf \
--with-freetype-dir=/usr/local \
What's up?
phpinfo() is at http://macaddict4life.dhs.org/info.php
if that helps.
--- End Message ---
--- Begin Message ---
Red Hat 7.2
OK- I'm going on ahead w/o T1lib for the moment.
compiled and installed php-4.1.2
Now some font stuff is busted.
Any image where I use ImageTTFText
no longer works.
I used these configure options for my php gd functions-
--with-zlib=/usr \
--with-gd \
--enable-gd-native-ttf \
--with-freetype-dir=/usr/local \
What's up?
phpinfo() is at http://macaddict4life.dhs.org/info.php
if that helps.
--- End Message ---
--- Begin Message ---
Hello!
I want to know how I can create email POP accounts from a script PHP.
If somebody can help me, thank ahead of time!
Regards! Julian
--- End Message ---
--- Begin Message ---
I am a newbie and can't tell you how to do it, but I know that the book
I am reading can! Chapter 27 is titled "Building a Web-based Email
Service". The Book is title "PHP and MySQL Web Development" and I like
it alot. It was recommended on the mysql.com.
http://tangledweb.com.au/
-Dan
--- Julian <[EMAIL PROTECTED]> wrote:
> Hello!
>
> I want to know how I can create email POP accounts from a script PHP.
>
>
> If somebody can help me, thank ahead of time!
>
> Regards! Julian
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/
--- End Message ---
--- Begin Message ---
vpopmail?
"Dan Harrelson" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
| I am a newbie and can't tell you how to do it, but I know that the book
| I am reading can! Chapter 27 is titled "Building a Web-based Email
| Service". The Book is title "PHP and MySQL Web Development" and I like
| it alot. It was recommended on the mysql.com.
|
| http://tangledweb.com.au/
|
| -Dan
|
|
|
|
| --- Julian <[EMAIL PROTECTED]> wrote:
| > Hello!
| >
| > I want to know how I can create email POP accounts from a script PHP.
| >
| >
| > If somebody can help me, thank ahead of time!
| >
| > Regards! Julian
| >
| >
| > --
| > PHP General Mailing List (http://www.php.net/)
| > To unsubscribe, visit: http://www.php.net/unsub.php
| >
|
|
| __________________________________________________
| Do You Yahoo!?
| Yahoo! Movies - coverage of the 74th Academy Awards®
| http://movies.yahoo.com/
--- End Message ---
--- Begin Message ---
Hey!
Does anybody use UltraDev for PHP?
Any comments about it?
(Personally I go for Visual PHP Studio)
--- End Message ---
--- Begin Message ---
I do, and was just thinking of posing a similar question. My question
was specific to the PHAkt app server extension. I've tried it out and
think it's great, though limited. For example, my simple project (my
very first :) calls for inserts into 2 tables from a single form.
Phakt doesn't support this. Nor, do I believe, does it support joins
for retrieval of data.
http://www.interakt.ro/products/PHAkt/index.php
Either way, I use Ultradev quite a bit and dig on it.
-Dan
--- "....::: rObEr2 :::...." <[EMAIL PROTECTED]> wrote:
> Hey!
>
> Does anybody use UltraDev for PHP?
> Any comments about it?
>
> (Personally I go for Visual PHP Studio)
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/
--- End Message ---
--- Begin Message ---
I didn't put mailing list I meant Usenet lists.
"Bvr" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
>
> Why not try www.perl.com ???
>
> I found: http://www.perl.com/cs/user/query/q/6?id_topic=50
>
> bvr.
>
> David Duong wrote:
>
> >This may be the worst place to put this but here goes:
> >
> >Does anyone know of a Perl NewsGroup?
> >
> >
> >
>
>
--- End Message ---
--- Begin Message ---
On 23-Mar-2002 David Duong wrote:
> I didn't put mailing list I meant Usenet lists.
>
comp.lang.perl.misc
This is not a newbie froup. Read the FAQ, and post your code, or prepare to
be flamed to a crackly crunch.
Regards,
--
Don Read [EMAIL PROTECTED]
-- It is necessary for me to learn from others' mistakes. I
will not live long enough to make them all by myself.
--- End Message ---
--- Begin Message ---
empty -- Determines whether a variable is set
gives a boolean result.
$var = 0;
if (empty($var)) { // evaluates true
echo '$var is either 0 or not set at all';
}
if (!isset($var)) { // evaluates false
echo '$var is not set at all';
}
I don't think that
<?php
if (empty($a=5)) {
echo 'ok';
} else {
echo 'bad';
}
?>
would work. Try:
If you want to see if variable is empty, if it is change it to 5.
<?php
if (empty($var)) {
echo 'ok';
} else {
echo 'bad';
$a=5;
}
?>
------ OR ----------
If you what to see if $a == 5 than
<?php
if ($var==5) {
echo 'ok';
} else {
echo 'bad';
$a=5;
}
?>
"Bob" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> why this get wrong?
>
> <?php
>
> if (empty($a=5)) {
> echo 'ok';
> } else {
> echo 'bad';
> }
> ?>
>
--- End Message ---
--- Begin Message ---
I was wondering what is the equvilent of the perl coommand: grep.
Can you list all the files in a certain directory and put it in an array.
Can you list all the files with *.htm in a certain directory and put it in
an array.
--- End Message ---
--- Begin Message ---
Stristr()
-----Original Message-----
From: David Duong [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 4:43 PM
To: [EMAIL PROTECTED]
Subject: [PHP] What is the PHP version of Grep?
I was wondering what is the equvilent of the perl coommand: grep.
Can you list all the files in a certain directory and put it in an
array.
Can you list all the files with *.htm in a certain directory and put it
in
an array.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
go to google, put in 'free mysql hosting', press 'feeling lucky' ..
http://www.free-php-hosting.com/
bvr.
Daniel Negron/KBE wrote:
>Does anyone have a good site for free mySQL and PHP hosting ?
>
>
>**DAN**
>
>
--- End Message ---
--- Begin Message ---
How do I take the current URL and turn it into a variable?
THANKS!!
Phil
--- End Message ---
--- Begin Message ---
Hi,
This really is pretty easy to find in the manual.
I believe you'd want either $PHP_SELF or $REQUEST_URI, both documented here:
http://www.php.net/manual/en/reserved.variables.php
Justin French
---------------------
http://indent.com.au
http://soundpimps.com
http://hinge.net.au
Phil Schwarzmann wrote:
>
> How do I take the current URL and turn it into a variable?
>
> THANKS!!
> Phil
--- End Message ---
--- Begin Message ---
Here you go:
<?
// ////////////////////////////////////////////////////////
// Put current URL into a variable
//
// Inelegant but it works
// ////////////////////////////////////////////////////////
$url = $_SERVER["HTTP_HOST"] . $PATH_INFO;
print "url = $url";
?>
Scott
-----Original Message-----
From: Phil Schwarzmann [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 9:08 PM
To: [EMAIL PROTECTED]
Subject: [PHP] URL information into a variable
How do I take the current URL and turn it into a variable?
THANKS!!
Phil
--- End Message ---
--- Begin Message ---
When I want to display a table onto the screen I use this code....
$query = "SELECT * FROM database";
$result = mysql_query($query);
$num_rows = mysql_num_rows($result);
for ($i = 0; $i < $num_rows; $i++) {
$field1 = mysql_result($result, $i, field1);
$field2 = mysql_result($result, $i, field2);
echo $field1.$field2;
}
...but I heard that using mysql_result() is very ineffecient and that I
should be using mysql_fetch_array() instead.
So how could produce those same results using mysql_fetch_array()
instead??
THANKS!! YOU GUYS ROCK!!!
--- End Message ---
--- Begin Message ---
Hi,
(untested code)
<?
$sql = "SELECT id,heading,message FROM news ORDER BY id DESC LIMIT 5;
$result = @mysql_query($sql);
while($myrow = mysql_fetch_array($result))
{
echo $myrow["id"].$myrow["heading"].$myrow["message"];
}
?>
or better still:
<?
$sql = "SELECT id,heading,message FROM news ORDER BY id DESC LIMIT 5;
$result = @mysql_query($sql);
while($myrow = mysql_fetch_array($result))
{
foreach($myrow as $key => $value)
{
// convert $myrow["id"] to $id, etc etc for all fields
// much easier to work with!!
$$key=nl2br(stripslashes($value));
}
echo $id.$heading.$message;
}
?>
Justin French
---------------------
http://indent.com.au
http://soundpimps.com
http://hinge.net.au
Phil Schwarzmann wrote:
>
> When I want to display a table onto the screen I use this code....
>
> $query = "SELECT * FROM database";
> $result = mysql_query($query);
> $num_rows = mysql_num_rows($result);
> for ($i = 0; $i < $num_rows; $i++) {
> $field1 = mysql_result($result, $i, field1);
> $field2 = mysql_result($result, $i, field2);
> echo $field1.$field2;
> }
>
> ...but I heard that using mysql_result() is very ineffecient and that I
> should be using mysql_fetch_array() instead.
>
> So how could produce those same results using mysql_fetch_array()
> instead??
>
> THANKS!! YOU GUYS ROCK!!!
--- End Message ---
--- Begin Message ---
mysql_query("UPDATE access SET accessVIEW = accessVIEW+1 WHERE accessIP = $proxy_ip");
is there anything wrong with this?
Philip J. Newman
PhilipNZ :: Design Solutions
http://www.philipnz.com/
[EMAIL PROTECTED]
ICQ# 20482482
+64 25 6144012
--- End Message ---
--- Begin Message ---
mysql_query("UPDATE access SET accessVIEW = accessVIEW+1 WHERE accessIP =
'$proxy_ip'");
Singles quotes around $proxy_ip?
--
Julio Nobrega.
Um dia eu chego lá:
http://sourceforge.net/projects/toca
Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884
"Philip J. Newman" <[EMAIL PROTECTED]> wrote in message
001301c1d21b$61c42900$0401a8c0@philip">news:001301c1d21b$61c42900$0401a8c0@philip...
mysql_query("UPDATE access SET accessVIEW = accessVIEW+1 WHERE accessIP =
$proxy_ip");
is there anything wrong with this?
Philip J. Newman
PhilipNZ :: Design Solutions
http://www.philipnz.com/
[EMAIL PROTECTED]
ICQ# 20482482
+64 25 6144012
--- End Message ---
--- Begin Message ---
1.php? 2.php
session_start(); session_start();
.......... ..........
$_SESSION['a'] =$a; echo $_SESSION['a'];
$_SESSION['b'] =$b; echo $_SESSION['b'];
header("location: 2.php");
after jump to 2.php ,there is an warning: undefined index a ,b
if i change 1.php to
session_start();
..........
$_SESSION['a'] =$a;
$_SESSION['b'] =$b;
<a href='2.php' >go on </a>
it works well!
Best regards and thanks in advance,
bob
--- End Message ---
--- Begin Message ---
why is the $HTTP_POST_VARS array empty if i use IE? when i used NN, everything's ok.
please help!
---------------------------------
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
--- End Message ---
--- Begin Message ---
Sorry couldn't think of a better subject for this email :(
This has stumped 7 people so far. I'm not an expert with php, but any help
would be great.
I have the following
$Quantity1
$Quantity2
$Quantity3
and
$Price1
$Price2
$Price3
These variables will eventually make a "chart"/database with the following
headings
q1 q2 q3 q5 q10 q15 q20 q25 q50 q100 q300 q500 q600 q1000000000
the number represents the number of quantity
so $Quantity1 uses $Price1 's value
so if $Quantity1 is 10
and $Price1 is $1.00
that means each "unit" is .10
so the output would be
q1 q2 q3 q5 q10 q15 q20 q25 q50 q100 q300 q500 q600 q1000000000
0 0 0 0 .10 .10 .10 .10 .10 .10 .10 .10 .10 .10
Now the tricky part is $Quantity2 can either be blank or have a value
and if $Quantity2 has a value then $Quantity3 can either be blank or have a
value
SO If $Quantity2 is 500
and $Price2 is $40.00
the output would now be
q1 q2 q3 q5 q10 q15 q20 q25 q50 q100 q300 q500 q600 q1000000000
0 0 0 0 .10 .10 .10 .10 .10 .10 .10 .08 .08 .08
I think and hope you get the picture.
Things we know If there is no value for $Quantity2 then there will be no
$Quantity3
and of course if either or both of those quantities are empty there will be
no price.
And of course if there is a value for either of those quantities, there will
be a price.
So what method would be best for doing this? Any functions that may come in
handy?
_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail.
http://www.hotmail.com
--- End Message ---
--- Begin Message ---
If this is the explanation the other 7 got, I'm not
surprised they're stumped. :)
You don't seem to explain the formula to determine q100, q300, etc.,
which bugged me, but the text of your question seems to indicate
we don't really need to know this.
> Now the tricky part is $Quantity2 can either be blank or have a value
> and if $Quantity2 has a value then $Quantity3 can either be blank or
> have a value
if ($Quantity2) {
execute code
]
if ($Quantity3) {
execute code
]
Am I missing something obvious? Do the values of quantity2 and 3
have some impact on the pricings of quantity1? Could you explain your
problem in more detail (offlist is fine if you want).
--------------------------
Michael Kimsal
http://www.phphelpdesk.com
Guaranteed PHP support
734-480-9961
--- End Message ---
--- Begin Message ---
On Sat, Mar 23, 2002 at 05:19:05AM +0000, James Newkid wrote:
> so if $Quantity1 is 10
> and $Price1 is $1.00
> that means each "unit" is .10
>
> so the output would be
> q1 q2 q3 q5 q10 q15 q20 q25 q50 q100 q300 q500 q600 q1000000000
> 0 0 0 0 .10 .10 .10 .10 .10 .10 .10 .10 .10 .10
>
> Now the tricky part is $Quantity2 can either be blank or have a value
> and if $Quantity2 has a value then $Quantity3 can either be blank or have a
> value
>
> SO If $Quantity2 is 500
> and $Price2 is $40.00
> the output would now be
> q1 q2 q3 q5 q10 q15 q20 q25 q50 q100 q300 q500 q600 q1000000000
> 0 0 0 0 .10 .10 .10 .10 .10 .10 .10 .08 .08 .08
>
This had 7 people stumped? Fire them :)
I think you had something like this in mind:
----8<-----
<?
function CalcPPU($quantity, $price)
{
global $ppu;
global $quant;
for($i=0;$i<count($quant);$i++)
{
if($quant[$i]>=$quantity)
{
$ppu[$i]=$price/$quantity;
}
}
}
$quant=array(1,2,3,5,10,15,20,25,50,100,300,500,600,10000);
$Quantity1=10;
$Price1=1;
$Quantity2=500;
$Price2=40;
$ppu=array();
for($i=0;$i<count($quant);$i++)
{
$ppu[$i]=0;
}
if($Quantity1)
{
CalcPPU($Quantity1, $Price1);
if($Quantity2)
{
CalcPPU($Quantity2, $Price2);
if($Quantity3)
{
CalcPPU($Quantity3, $Price3);
}
}
}
for($i=0;$i<count($quant);$i++)
{
echo "|$quant[$i]";
}
echo "\n";
for($i=0;$i<count($quant);$i++)
{
echo "|$ppu[$i]";
}
echo "\n";
?>
----8<-----
Output:
|1|2|3|5|10|15|20|25|50|100|300|500|600|10000
|0|0|0|0|0.1|0.1|0.1|0.1|0.1|0.1|0.1|0.08|0.08|0.08
--
Daniel Tryba
PGP public key: http://www.stack.nl/~muaddib/pgp.txt
--- End Message ---
--- Begin Message ---
Hi, I've asked this before but I'm still ost.
How can I receive the contents of a remote website through PHP and only display one section of it?
Someone said something about curl.
What is it, where could I get it?
Thanks for your help,
Liam
--- End Message ---
--- Begin Message ---
On Saturday 23 March 2002 23:57, Liam wrote:
> Hi, I've asked this before but I'm still ost.
> How can I receive the contents of a remote website through PHP and only dis
>play one section of it?
>
> Someone said something about curl.
> What is it, where could I get it?
google > curl
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
/*
Kill Ugly Processor Architectures
- Karl Lehenbauer
*/
--- End Message ---
--- Begin Message ---
How much data (in Kilobytes) would I receive on
average per month from this list?
cheers,
Liam
--- End Message ---
--- Begin Message ---
I have installed PHP using the RPM packages from RedHat. Now I need to
reconfigure PHP to include more options. Is there a way to include
these options when reinstalling the RPM or do I need to ditch the RPM
and compile from the source files?
David McInnis
--- End Message ---
--- Begin Message ---
There's an php obfuscator, http://pobs.mywalhalla.net/, and one of the
options is to remove comments.
--
Julio Nobrega.
Um dia eu chego lá:
http://sourceforge.net/projects/toca
Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884
"Oliver Heinisch" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi Folks,
> does anybody know a tool for removing comments out of PHP scripts?
>
> I mean // this is a comment
> and /* this is also a comment */
>
> it should also handle something like
> echo'http://somewher.somecom/somepage'; // this goes to somewhere
> and multiline comment like
> /*
> ..blah
> */
> maybe anybody has an awk script, that he/she will share with me.
> TIA Oliver
>
--- End Message ---
--- Begin Message ---
there's also two tools called sed and grep that are available on any unix
system. and probably easily gettable on windblows.
That can probably remove most comments.
Why you would want to remove comments, I don't know.
They are very useful in the future when fixing something or changing
something.
Good Code == Commented Code
Well, Good Code is at least a subset of commented code ;)
If you don't want a customer to see them, use the Zend Encoder and hide
all your source.
On Sat, 23 Mar 2002 04:38:40 -0300
"Julio Nobrega" <[EMAIL PROTECTED]> mentioned:
> There's an php obfuscator, http://pobs.mywalhalla.net/, and one of the
> options is to remove comments.
>
> --
> Julio Nobrega.
>
> Um dia eu chego lá:
> http://sourceforge.net/projects/toca
>
> Ajudei? Salvei? Que tal um presentinho?
> http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884
> "Oliver Heinisch" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hi Folks,
> > does anybody know a tool for removing comments out of PHP scripts?
> >
> > I mean // this is a comment
> > and /* this is also a comment */
> >
> > it should also handle something like
> > echo'http://somewher.somecom/somepage'; // this goes to somewhere
> > and multiline comment like
> > /*
> > ..blah
> > */
> > maybe anybody has an awk script, that he/she will share with me.
> > TIA Oliver
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
At 23.03.2002 00:05, you wrote:
>
>there's also two tools called sed and grep that are available on any unix
>system. and probably easily gettable on windblows.
>
>That can probably remove most comments.
I know, and use these on LINUX, but I don´t want to spend time to develop
something
which is already made and tested. This will take a minimum of 6 hours dev.
I´m now in a position, where I cannot spend this time
>Why you would want to remove comments, I don't know.
>They are very useful in the future when fixing something or changing
>something.
>Good Code == Commented Code
>Well, Good Code is at least a subset of commented code ;)
That´s right, there are two versions of code, one for development,
the other, cleaned is on the production (ISP)machine. As I write a lot of
comments in a source,
(Good Code == Commented Code ;) ) It could make more than 50% of the code.
As you maybe have read the posts on speeding up the processing of code
(last week),
every line which is not necessary shouldn´t be read by the PHP-parser. I
also found
that if you remove the LF (CR/LF) combination, there´s a time reduce, even
this practice
is dangerous, especially for JavaScripts.
>If you don't want a customer to see them, use the Zend Encoder and hide
>all your source.
This makes need of php4* on the ISP, and I don´t want to encrypt the code,
just clean it.
To encrypt, Enrico suggested a link http://pobs.mywalhalla.net/ which does
this, free of charge.
Any other suggestions out there?
Oliver
--- End Message ---
--- Begin Message ---
Hi, can someone tell me why the following results in evaluated variables
with 2 slashes in front of apostrophys instead of one and how I can modify
it to only add 1? Thanks!
foreach($_POST as $k=>$v){
if (get_magic_quotes_gpc()){
$_POST[$k] = stripslashes($v);
}
$_POST[$k] = addslashes($v);
eval( "\$$k = \"$_POST[$k]\";" );
}
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.338 / Virus Database: 189 - Release Date: 3/14/02
--- End Message ---
--- Begin Message ---
can any one tell me what is this
;assert.active = On ; assert(expr); active by default
;assert.warning = On ; issue a PHP warning for each failed
;assert.bail = Off ; don't bail out by default.
;assert.callback = 0 ; user-function to be called if an assertion
;assert.quiet_eval = 0 ; eval the expression with current
setting in my php.ini file, I don't know what it is for, and it has been
commented.
Help would be appreciated.
<[EMAIL PROTECTED]>
-------------------------------------------------------------------
We must use time wisely and forever realize that the time is
always ripe to do right."
-- Nelson Mandela
-------------------------------------------------------------------
--- End Message ---
--- Begin Message ---
Is there a string length limitation to crypt()? It generates the same
result for different input strings. I'm using crypt to store access
codes that are generated using uniqid. For example, if I do the
following:
$encrypted = crypt("3c8d15c9cfe5a", "xx");
echo $encrytped;
$encrypted = crypt("3c8d15c9cfABC", "xx");
echo $encrytped;
it outputs:
xxsZRVVwtwY7Y
xxsZRVVwtwY7Y
So it appears the crypt is ignoring characters in a string after a
certain point. Am I missing something here?
Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Depends on the OS. I suggest using md() instead.
On Sat, 23 Mar 2002, Steven Walker wrote:
> Is there a string length limitation to crypt()? It generates the same
> result for different input strings. I'm using crypt to store access
> codes that are generated using uniqid. For example, if I do the
> following:
>
> $encrypted = crypt("3c8d15c9cfe5a", "xx");
> echo $encrytped;
> $encrypted = crypt("3c8d15c9cfABC", "xx");
> echo $encrytped;
>
> it outputs:
> xxsZRVVwtwY7Y
> xxsZRVVwtwY7Y
>
> So it appears the crypt is ignoring characters in a string after a
> certain point. Am I missing something here?
>
> Steven J. Walker
> Walker Effects
> www.walkereffects.com
> [EMAIL PROTECTED]
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
On Saturday 23 March 2002 05:38, Sanj wrote:
> template page at http://www.isbliss.co.nz/beta/mainpages/template.html
> disregard any linked pages.
Is this a php question?
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
/*
I can't decide whether to commit suicide or go bowling.
-- Florence Henderson
*/
--- End Message ---
--- Begin Message ---
Hi there,
I did search for a class to validate e-mail adresses. I found one and tryed
out the examplepage but there seems to be a prob with my php installation.
Everything after the -> ist just printed out to the screen. It just seems
that php thinks the error is the same like ?>
Here is a bit of a code:
<?php
require("email_validation.php");
$validator=new email_validation_class;
$validator->timeout=10;
So timeout is beeing printed out.
Does anybody know if this might be a prob on my site, or maybe the class has
a prob?
Thanx Andy
--- End Message ---