|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general-digest-help_at_lists.php.net
Date: Wed Nov 06 2002 - 06:42:04 CST
php-general Digest 6 Nov 2002 12:42:04 -0000 Issue 1688
Topics (messages 122900 through 122975):
fopen() with permissions?
122900 by: Charles Wiltgen
122904 by: Marco Tabini
122928 by: Charles Wiltgen
Using info from a MySQL Query
122901 by: Ben C.
122903 by: John W. Holmes
122905 by: rija
122906 by: Marco Tabini
122907 by: Rick Emery
122908 by: Chris Knipe
122923 by: rija
PHP 4.3.0 and Zend Engine 2
122902 by: matt.eclecticperceptions.com
sql error
122909 by: Jule Slootbeek
122910 by: Marco Tabini
122911 by: Jule Slootbeek
122912 by: Marco Tabini
122914 by: John W. Holmes
122915 by: Jule Slootbeek
122916 by: Jule Slootbeek
122917 by: Jule Slootbeek
Re: xml
122913 by: eriol
122938 by: Jason Wong
problem of javascript with dropdown list of array.
122918 by: Mack
122919 by: Martin Towell
122920 by: John W. Holmes
122930 by: Mack
122940 by: Jason Wong
imagerotate
122921 by: jacob.keystreams.com
Session handling
122922 by: Uma Shankari T.
122924 by: John W. Holmes
122931 by: Uma Shankari T.
122939 by: John W. Holmes
122964 by: Uma Shankari T.
122965 by: John W. Holmes
mySQL relations query
122925 by: Edgard Berendsen
122926 by: Marco Tabini
Bar Codes
122927 by: Ricardo Fitzgerald
122929 by: Marco Tabini
122932 by: Manuel Lemos
Regular expression problem
122933 by: rija
Trouble with php-4.2.3, apache-1.3.27, sablotron 0.96
122934 by: Evan Nemerson
122936 by: .: B i g D o g :.
122943 by: Evan Nemerson
How do I convert an array into a mask?
122935 by: Daevid Vincent
122941 by: rija
122944 by: Michael Sims
122952 by: Daevid Vincent
122953 by: Ernest E Vogelsinger
122963 by: John W. Holmes
122967 by: Jon Haworth
122968 by: John W. Holmes
122969 by: Daevid Vincent
122971 by: John W. Holmes
Re: function()
122937 by: Jason Wong
Re: Database creating from XML file
122942 by: Seung Hwan Kang
Re: Grammar/how toes?
122945 by: Evan Nemerson
Re: 4.2.3 compile problem on OSX
122946 by: Dale Schell
Re: Help me learn! with an explanation of these two functions.
122947 by: Steve Jackson
122948 by: Ernest E Vogelsinger
122949 by: Steve Jackson
122951 by: Ernest E Vogelsinger
122957 by: Jason Wong
Javascript and PHP
122950 by: vsv3.alu.ua.es
122955 by: Chris Hewitt
Re: *.PHP "save-as" dialog
122954 by: Chris Hewitt
122958 by: Jason Wong
Installation error with 4.2.3
122956 by: Daniele Baroncelli
Foreach ...... Help
122959 by: Remon Redika
122960 by: Jon Haworth
Re: MySQL GMT --> Local time
122961 by: Pete
Install mysql option without recompile PHP ?
122962 by: Audrey bihouee
Permissions
122966 by: Shaun
Re: PHP driven frame
122970 by: Marek Kilimajer
php4.2.2 remembers last GET and POST vars in HTTP_SESSION_VARS also
122972 by: Alexander Piavka
Re: how to do check boxes correclty?
122973 by: Marek Kilimajer
Re: undefined symbol: curl-global-init
122974 by: Marek Kilimajer
Re: generically accessing member variables problem
122975 by: Marek Kilimajer
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
Hello,
There doesn't seem to be a way to fopen() with permissions.
Someone commenting on the PHP manual suggested writing a file via FTP (which
would allow me to specify a user name and password).
Is this a reasonable thing to do? My plan is to create empty files via FTP,
and then fopen($thefile, "r")-ing from there (since I think that will be
faster than sending everything through an FTP server).
Any feedback is appreciated,
-- Charles Wiltgen
attached mail follows:
If you're using Apache, have you considered suexec? You can write an
external script that takes care of that.
Marco
-----------
php|architect -- The Monthly Magazine For PHP Professionals
Visit us on the web at http://www.phparch.com!
On Tue, 5 Nov 2002, Charles
Wiltgen wrote:
> Hello,
>
> There doesn't seem to be a way to fopen() with permissions.
>
> Someone commenting on the PHP manual suggested writing a file via FTP (which
> would allow me to specify a user name and password).
>
> Is this a reasonable thing to do? My plan is to create empty files via FTP,
> and then fopen($thefile, "r")-ing from there (since I think that will be
> faster than sending everything through an FTP server).
>
> Any feedback is appreciated,
>
> -- Charles Wiltgen
>
>
>
attached mail follows:
Marco Tabini wrote...
> If you're using Apache, have you considered suexec? You can write an external
> script that takes care of that.
My hosting provider (DreamHost) uses suexec. My understanding is that this
lets you run CGI scripts as another user, but I'm not sure how I could take
advantage of this since my code isn't run by users per se.
I'm building something that I hope lots of people will use, and the
challenge is that it needs to "just work" on almost any system that supports
PHP because the audience is, well, not going to know anything -- the ones
that'll have access to a command line won't generally know how to use it.
If I could chmod 777 the directory for a millisecond, the file could get
created/written fine and then everything would work fine from then on out
because the file has the correct permissions. But in the notes for chmod,
it sounds like lots of hosting providers disable this (which kinda rules it
out).
I will have the users' FTP user name/password, which is why I was thinking
of creating files via FTP. But speed is important, so this seems like more
of a "last resort" strategy.
I'm stumped. Many thanks for the response, and I appreciate any additional
thoughts.
-- Charles Wiltgen
attached mail follows:
I am using the following query:
$sql ="SELECT company, name, email FROM $table_name
WHERE email = '$_POST[email]' AND password = password('$_POST[password]')";
Then I am echoing the $email on my form (it works because the person has posted their e-mail name when logging in). How can I echo the company and email on to my form as well. Please help.
attached mail follows:
> I am using the following query:
>
> $sql ="SELECT company, name, email FROM $table_name
> WHERE email = '$_POST[email]' AND password =
> password('$_POST[password]')";
>
> Then I am echoing the $email on my form (it works because the person
has
> posted their e-mail name when logging in). How can I echo the company
and
> email on to my form as well. Please help.
echo $company ??
echo $email ??
Show what you have so far and what you want to happen. You're too vague.
---John Holmes...
attached mail follows:
Put your variables into {} like this '{$_POST['email'] }',
$sql ="SELECT company, name, email FROM $table_name
WHERE email = '{$_POST[email]}' AND password =
password('{$_POST[password]}')";
----- Original Message -----
From: "Ben C." <benc
cox.net>
To: <php-general
lists.php.net>
Sent: Wednesday, November 06, 2002 12:09 PM
Subject: [PHP] Using info from a MySQL Query
> I am using the following query:
>
> $sql ="SELECT company, name, email FROM $table_name
> WHERE email = '$_POST[email]' AND password =
password('$_POST[password]')";
>
> Then I am echoing the $email on my form (it works because the person has
posted their e-mail name when logging in). How can I echo the company and
email on to my form as well. Please help.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
I think you might want something like this:
$sql ="SELECT company, name, email FROM $table_name
WHERE email = '$_POST[email]' AND password =
password('$_POST[password]');
$rs = mysql_query ($sql, mysql_connect ('server', 'user', 'pass');
$a = mysql_fetch_array ($rs);
echo $a['company'];
echo $a['name'];
Minus some error checking, this is pretty much it.
Marco
-----------
php|architect -- The Monthly Magazine For PHP Professionals
Visit us on the web at http://www.phparch.com!
On Tue, 5 Nov 2002, Ben C.
wrote:
> I am using the following query:
>
> $sql ="SELECT company, name, email FROM $table_name
> WHERE email = '$_POST[email]' AND password = password('$_POST[password]')";
>
> Then I am echoing the $email on my form (it works because the person has posted their e-mail name when logging in). How can I echo the company and email on to my form as well. Please help.
>
>
>
attached mail follows:
$sql ="SELECT company, name, email FROM $table_name
WHERE email = '$_POST[email]' AND password = password('$_POST[password]')";
$result = mysql_query($sql) or die("Error: $sql<BR>".mysql_error());
extract(mysql_fetch_row($result));
print "$company $mail";
rick
People will forget what you said. People will forget what you did.
But people will never forget how you made them feel.
----- Original Message -----
From: "Ben C." <benc
cox.net>
To: <php-general
lists.php.net>
Sent: Tuesday, November 05, 2002 7:09 PM
Subject: [PHP] Using info from a MySQL Query
I am using the following query:
$sql ="SELECT company, name, email FROM $table_name
WHERE email = '$_POST[email]' AND password = password('$_POST[password]')";
Then I am echoing the $email on my form (it works because the person has posted their
e-mail name when logging in). How can I echo the company and email on to my form as well.
Please help.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
$sql = "query" $result = mysql_query($sql)
while ($data = mysqlfetch_array($result)) { echo $data['colum']; }
----- Original Message -----
From: "Ben C." <benc
cox.net>
To: <php-general
lists.php.net>
Sent: Wednesday, November 06, 2002 3:09 AM
Subject: [PHP] Using info from a MySQL Query
> I am using the following query: > > $sql ="SELECT company, name, email FROM $table_name > WHERE email = '$_POST[email]' AND password = password('$_POST[password]')"; > > Then I am echoing the $email on my form (it works because the person has posted their e-mail name when logging in). How can I echo the company and email on to my form as well. Please help. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Sorry, I didn't read correctly the question- There are plenty way to do it for example :
$query = mysql_query($sql) ; $ligne=mysql_fetch_array($query) ; echo $ligne['company'] ; echo $ligne['email'] ;
or echo mysql_result($query,0,1);
----- Original Message -----
From: "rija" <rija
vatu.com>
To: "php" <php-general
lists.php.net>; "Ben C." <benc
cox.net>
Sent: Wednesday, November 06, 2002 1:34 PM
Subject: Re: [PHP] Using info from a MySQL Query
> Put your variables into {} like this '{$_POST['email'] }',
>
> $sql ="SELECT company, name, email FROM $table_name
> WHERE email = '{$_POST[email]}' AND password =
> password('{$_POST[password]}')";
>
> ----- Original Message -----
> From: "Ben C." <benc
cox.net>
> To: <php-general
lists.php.net>
> Sent: Wednesday, November 06, 2002 12:09 PM
> Subject: [PHP] Using info from a MySQL Query
>
>
> > I am using the following query:
> >
> > $sql ="SELECT company, name, email FROM $table_name
> > WHERE email = '$_POST[email]' AND password =
> password('$_POST[password]')";
> >
> > Then I am echoing the $email on my form (it works because the person has
> posted their e-mail name when logging in). How can I echo the company and
> email on to my form as well. Please help.
> >
> >
> > --
> > 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
>
>
attached mail follows:
Can anybody tell me if PHP 4.3.0 will use Zend Engine 2?
Thanks, matt westgate
attached mail follows:
I know this is the wrong mailinglist, but i don't want to subscribe to a second one for one random question.
when trying to enter this into my db:
DROP TABLE IF EXISTS dates; CREATE TABLE dates ( id int(10) unsigned NOT NULL auto_increment, date varchar(50) NOT NULL default '', at varchar(50) NOT NULL default '', where varchar(255) NOT NULL default '', with varchar(255) NOT NULL default '', whereURL varchar(100) NOT NULL default '', info varchar(255) NOT NULL default '', PRIMARY KEY (id) ) TYPE=MyISAM;
(this is generated by phpMyAdmin)
i get this error:
ERROR 1064 at line 18: You have an error in your SQL syntax near 'where varchar(255) NOT NULL default '', with varchar(255) NOT NULL default '',' at line 5
where's the error? i don't see anything wrong..
TIA,
Jule
Jule Slootbeek
jslootbeek
clarku.edu
attached mail follows:
"where" is a reserved keyword in SQL--try changing the name of that column to something else.
Marco
----------- php|architect -- The Monthly Magazine For PHP Professionals Visit us on the web at http://www.phparch.com!
On Tue, 5 Nov 2002, Jule Slootbeek wrote:
> I know this is the wrong mailinglist, but i don't want to subscribe to
> a second one for one random question.
>
> when trying to enter this into my db:
>
> DROP TABLE IF EXISTS dates;
> CREATE TABLE dates (
> id int(10) unsigned NOT NULL auto_increment,
> date varchar(50) NOT NULL default '',
> at varchar(50) NOT NULL default '',
> where varchar(255) NOT NULL default '',
> with varchar(255) NOT NULL default '',
> whereURL varchar(100) NOT NULL default '',
> info varchar(255) NOT NULL default '',
> PRIMARY KEY (id)
> ) TYPE=MyISAM;
>
> (this is generated by phpMyAdmin)
>
> i get this error:
>
> ERROR 1064 at line 18: You have an error in your SQL syntax near 'where
> varchar(255) NOT NULL default '',
> with varchar(255) NOT NULL default '',' at line 5
>
> where's the error?
> i don't see anything wrong..
>
> TIA,
>
> Jule
>
> Jule Slootbeek
> jslootbeek
clarku.edu
>
>
>
attached mail follows:
Ah i see, but then why will phpMyAdmin let me use it? it works fine on my local db with these names, but on my remote server it refuses to create the table.
Jule
On Tuesday, Nov 5, 2002, at 21:47 US/Eastern, Marco Tabini wrote:
> "where" is a reserved keyword in SQL--try changing the name of that
> column to something else.
>
>
> Marco
>
> -----------
> php|architect -- The Monthly Magazine For PHP Professionals
> Visit us on the web at http://www.phparch.com!
>
> On Tue, 5 Nov
> 2002, Jule Slootbeek wrote:
>
>> I know this is the wrong mailinglist, but i don't want to subscribe to
>> a second one for one random question.
>>
>> when trying to enter this into my db:
>>
>> DROP TABLE IF EXISTS dates;
>> CREATE TABLE dates (
>> id int(10) unsigned NOT NULL auto_increment,
>> date varchar(50) NOT NULL default '',
>> at varchar(50) NOT NULL default '',
>> where varchar(255) NOT NULL default '',
>> with varchar(255) NOT NULL default '',
>> whereURL varchar(100) NOT NULL default '',
>> info varchar(255) NOT NULL default '',
>> PRIMARY KEY (id)
>> ) TYPE=MyISAM;
>>
>> (this is generated by phpMyAdmin)
>>
>> i get this error:
>>
>> ERROR 1064 at line 18: You have an error in your SQL syntax near
>> 'where
>> varchar(255) NOT NULL default '',
>> with varchar(255) NOT NULL default '',' at line 5
>>
>> where's the error?
>> i don't see anything wrong..
>>
>> TIA,
>>
>> Jule
>>
>> Jule Slootbeek
>> jslootbeek
clarku.edu
>>
>>
>>
>
>
Jule Slootbeek
jslootbeek
clarku.edu
attached mail follows:
I'm not entirely sure... different configurations perhaps? Have you verified that that's indeed the problem?
Marco
----------- php|architect -- The Monthly Magazine For PHP Professionals Visit us on the web at http://www.phparch.com!
On Tue, 5 Nov 2002, Jule Slootbeek wrote:
> Ah i see, but then why will phpMyAdmin let me use it?
> it works fine on my local db with these names, but on my remote server
> it refuses to create the table.
>
> Jule
>
> On Tuesday, Nov 5, 2002, at 21:47 US/Eastern, Marco Tabini wrote:
>
> > "where" is a reserved keyword in SQL--try changing the name of that
> > column to something else.
> >
> >
> > Marco
> >
> > -----------
> > php|architect -- The Monthly Magazine For PHP Professionals
> > Visit us on the web at http://www.phparch.com!
> >
> > On Tue, 5 Nov
> > 2002, Jule Slootbeek wrote:
> >
> >> I know this is the wrong mailinglist, but i don't want to subscribe to
> >> a second one for one random question.
> >>
> >> when trying to enter this into my db:
> >>
> >> DROP TABLE IF EXISTS dates;
> >> CREATE TABLE dates (
> >> id int(10) unsigned NOT NULL auto_increment,
> >> date varchar(50) NOT NULL default '',
> >> at varchar(50) NOT NULL default '',
> >> where varchar(255) NOT NULL default '',
> >> with varchar(255) NOT NULL default '',
> >> whereURL varchar(100) NOT NULL default '',
> >> info varchar(255) NOT NULL default '',
> >> PRIMARY KEY (id)
> >> ) TYPE=MyISAM;
> >>
> >> (this is generated by phpMyAdmin)
> >>
> >> i get this error:
> >>
> >> ERROR 1064 at line 18: You have an error in your SQL syntax near
> >> 'where
> >> varchar(255) NOT NULL default '',
> >> with varchar(255) NOT NULL default '',' at line 5
> >>
> >> where's the error?
> >> i don't see anything wrong..
> >>
> >> TIA,
> >>
> >> Jule
> >>
> >> Jule Slootbeek
> >> jslootbeek
clarku.edu
> >>
> >>
> >>
> >
> >
> Jule Slootbeek
> jslootbeek
clarku.edu
>
>
>
attached mail follows:
PHPMyAdmin may put tick marks around the name, which will get rid of the error.
`where` varchar(255) not null ...
---John Holmes...
> -----Original Message-----
> From: Jule Slootbeek [mailto:jslootbeek
clarku.edu]
> Sent: Tuesday, November 05, 2002 9:43 PM
> To: Marco Tabini
> Cc: php-general
lists.php.net
> Subject: Re: [PHP] sql error
>
> Ah i see, but then why will phpMyAdmin let me use it?
> it works fine on my local db with these names, but on my remote server
> it refuses to create the table.
>
> Jule
>
> On Tuesday, Nov 5, 2002, at 21:47 US/Eastern, Marco Tabini wrote:
>
> > "where" is a reserved keyword in SQL--try changing the name of that
> > column to something else.
> >
> >
> > Marco
> >
> > -----------
> > php|architect -- The Monthly Magazine For PHP Professionals
> > Visit us on the web at http://www.phparch.com!
> >
> > On Tue, 5 Nov
> > 2002, Jule Slootbeek wrote:
> >
> >> I know this is the wrong mailinglist, but i don't want to subscribe
to
> >> a second one for one random question.
> >>
> >> when trying to enter this into my db:
> >>
> >> DROP TABLE IF EXISTS dates;
> >> CREATE TABLE dates (
> >> id int(10) unsigned NOT NULL auto_increment,
> >> date varchar(50) NOT NULL default '',
> >> at varchar(50) NOT NULL default '',
> >> where varchar(255) NOT NULL default '',
> >> with varchar(255) NOT NULL default '',
> >> whereURL varchar(100) NOT NULL default '',
> >> info varchar(255) NOT NULL default '',
> >> PRIMARY KEY (id)
> >> ) TYPE=MyISAM;
> >>
> >> (this is generated by phpMyAdmin)
> >>
> >> i get this error:
> >>
> >> ERROR 1064 at line 18: You have an error in your SQL syntax near
> >> 'where
> >> varchar(255) NOT NULL default '',
> >> with varchar(255) NOT NULL default '',' at line 5
> >>
> >> where's the error?
> >> i don't see anything wrong..
> >>
> >> TIA,
> >>
> >> Jule
> >>
> >> Jule Slootbeek
> >> jslootbeek
clarku.edu
> >>
> >>
> >>
> >
> >
> Jule Slootbeek
> jslootbeek
clarku.edu
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
apparently 'where' and 'with' are keywords in Java, i've changed them and now it works fine. thanks!
Jule
On Tuesday, Nov 5, 2002, at 21:53 US/Eastern, Marco Tabini wrote:
> I'm not entirely sure... different configurations perhaps? Have you
> verified that that's indeed the problem?
>
> Marco
>
> -----------
> php|architect -- The Monthly Magazine For PHP Professionals
> Visit us on the web at http://www.phparch.com!
>
> On Tue, 5 Nov
> 2002, Jule Slootbeek
> wrote:
>
>> Ah i see, but then why will phpMyAdmin let me use it?
>> it works fine on my local db with these names, but on my remote server
>> it refuses to create the table.
>>
>> Jule
>>
>> On Tuesday, Nov 5, 2002, at 21:47 US/Eastern, Marco Tabini wrote:
>>
>>> "where" is a reserved keyword in SQL--try changing the name of that
>>> column to something else.
>>>
>>>
>>> Marco
>>>
>>> -----------
>>> php|architect -- The Monthly Magazine For PHP Professionals
>>> Visit us on the web at http://www.phparch.com!
>>>
>>> On Tue, 5 Nov
>>> 2002, Jule Slootbeek wrote:
>>>
>>>> I know this is the wrong mailinglist, but i don't want to subscribe
>>>> to
>>>> a second one for one random question.
>>>>
>>>> when trying to enter this into my db:
>>>>
>>>> DROP TABLE IF EXISTS dates;
>>>> CREATE TABLE dates (
>>>> id int(10) unsigned NOT NULL auto_increment,
>>>> date varchar(50) NOT NULL default '',
>>>> at varchar(50) NOT NULL default '',
>>>> where varchar(255) NOT NULL default '',
>>>> with varchar(255) NOT NULL default '',
>>>> whereURL varchar(100) NOT NULL default '',
>>>> info varchar(255) NOT NULL default '',
>>>> PRIMARY KEY (id)
>>>> ) TYPE=MyISAM;
>>>>
>>>> (this is generated by phpMyAdmin)
>>>>
>>>> i get this error:
>>>>
>>>> ERROR 1064 at line 18: You have an error in your SQL syntax near
>>>> 'where
>>>> varchar(255) NOT NULL default '',
>>>> with varchar(255) NOT NULL default '',' at line 5
>>>>
>>>> where's the error?
>>>> i don't see anything wrong..
>>>>
>>>> TIA,
>>>>
>>>> Jule
>>>>
>>>> Jule Slootbeek
>>>> jslootbeek
clarku.edu
>>>>
>>>>
>>>>
>>>
>>>
>> Jule Slootbeek
>> jslootbeek
clarku.edu
>>
>>
>>
>
>
Jule Slootbeek
jslootbeek
clarku.edu
attached mail follows:
possible, but wouldn't phpMyAdmin export the name with the tick marks??
CREATE TABLE foo (`where` varchar(255) NOT NULL);
Jule
On Tuesday, Nov 5, 2002, at 21:51 US/Eastern, John W. Holmes wrote:
> PHPMyAdmin may put tick marks around the name, which will get rid of
> the
> error.
>
> `where` varchar(255) not null ...
>
> ---John Holmes...
>
>> -----Original Message-----
>> From: Jule Slootbeek [mailto:jslootbeek
clarku.edu]
>> Sent: Tuesday, November 05, 2002 9:43 PM
>> To: Marco Tabini
>> Cc: php-general
lists.php.net
>> Subject: Re: [PHP] sql error
>>
>> Ah i see, but then why will phpMyAdmin let me use it?
>> it works fine on my local db with these names, but on my remote server
>> it refuses to create the table.
>>
>> Jule
>>
>> On Tuesday, Nov 5, 2002, at 21:47 US/Eastern, Marco Tabini wrote:
>>
>>> "where" is a reserved keyword in SQL--try changing the name of that
>>> column to something else.
>>>
>>>
>>> Marco
>>>
>>> -----------
>>> php|architect -- The Monthly Magazine For PHP Professionals
>>> Visit us on the web at http://www.phparch.com!
>>>
>>> On Tue, 5 Nov
>>> 2002, Jule Slootbeek wrote:
>>>
>>>> I know this is the wrong mailinglist, but i don't want to subscribe
> to
>>>> a second one for one random question.
>>>>
>>>> when trying to enter this into my db:
>>>>
>>>> DROP TABLE IF EXISTS dates;
>>>> CREATE TABLE dates (
>>>> id int(10) unsigned NOT NULL auto_increment,
>>>> date varchar(50) NOT NULL default '',
>>>> at varchar(50) NOT NULL default '',
>>>> where varchar(255) NOT NULL default '',
>>>> with varchar(255) NOT NULL default '',
>>>> whereURL varchar(100) NOT NULL default '',
>>>> info varchar(255) NOT NULL default '',
>>>> PRIMARY KEY (id)
>>>> ) TYPE=MyISAM;
>>>>
>>>> (this is generated by phpMyAdmin)
>>>>
>>>> i get this error:
>>>>
>>>> ERROR 1064 at line 18: You have an error in your SQL syntax near
>>>> 'where
>>>> varchar(255) NOT NULL default '',
>>>> with varchar(255) NOT NULL default '',' at line 5
>>>>
>>>> where's the error?
>>>> i don't see anything wrong..
>>>>
>>>> TIA,
>>>>
>>>> Jule
>>>>
>>>> Jule Slootbeek
>>>> jslootbeek
clarku.edu
>>>>
>>>>
>>>>
>>>
>>>
>> Jule Slootbeek
>> jslootbeek
clarku.edu
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
Jule Slootbeek
jslootbeek
clarku.edu
attached mail follows:
did I say Java? oops, i meant SQL....learning Java in my comp sci class..(= forgive me.
Jule
On Tuesday, Nov 5, 2002, at 21:54 US/Eastern, Martin Towell wrote:
> "where" is a java keyword ? have you got an example ?
> It's been _ages_ since I've done any code in java :(
>
> -----Original Message-----
> From: Jule Slootbeek [mailto:jslootbeek
clarku.edu]
> Sent: Wednesday, November 06, 2002 1:52 PM
> To: Marco Tabini
> Cc: php-general
lists.php.net
> Subject: Re: [PHP] sql error
>
>
> apparently 'where' and 'with' are keywords in Java, i've changed them
> and now it works fine.
> thanks!
>
> Jule
>
> On Tuesday, Nov 5, 2002, at 21:53 US/Eastern, Marco Tabini wrote:
>
>> I'm not entirely sure... different configurations perhaps? Have you
>> verified that that's indeed the problem?
>>
>> Marco
>>
>> -----------
>> php|architect -- The Monthly Magazine For PHP Professionals
>> Visit us on the web at http://www.phparch.com!
>>
>> On Tue, 5 Nov
>> 2002, Jule Slootbeek
>> wrote:
>>
>>> Ah i see, but then why will phpMyAdmin let me use it?
>>> it works fine on my local db with these names, but on my remote
>>> server
>>> it refuses to create the table.
>>>
>>> Jule
>>>
>>> On Tuesday, Nov 5, 2002, at 21:47 US/Eastern, Marco Tabini wrote:
>>>
>>>> "where" is a reserved keyword in SQL--try changing the name of that
>>>> column to something else.
>>>>
>>>>
>>>> Marco
>>>>
>>>> -----------
>>>> php|architect -- The Monthly Magazine For PHP Professionals
>>>> Visit us on the web at http://www.phparch.com!
>>>>
>>>> On Tue, 5 Nov
>>>> 2002, Jule Slootbeek wrote:
>>>>
>>>>> I know this is the wrong mailinglist, but i don't want to subscribe
>>>>> to
>>>>> a second one for one random question.
>>>>>
>>>>> when trying to enter this into my db:
>>>>>
>>>>> DROP TABLE IF EXISTS dates;
>>>>> CREATE TABLE dates (
>>>>> id int(10) unsigned NOT NULL auto_increment,
>>>>> date varchar(50) NOT NULL default '',
>>>>> at varchar(50) NOT NULL default '',
>>>>> where varchar(255) NOT NULL default '',
>>>>> with varchar(255) NOT NULL default '',
>>>>> whereURL varchar(100) NOT NULL default '',
>>>>> info varchar(255) NOT NULL default '',
>>>>> PRIMARY KEY (id)
>>>>> ) TYPE=MyISAM;
>>>>>
>>>>> (this is generated by phpMyAdmin)
>>>>>
>>>>> i get this error:
>>>>>
>>>>> ERROR 1064 at line 18: You have an error in your SQL syntax near
>>>>> 'where
>>>>> varchar(255) NOT NULL default '',
>>>>> with varchar(255) NOT NULL default '',' at line 5
>>>>>
>>>>> where's the error?
>>>>> i don't see anything wrong..
>>>>>
>>>>> TIA,
>>>>>
>>>>> Jule
>>>>>
>>>>> Jule Slootbeek
>>>>> jslootbeek
clarku.edu
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>> Jule Slootbeek
>>> jslootbeek
clarku.edu
>>>
>>>
>>>
>>
>>
> Jule Slootbeek
> jslootbeek
clarku.edu
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Jule Slootbeek
jslootbeek
clarku.edu
attached mail follows:
"Karl James" <karl.james
verizon.net> disgorged:
: What the hell is XML anyway?
====
eXtensible Markup Language http://www.w3.org/XML/
attached mail follows:
On Tuesday 05 November 2002 22:45, Karl James wrote: > What the hell is XML anyway?
What the hell are search engines for?
google > "What the hell is XML anyway"
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* Cats are intended to teach us that not everything in nature has a function. -- Garrison Keillor */
attached mail follows:
i have a problem with the dropdown list when proccesing with javascript, the name of the dropdown list is "select02[]", this because to that i need it passed in php a array of the selecteds item, for example : $form[select02][$i],..but i wish to fill the dropdown list from javascript and later submit, but it is not function, i suppose that the name of the dropdown list is not valid name for javascript.
anybody can help me?
the function of javascript:
function one2two(m1,m2) { m1text = m1.value; if (m1text != "" ) { m2len = m2.length; m2.options[m2len]= new Option(m1text); m2.options[m2len].value = m1text; m1.value = ""; }
----------------------------------------------------------- the form with the events:
<form name="entryform" enctype="multipart/form-data" method="post" action="/ayni2/admin2/producto.php">
<select name="select02[]" size="5" multiple></select> <input type="text" name="text01"> <input name="button" type="button" onClick="one2two(text01, select02[])" value=" insertar "> <input type="button" onClick="borrar(select02)" value=" borrar "> -----------------------------------------------------------------
attached mail follows:
you can refer to form elements by: document.forms["formname"].elements["elementname"] so you could use: document.forms["entryform"].elements["select02[]"]
-----Original Message-----
From: Mack [mailto:mplescano2000
yahoo.com]
Sent: Tuesday, November 05, 2002 12:30 AM
To: php-general
lists.php.net
Subject: [PHP] problem of javascript with dropdown list of array.
i have a problem with the dropdown list when proccesing with javascript, the name of the dropdown list is "select02[]", this because to that i need it passed in php a array of the selecteds item, for example : $form[select02][$i],..but i wish to fill the dropdown list from javascript and later submit, but it is not function, i suppose that the name of the dropdown list is not valid name for javascript.
anybody can help me?
the function of javascript:
function one2two(m1,m2) { m1text = m1.value; if (m1text != "" ) { m2len = m2.length; m2.options[m2len]= new Option(m1text); m2.options[m2len].value = m1text; m1.value = ""; }
----------------------------------------------------------- the form with the events:
<form name="entryform" enctype="multipart/form-data" method="post" action="/ayni2/admin2/producto.php">
<select name="select02[]" size="5" multiple></select> <input type="text" name="text01"> <input name="button" type="button" onClick="one2two(text01, select02[])" value=" insertar "> <input type="button" onClick="borrar(select02)" value=" borrar "> -----------------------------------------------------------------
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I think you have to refer to it as document.form.element[0], element[1], etc, based on the element number of your select box.
Anyway, ask on a Javascript list for more information.
---John Holmes...
> -----Original Message-----
> From: Mack [mailto:mplescano2000
yahoo.com]
> Sent: Monday, November 04, 2002 8:30 AM
> To: php-general
lists.php.net
> Subject: [PHP] problem of javascript with dropdown list of array.
>
>
>
> i have a problem with the dropdown list when proccesing with
javascript,
> the
> name of the dropdown list is "select02[]", this because to that i need
it
> passed in php a array of the selecteds item, for example :
> $form[select02][$i],..but i wish to fill the dropdown list from
> javascript and later submit, but it is not function, i suppose that
the
> name
> of the dropdown list is not valid name for javascript.
>
> anybody can help me?
>
> the function of javascript:
>
> function one2two(m1,m2) {
> m1text = m1.value;
> if (m1text != "" ) {
> m2len = m2.length;
> m2.options[m2len]= new Option(m1text);
> m2.options[m2len].value = m1text;
> m1.value = "";
> }
>
>
>
> -----------------------------------------------------------
> the form with the events:
>
> <form name="entryform" enctype="multipart/form-data" method="post"
> action="/ayni2/admin2/producto.php">
>
> <select name="select02[]" size="5" multiple></select>
> <input type="text" name="text01">
> <input name="button" type="button" onClick="one2two(text01,
select02[])"
> value=" insertar ">
> <input type="button" onClick="borrar(select02)" value=" borrar ">
> -----------------------------------------------------------------
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
i have a problem with the dropdown list when proccesing with javascript, the name of the dropdown list is "select02[]", this because to that i need it passed in php a array of the selecteds item, for example : $form[select02][$i],..but i wish to fill the dropdown list from javascript and later submit, but it is not function, i suppose that the name of the dropdown list is not valid name for javascript.
anybody can help me?
the function of javascript:
function one2two(m1,m2) { m1text = m1.value; if (m1text != "" ) { m2len = m2.length; m2.options[m2len]= new Option(m1text); m2.options[m2len].value = m1text; m1.value = ""; }
----------------------------------------------------------- the form with the events:
<form name="entryform" enctype="multipart/form-data" method="post" action="/ayni2/admin2/producto.php">
<select name="select02[]" size="5" multiple></select> <input type="text" name="text01"> <input name="button" type="button" onClick="one2two(text01, select02)" value=" insertar "> <input type="button" onClick="borrar(select02)" value=" borrar ">
attached mail follows:
On Monday 04 November 2002 21:29, Mack wrote: > > ----------------------------------------------------------- > the form with the events: > > <form name="entryform" enctype="multipart/form-data" method="post" > action="/ayni2/admin2/producto.php"> > > <select name="select02[]" size="5" multiple></select> > <input type="text" name="text01"> > <input name="button" type="button" onClick="one2two(text01, select02[])"
Try using:
onClick="one2two(text01, document.entryform.elements['select02[]'])"
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* A man who carries a cat by its tail learns something he can learn in no other way. */
attached mail follows:
Has anyone used imagerotate() function? I am curious as to how exactly it is being used. I currently use a rather large custom function to rotate my images...
Thanks, Jacob
attached mail follows:
Hello,
I am having two list box of which one contains the year no and the another one contains the items related to that year..If once i have selected that year then whatever i have selected in the list it have to show the items related to that year until i select the next year..Can anyone please tell me how to do this with sessions..??
Regards, Uma
attached mail follows:
> I am having two list box of which one contains the year no and the > another one contains the items related to that year..If once i have > selected that year then whatever i have selected in the list it have to > show the items related to that year until i select the next year..Can > anyone please tell me how to do this with sessions..??
SESSIONs have nothing to do with it, this is a javascript issue, unless you plan on submitting the form when the user picks the year.
---John Holmes...
attached mail follows:
JWH>SESSIONs have nothing to do with it, this is a javascript issue, unless JWH>you plan on submitting the form when the user picks the year.
Okay if it is like form submittion Can you please tell me how to do that..??
Regards, Uma
attached mail follows:
> JWH>SESSIONs have nothing to do with it, this is a javascript issue, > unless > JWH>you plan on submitting the form when the user picks the year. > > > Okay if it is like form submittion Can you please tell me how to do > that..??
What do you have so far? I'm not writing this for you, it's a simple HTML form. You provide a drop down for the year, the user chooses a year and hits Go. You then use the value they chose in the query or whatever to create the second dropdown.
---John Holmes...
attached mail follows:
Hello,
I have tried session handling..after starting the session i am trying to get the value by this command
session_start(); echo $varname;
but it is displaying this error..
Warning: Cannot send session cookie - headers already sent by (output started
Can anyone tell me how to go about with this ??
Regards, Uma
attached mail follows:
You must call session_start before any output to the browser. A blank line or space outside of PHP blocks is considered output. The error message tells you exactly where the output started. Read the manual for more information, it's all covered.
---John Holmes...
> -----Original Message-----
> From: Uma Shankari T. [mailto:umashankari
lantana.tenet.res.in]
> Sent: Wednesday, November 06, 2002 6:59 AM
> To: PHP
> Subject: [PHP] Session Handling
>
>
>
> Hello,
>
> I have tried session handling..after starting the session i am
trying to
> get the value by this command
>
> session_start();
> echo $varname;
>
> but it is displaying this error..
>
> Warning: Cannot send session cookie - headers already sent by (output
> started
>
> Can anyone tell me how to go about with this ??
>
>
> Regards,
> Uma
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I know this can be a little out of topic but:
I have a books database and each book belongs to a publisher. There is also a publisher database with information like (name, location, etc). In the books database there is a key to identify the publisher.
I need a mySQL query for showing each book with each publisher name and location.
I don't want to do it using nested loops in .php because I think that using a "master" SQL query that can access both tables (all inside mySQL) and their relations can be much faster.
Thanks
attached mail follows:
Well, if both tables are in the same database:
select * from books inner join publishers on books.publisherid = publishers.publisherid
this assumes that the key for the publisher is publisherid and that publisherid also appears in the book table.
This gives you a result set that contains the appropriate information from both tables merged.
Marco
----------- php|architect -- The Monthly Magazine For PHP Professionals Visit us on the web at http://www.phparch.com!
On Wed, 6 Nov 2002, Edgard Berendsen wrote:
> I know this can be a little out of topic but: > > I have a books database and each book belongs to a publisher. > There is also a publisher database with information like (name, > location, etc). In the books database there is a key to identify the > publisher. > > I need a mySQL query for showing each book with each publisher > name and location. > > I don't want to do it using nested loops in .php because I think that > using a "master" SQL query that can access both tables (all inside mySQL) > and their relations can be much faster. > > Thanks > > > > >
attached mail follows:
Hi,
I'm developing a php application to display and print discount coupons, with a barcode in them, my problem is the server where php is, doesn't have gd compiled with the ttf option it does have the t1, this is the first time I'm developing this kind of application using php and I'm not sure which font I should upload to the server (it must be free) and if there is one.
BTW this application will run under PostNuke CMS.
Thanks
Rick
attached mail follows:
This might be an overly simple solution for your needs (depending on which kind of barcodes you need), but you can cheat with this:
http://www.barcodesinc.com/generator/index.php
Hope it helps.
Marco
----------- php|architect -- The Monthly Magazine For PHP Professionals Visit us on the web at http://www.phparch.com!
On Wed, 6 Nov 2002, Ricardo Fitzgerald wrote:
> Hi, > > I'm developing a php application to display and print discount coupons, with > a barcode in them, my problem is the server where php is, doesn't have gd > compiled with the ttf option it does have the t1, this is the first time I'm > developing this kind of application using php and I'm not sure which font I > should upload to the server (it must be free) and if there is one. > > BTW this application will run under PostNuke CMS. > > Thanks > > Rick > > > >
attached mail follows:
Hello,
On 11/06/2002 01:49 AM, Ricardo Fitzgerald wrote: > I'm developing a php application to display and print discount coupons, with > a barcode in them, my problem is the server where php is, doesn't have gd > compiled with the ttf option it does have the t1, this is the first time I'm > developing this kind of application using php and I'm not sure which font I > should upload to the server (it must be free) and if there is one.
Maybe any of these classes can solve your problem:
http://www.phpclasses.org/barcode128
http://www.phpclasses.org/barcode
--Regards, Manuel Lemos
attached mail follows:
Hi Guy and Gay ?
I have the following code supposed to transform date format like this 04 desambra 1975 into 1975-12-04. User can use whatever language he want like french, english, malagasy even Bichlamar- for example : 04, otis 1975 = 04 aout 1975 = 04 aogositra 1975 = 04-août 1975 = 04 august 1975 = 04 aug 1975 and the function must return 1975-08-04
It work perfectly and I'm really happy while I don't use minus (-) and If I use it, the function stop working.
So how can I use minus in the regular expression ?
function my_date($birthday) {
$birthday = strtolower($birthday) ; $array_search2 = array( "'[âäàåÄÅáæÆ]'i", "'[éêëèÉ]'i", "'[üûùÜú]'i", "'[ïîìí]'i", "'[ôöòÖó]'i") ; $array_replace2 = array("a", "e", "u", "i", "o") ; $array_search = array("'jan[a-zA-Z]{0,10}'i", "'fe[vb]{1}[a-zA-Z]{0,10}'i", "'m[a]{1,2}r[a-zA-Z]{0,10}'i", "'a[vp]{1}r[a-zA-Z]{0,10}'i", "'ma[iy]{1}[a-zA-Z]{0,10}'i", "'j[ou]{1}n[a-zA-Z]{0,10}'i", "'j[uo]{1}l[a-zA-Z]{0,10}'i", "'[ao]{1}[out]{1}[a-zA-Z]{0,10}'i", "'sept[a-zA-Z]{0,10}'i", "'o[ck]{1}t[a-zA-Z]{0,10}'i", "'n[o]{1,2}v[a-zA-Z]{0,10}'i", "'de[sc]{1}[a-zA-Z]{0,10}'i" ) ;
$array_replace = array( "01", "02", "03", "04", "05", "06", "07","08","09","10", "11", "12" ) ; $birthday = preg_replace($array_search2, $array_replace2, $birthday) ; $birthday = eregi_replace("([0-9]{1,2})[\-_:\|/, ]+([a-zA-Z0-9]{1,})[\-_:\|/, ]+([0-9]{2,4})","\\3-\\2-\\1", $birthday) ; $birthday = preg_replace($array_search, $array_replace, $birthday) ; return $birthday ; }
echo my_date("12, janoary- 2001") ; // return 12, 01- 2001 (bad)
and echo my_date("12, januaari,\\__ 2001") ;
return exactly what I want ie 2001-01-12
attached mail follows:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I'm trying to get XSLT working with PHP, and after slowly working my way through several other problems, I've found one that I can't figure out.
Software: PHP 4.2.3 Apache 1.3.27 Sablotron 0.96 GCC 3.2 Linux 2.4.19-lsm1
./configure \ - --enable-xml \ - --enable-xslt \ - --enable-ftp \ - --enable-sockets \ - --enable-pcntl \ - --with-apxs=/usr/local/apache/bin/apxs \ - --with-xslt-sablot && \ make && \ sudo make install
Everything seems to work fine (except for a lot of "cc1: warning: changing search order for system directory "/usr/local/include" cc1: warning: as it has already been specified as a non-system directory" 's that appear when using gcc-3.2), but when I try to /usr/local/apache/bin/apachectl restart, I get this:
Syntax error on line 205 of /usr/local/apache/conf/httpd.conf: Cannot load /usr/local/apache/libexec/libphp4.so into server: /usr/local/lib/libsablot.so.0: undefined symbol: __gxx_personality_v0 /usr/local/apache/bin/apachectl start: httpd could not be started
Any ideas??? -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQE9yJ/J/rncFku1MdIRAkhnAKClykcWMUwiWbslAYklx3xm1qsjSQCdFAXh roJ+kMyayqdY1UXxL6S5xuQ= =1Zaw -----END PGP SIGNATURE-----
attached mail follows:
Try specifying the sablot installation directory in the configuration
--with-xslt-sablot=/some/dir
On Wed, 2002-11-06 at 04:50, Evan Nemerson wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > I'm trying to get XSLT working with PHP, and after slowly working my way > through several other problems, I've found one that I can't figure out. > > Software: > PHP 4.2.3 > Apache 1.3.27 > Sablotron 0.96 > GCC 3.2 > Linux 2.4.19-lsm1 > > ./configure \ > - --enable-xml \ > - --enable-xslt \ > - --enable-ftp \ > - --enable-sockets \ > - --enable-pcntl \ > - --with-apxs=/usr/local/apache/bin/apxs \ > - --with-xslt-sablot && \ > make && \ > sudo make install > > Everything seems to work fine (except for a lot of > "cc1: warning: changing search order for system directory "/usr/local/include" > cc1: warning: as it has already been specified as a non-system directory" > 's that appear when using gcc-3.2), but when I try to > /usr/local/apache/bin/apachectl restart, I get this: > > Syntax error on line 205 of /usr/local/apache/conf/httpd.conf: > Cannot load /usr/local/apache/libexec/libphp4.so into server: > /usr/local/lib/libsablot.so.0: undefined symbol: __gxx_personality_v0 > /usr/local/apache/bin/apachectl start: httpd could not be started > > Any ideas??? > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.0.7 (GNU/Linux) > > iD8DBQE9yJ/J/rncFku1MdIRAkhnAKClykcWMUwiWbslAYklx3xm1qsjSQCdFAXh > roJ+kMyayqdY1UXxL6S5xuQ= > =1Zaw > -----END PGP SIGNATURE----- > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php
-- .: B i g D o g :.
attached mail follows:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Nope. Same error. Good idea, though...
- -Evan
On Tuesday 05 November 2002 01:56 pm, .: B i g D o g :. wrote: > Try specifying the sablot installation directory in the configuration > > --with-xslt-sablot=/some/dir > > On Wed, 2002-11-06 at 04:50, Evan Nemerson wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > > Hash: SHA1 > > > > I'm trying to get XSLT working with PHP, and after slowly working my way > > through several other problems, I've found one that I can't figure out. > > > > Software: > > PHP 4.2.3 > > Apache 1.3.27 > > Sablotron 0.96 > > GCC 3.2 > > Linux 2.4.19-lsm1 > > > > ./configure \ > > - --enable-xml \ > > - --enable-xslt \ > > - --enable-ftp \ > > - --enable-sockets \ > > - --enable-pcntl \ > > - --with-apxs=/usr/local/apache/bin/apxs \ > > - --with-xslt-sablot && \ > > make && \ > > sudo make install > > > > Everything seems to work fine (except for a lot of > > "cc1: warning: changing search order for system directory > > "/usr/local/include" cc1: warning: as it has already been specified as > > a non-system directory" 's that appear when using gcc-3.2), but when I > > try to > > /usr/local/apache/bin/apachectl restart, I get this: > > > > Syntax error on line 205 of /usr/local/apache/conf/httpd.conf: > > Cannot load /usr/local/apache/libexec/libphp4.so into server: > > /usr/local/lib/libsablot.so.0: undefined symbol: __gxx_personality_v0 > > /usr/local/apache/bin/apachectl start: httpd could not be started > > > > Any ideas??? > > -----BEGIN PGP SIGNATURE----- > > Version: GnuPG v1.0.7 (GNU/Linux) > > > > iD8DBQE9yJ/J/rncFku1MdIRAkhnAKClykcWMUwiWbslAYklx3xm1qsjSQCdFAXh > > roJ+kMyayqdY1UXxL6S5xuQ= > > =1Zaw > > -----END PGP SIGNATURE----- > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php
- -- I contend that we are both atheists. I just believe in one fewer god than you do. When you understand why you dismiss all the other possible gods, you will understand why I dismiss yours.
- -Stephen Roberts -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQE9yLD7/rncFku1MdIRAu9EAJwI0UUESRB4J0XOvcuENNIgITojcACfdqiF pI5whvgtCWXuYGisHuJqin4= =a46S -----END PGP SIGNATURE-----
attached mail follows:
Does anyone know of a nice efficient way to convert an array of values into a "mask"...
Here's the deal. Given an array such that:
$purchitem[0] = 1; $purchitem[1] = 3; $purchitem[2] = 4;
I want to end up with a variable like this:
$mask = "10110";
Additionally, my theory is that then the person purchases another book later
$purchitem[0] = 2;
My new mask should be $purchmask = "01000";
Then I can load their previous mask from the database and boolean OR it with the new mask to set the correct permissions. i.e.
$newmask = $mask | $purchmask;
Or ideally = "11110"
Can I boolean OR strings like that in the way I 'hope' it will work? Do I need to convert it to an intermediate stage or cast it or anything?
Does this make sense? It's for an online book shopping cart. I have the reverse working, where I can split the mask into what books. And I also have the $purchitem[] working.
attached mail follows:
Why don't you ask Jim Carrey ??? He knew more that whoever here about "The MASK" !!!
Good luck.
----- Original Message -----
From: "Daevid Vincent" <daevid
daevid.com>
To: <php-general
lists.php.net>
Sent: Wednesday, November 06, 2002 3:56 PM
Subject: [PHP] How do I convert an array into a mask?
> Does anyone know of a nice efficient way to convert an array of values > into a "mask"... > > Here's the deal. Given an array such that: > > $purchitem[0] = 1; > $purchitem[1] = 3; > $purchitem[2] = 4; > > I want to end up with a variable like this: > > $mask = "10110"; > > Additionally, my theory is that then the person purchases another book > later > > $purchitem[0] = 2; > > My new mask should be $purchmask = "01000"; > > Then I can load their previous mask from the database and boolean OR it > with the new mask to set the correct permissions. i.e. > > $newmask = $mask | $purchmask; > > Or ideally = "11110" > > Can I boolean OR strings like that in the way I 'hope' it will work? Do > I need to convert it to an intermediate stage or cast it or anything? > > Does this make sense? It's for an online book shopping cart. I have the > reverse working, where I can split the mask into what books. And I also > have the $purchitem[] working. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
On Tue, 5 Nov 2002 20:56:33 -0800, you wrote:
>Does anyone know of a nice efficient way to convert an array of values >into a "mask"...
I'm going to assume that you mean a bitmask. I'm not exactly sure what you're trying to accomplish, so I may be off base here, but let me describe how I'm using bitmasks in one of my applications:
I assist in development of a real estate web site where end users can enter search criteria and get a list of properties. One of the search criteria is listing type (as in residential, land, etc.). In the search form we allow people to search for multiple listing types. There are six types altogether, and the user could select none of them, all of them, or any combination in between. For reasons I won't bother to go into here, I needed to represent these choices in the most efficient way possible so I could pass the data as one value in a query string. Rather than pass the choices as an array, I generate a bitmask of the selection and then use PHP's bitwise operators to reconstruct the array when I need to (more on this below).
>Then I can load their previous mask from the database and boolean OR it >with the new mask to set the correct permissions. i.e. > >$newmask = $mask | $purchmask;
That's not a boolean OR. Boolean OR is '||', what you're talking about is a bitwise OR:
http://www.php.net/manual/en/language.operators.bitwise.php
This is how I do it. First of all I define an array in a config file that enumerates all of my listing types. I then assign integer values to each type:
$listingTypes = array( 'Residential/Single Family' => 1, 'Lots, Land & Farm' => 2, 'Commercial Land' => 4, 'Commercial/Industrial' => 8, 'Condos/Townhouses' => 16, 'Multi-Family' => 32 );
To construct the bitmask value, I take the integer values of each type that is selected and I add them together to get a bitmask value. For example, if someone chooses both "Commercial Land" and "Commercial/Industrial", the bitmask value is 12.
After I have this value I can retrieve the individual types by looping through the listing type array and doing a bitwise AND with the bitmask. If the result is true (i.e. 1) then I know that particular listing type was selected:
foreach ($listingTypes as $listingType => $bit) { if ($bit & $listingTypeBitmask) { echo "$listingType was selected."; } }
Basically I never deal with the actual binary values...I store and manipulate everything in decimal, and let PHP do the work using the bitwise operators. BTW, I got the this idea from the way that PHP's error reporting level is configured...each error type (such as E_USER_NOTICE, etc.) has an integer equivalent and PHP tracks which error types are to be reported as a bitmask, similar to the above...
I know this probably isn't quite what you're trying to accomplish, but maybe it can help give you some ideas...
HTH
attached mail follows:
Michael, I like your idea, and had I designed this site, I would have the bitmask simmilar to what you suggest. However, I'm a contractor modding an existing/legacy site. Basically the way they have it, is that each user has a field in the db that is simply a string/mask of which books a person has access to see. So given the example below, "10110" means that the person can view books 1, 3, and 4, but not 2 or 5. dig?
Now, I can brute force this, since there are only a few books. That doesn't lend itself nicely to expansion, but may be my only way. I just have a gut feeling that it can be automated somehow. To turn 1,3,4 into 10110 seems like there is some 'math' there that can work. I also thought there might be a built in PHP function that may point me in the right direction. I'll post my solution when I get it working if it's elegant...
Thanks anyways.
P.s. thanks for the correction on boolean vs bitwise OR. Duh. I should have known that ;-)
> -----Original Message----- > Does anyone know of a nice efficient way to convert an array > of values into a "mask"... > > Here's the deal. Given an array such that: > > $purchitem[0] = 1; > $purchitem[1] = 3; > $purchitem[2] = 4; > > I want to end up with a variable like this: > > $mask = "10110"; > > Additionally, my theory is that then the person purchases > another book later > > $purchitem[0] = 2; > > My new mask should be $purchmask = "01000"; > > Then I can load their previous mask from the database and > bitwise OR it with the new mask to set the correct permissions. i.e. > > $newmask = $mask | $purchmask; > > Or ideally = "11110" > > Can I boolean OR strings like that in the way I 'hope' it > will work? Do I need to convert it to an intermediate stage > or cast it or anything? > > Does this make sense? It's for an online book shopping cart. > I have the reverse working, where I can split the mask into > what books. And I also have the $purchitem[] working.
attached mail follows:
At 10:18 06.11.2002, Daevid Vincent said: --------------------[snip]-------------------- >doesn't lend itself nicely to expansion, but may be my only way. I just >have a gut feeling that it can be automated somehow. To turn 1,3,4 into >10110 seems like there is some 'math' there that can work. I also --------------------[snip]--------------------
It's quite easy using the left-shift operator "<<". Note that the function below only works for values 1-31 on 32bit systems.
<?php
function makebits(&$array) { $result = 0; foreach ($array as $seq) { if (is_numeric($seq)) { $i = 1 << ($seq-1); // assuming ID's are 1-based $result += $i; } } return $result; }
$a = array(1,3,5,9); // 1 0001 0101 = 0x115 echo '<xmp>', sprintf('0x%x', makebits($a)), "\n</xmp>";
?>
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
attached mail follows:
> So given the example below, "10110" > means that the person can view books 1, 3, and 4, but not 2 or 5. dig?
Explain that to me... I know binary, but I can't see how that equates to 1, 3, and 4.
---John Holmes...
attached mail follows:
Hi John,
> > So given the example below, "10110" > > means that the person can view books 1, 3, and 4, > > but not 2 or 5. dig? > > Explain that to me... I know binary, but I can't see > how that equates to 1, 3, and 4.
Because you know binary :-)
The above is a series of yes/no flags, not a binary number. Reading from left to right:
book 1 : yes book 2 : no book 3 : yes book 4 : yes book 5 : no
Cheers Jon
attached mail follows:
> Hi John, > > > > So given the example below, "10110" > > > means that the person can view books 1, 3, and 4, > > > but not 2 or 5. dig? > > > > Explain that to me... I know binary, but I can't see > > how that equates to 1, 3, and 4. > > Because you know binary :-) > > The above is a series of yes/no flags, not a binary number. Reading from > left to right: > > book 1 : yes > book 2 : no > book 3 : yes > book 4 : yes > book 5 : no > > Cheers > Jon
Ok, so knowing binary and now knowing that, :)
Couldn't you just treat the number as a string and tear it apart to see what permissions the user has?
<?
$var = "10110";
$l = strlen($var);
for($x=0;$x<$l;$x++) { if($var{$x}) { echo "Permission for book $x is good<br>\n"; } else { echo "Permission for book $x is bad<br>\n"; } }
?>
---John Holmes...
attached mail follows:
That's the EASY part John!
The hard part is converting the array (which was a checkbox array from a form submission) into the binary string (as per the original post)
> Here's the deal. Given an array such that: > $purchitem[0] = 1; //purchased book #1 checkbox enabled > $purchitem[1] = 3; //purchased book #3 checkbox enabled > $purchitem[2] = 4; //purchased book #4 checkbox enabled > I want to end up with a variable like this: > $mask = "10110";
Get it now? ;-)
> -----Original Message-----
> From: John W. Holmes [mailto:holmes072000
charter.net]
> Sent: Wednesday, November 06, 2002 4:19 AM
> To: 'Jon Haworth'; php-general
lists.php.net
> Subject: RE: [PHP] How do I convert an array into a mask?
>
>
> > Hi John,
> >
> > > > So given the example below, "10110"
> > > > means that the person can view books 1, 3, and 4,
> > > > but not 2 or 5. dig?
> > >
> > > Explain that to me... I know binary, but I can't see
> > > how that equates to 1, 3, and 4.
> >
> > Because you know binary :-)
> >
> > The above is a series of yes/no flags, not a binary number. Reading
> from
> > left to right:
> >
> > book 1 : yes
> > book 2 : no
> > book 3 : yes
> > book 4 : yes
> > book 5 : no
> >
> > Cheers
> > Jon
>
> Ok, so knowing binary and now knowing that, :)
>
> Couldn't you just treat the number as a string and tear it
> apart to see what permissions the user has?
>
> <?
>
> $var = "10110";
>
> $l = strlen($var);
>
> for($x=0;$x<$l;$x++)
> {
> if($var{$x})
> { echo "Permission for book $x is good<br>\n"; }
> else
> { echo "Permission for book $x is bad<br>\n"; }
> }
>
> ?>
attached mail follows:
> That's the EASY part John! > > The hard part is converting the array (which was a checkbox array from a > form submission) into the binary string (as per the original post) > > > Here's the deal. Given an array such that: > > $purchitem[0] = 1; //purchased book #1 checkbox enabled > > $purchitem[1] = 3; //purchased book #3 checkbox enabled > > $purchitem[2] = 4; //purchased book #4 checkbox enabled > > I want to end up with a variable like this: > > $mask = "10110"; > > Get it now? ;-)
Got it...
Are there always going to be X digits in the code? If so, this would work.
<? $purchitem[0] = 1; $purchitem[1] = 3; $purchitem[2] = 4;
$mask = ''; $length = 5; $y = 0;
for($x=1;$x<$length+1;$x++)
{
if(
$purchitem[$y] == $x)
{
$mask .= '1';
$y++;
}
else
{ $mask .= '0'; }
}
echo $mask;
?>
---John Holmes...
attached mail follows:
On Wednesday 06 November 2002 08:48, Justin French wrote: > Doesn't 'global' only get variables from outside the function into it???? > OP (I think) wanted the variables within the function to work outside it.
Kind of. What it really does is 'link' the global'ed variable into the global scope. Thus whatever you do to the global'ed variable inside the function is equivalent to as if it had been done outside of the function.
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* Me no internet, only janitor, me just wax floors. */
attached mail follows:
Another idea of doing this task is using XSLT. XML file can be tranformed to a text SQL file, then it can be called by PHP scripts. That can't be hard to do that if you know XSLT.
"Bernardo De Barros Franco" <bfranco
qwc.com.br> wrote in message
news:20021105203656.93604.qmail
pb1.pair.com...
> Hello PHP users,
>
> I've recently tried to find info about creating databases from XML files
and
> didn't find anything. Since there is no php.XML I'm posting it in the
> general section.
> Does anyone know where I can find PHP source code that will parse an XML
> file and generate SQL queries that would create tables based on the
> structure described on the XML?
> Something like:
> xml = "
> <Database name='db1'>
> <Table name='Table1'>
> <Attribute name='foo1' type='int4' />
> </Table>
> </Database>
> ";
> and some function func(xml) would return a set of SQL queries that would
> create that database in a particular DB (say PostgreSQL or MySQL).
> Anything similar would help already.
>
> Thanks in advance,
> Bernardo de Barros Franco
>
>
attached mail follows:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
The right way to properly code: php.net/basic-syntax
The right way to properly use superfluously excessive pleonastic repetitive tautological redundancies: thesaurus.com
Sorry... couldn't resist.
On Tuesday 05 November 2002 06:48 am, Karl James wrote: > Hey people > > Where is there a good place to learn > How and what the ( ) means and what to put in qoautes > Basically the right way to properly code? > > Karl
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQE9yLaw/rncFku1MdIRAmCIAJ9RtkJWfItbdt1wa1oegSY0lJmx4QCeJNul eCEaZxC1MizYE48vSEw4T0w= =lpKo -----END PGP SIGNATURE-----
attached mail follows:
I had the same problems with 4.2.3. I was able to successfully compile 4.3.0-pre1 with little problems.
Dale
On 11/4/02 4:12 PM, "Kristopher Yates" <kris
grinz.com> wrote:
> Hello, > > I'm trying to compile PHP4.2.3 for Mac OSX 10.2 (Jaguar). Has anyone > else had this problem (see below)? > > > ./configure --with-apxs=/usr/sbin/apxs > make > > ld: multiple definitions of symbol _virtual_stat > TSRM/.libs/libtsrm.al(tsrm_virtual_cwd.lo) definition of _virtual_stat > in sectio > n (__TEXT,__text) > TSRM/.libs/libtsrm.al(tsrm_virtual_cwd.lo) definition of _virtual_stat > in sectio > n (__TEXT,__text) > ld: multiple definitions of symbol _virtual_unlink > TSRM/.libs/libtsrm.al(tsrm_virtual_cwd.lo) definition of _virtual_unlink > in sect > ion (__TEXT,__text) > TSRM/.libs/libtsrm.al(tsrm_virtual_cwd.lo) definition of _virtual_unlink > in sect > ion (__TEXT,__text) > ld: multiple definitions of symbol _virtual_utime > TSRM/.libs/libtsrm.al(tsrm_virtual_cwd.lo) definition of _virtual_utime > in secti > on (__TEXT,__text) > TSRM/.libs/libtsrm.al(tsrm_virtual_cwd.lo) definition of _virtual_utime > in secti > on (__TEXT,__text) > /usr/bin/libtool: internal link edit command failed > make[1]: *** [libphp4.la] Error 1 > make: *** [all-recursive] Error 1 > > Forgive my ignorance but HUH? WTF? > > I have done this countless times on i386 boxes under RedHat and FreeBSD. > Unfortunately, I have never encountered this problem before. > > Just FYI, before attempting to compile/install PHP, I successfully > compiled/installed Apache 1.3.27, > which seems to work as expected. I also upgraded to the latest Apple > Developers Kit, and related update > patches. > > Any ideas? > > Thanks, > > Kris >
attached mail follows:
Joins. Cool. Never heard of them before now but have started experimenting with them. What does this error mean?
Error: cannot select orderid select orderid from orders, email where orders.orderid = email.orderid and email.checked='no' Column: 'orderid' in field list is ambiguous
My query function syntax is:
function get_order_numbers() { $conn = db_connect(); $query = "select orderid from orders, email where orders.orderid = email.orderid and email.checked='no'"; $result = mysql_query($query) or die("Error: cannot select orderid<BR>$query<BR>".mysql_error()); while( $row = mysql_fetch_array($result)) { extract($row); $orderid = $row; return $orderid; } }
What does it mean ambiguous? Cheeky error!
Steve Jackson
Web Developer
Viola Systems Ltd.
http://www.violasystems.com
stephen.jackson
violasystems.com
Mobile +358 50 343 5159
> -----Original Message-----
> From: 1LT John W. Holmes [mailto:holmes072000
charter.net]
> Sent: 5. marraskuuta 2002 16:59
> To: stephen.jackson
violasystems.com; PHP General
> Subject: Re: [PHP] Help me learn! with an explanation of
> these two functions.
>
>
> Your first function is only going to return one row of
> 'checked=no' records. The second function will only return
> one column of the result.
>
> What you want is a JOIN. You can do all of this with a single
> query. Without knowing the format of your tables exactly, I
> can't give you the syntax, though.
>
> Check the MySQL manual and read the chapter on JOINs.
>
> ---John Holmes...
>
> ----- Original Message -----
> From: "Steve Jackson" <stephen.jackson
violasystems.com>
> To: "PHP General" <php-general
lists.php.net>
> Sent: Tuesday, November 05, 2002 9:50 AM
> Subject: [PHP] Help me learn! with an explanation of these
> two functions.
>
>
> > Can someone run over these functions I have written to
> explain if my
> > logic is correct. I'm still new to PHP and am trying to get my head
> > round it! This first function is to collect a list of order numbers
> > from my database where checked = no.
> > Am I correct in assuming that the variable $orderid will be
> an array of
> > results returned? How can I check this?
> >
> > function get_live_orders()
> > {
> > $conn = db_connect();
> > $query = "select orderid from email where checked='no'"; $result =
> >
mysql_query($query);
> > if(mysql_numrows($result)>0)
> > $orderid =
mysql_fetch_array($result);
> > return $orderid;
> > }
> >
> > This second function is to take these order numbers and
> compare them
> > to order numbers in a second table and return the result of
> that. So
> > if order number 100001 is in the first array from the above
> function
> > and there is a number 100001 in the second query result I
> want to take
> > all the data in that row and return it.
> >
> > function get_order_details()
> > {
> > $orderid = get_live_orders();
> > $conn = db_connect();
> > $query = "select * from orders where orderid='$orderid'"; $result =
> >
mysql_query($query); if (!$result)
> > return false;
> > $result = mysql_result($result, 0, "orderid");
> > return $result;
> > }
> >
> > I haven't actually run this yet but I'd like someone to
> explain to me
> > what these functions will do so I am not just copy pasting code and
> > hoping to get it right eventually! Probably I have written
> this wrong
> > anyway and would like help before I actually attempt to do
> what I am
> > after. I'll look back on this tomorrow so any help will be greatly
> > appreciated. Kind regards,
> > Steve Jackson
> > Web Developer
> > Viola Systems Ltd.
> > http://www.violasystems.com
> > stephen.jackson
violasystems.com
> > Mobile +358 50 343 5159
> >
> >
> > --
> > 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
>
attached mail follows:
At 08:58 06.11.2002, Steve Jackson said: --------------------[snip]-------------------- >Joins. Cool. Never heard of them before now but have started >experimenting with them. >What does this error mean? > >Error: cannot select orderid >select orderid from orders, email where orders.orderid = email.orderid >and email.checked='no' >Column: 'orderid' in field list is ambiguous --------------------[snip]--------------------
In this case both tables (order and email) have a column named orderid. The select part pf your statement needs to specify the table name or alias where the orderid field should be taken from:
select orders.orderid from orders, email where orders.orderid = email.orderid and email.checked='no'
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
attached mail follows:
Ok this is starting to get complex! (For me anyway) This is my function: function get_order_numbers() { $conn = db_connect(); $query = "select orders.orderid from orders, email where orders.orderid = email.orderid and email.checked='no'"; $result = mysql_query($query) or die("Error: cannot select orderid<BR>$query<BR>".mysql_error()); while( $row = mysql_fetch_array($result)) { extract($row); $orderid = $row; $query2 = "SELECT * FROM orders WHERE orderid=\"$orderid\""; $result2 = mysql_query($query2) or die("Error: cannot fetch order<BR>$query2<BR>".mysql_error()); extract(mysql_fetch_array($result2)); } }
The SQL works Ok. At least I get no errors now. It's my PHP to display the SQL I think I get a result of 8 errors with the following message. Warning: Wrong datatype in call to extract() in /www/u1255/eadmin/eshop_fns.php on line 40. Where line 40 is: extract(mysql_fetch_array($result2));
I am trying to display the message on another page using: <? include ('eshop_fns.php'); get_order_numbers(); $ship_name = $result2["ship_name"]; echo "tests and $ship_name"; ?>
What does extract do? I am under the assumption it extracts row information so why a datatype error? Any pointers?
attached mail follows:
At 09:52 06.11.2002, Steve Jackson said: --------------------[snip]-------------------- >function get_order_numbers() >{ >$conn = db_connect(); >$query = "select orders.orderid from orders, email where orders.orderid >= email.orderid and email.checked='no'"; >$result = mysql_query($query) or die("Error: cannot select >orderid<BR>$query<BR>".mysql_error()); >while( $row = mysql_fetch_array($result)) > { > extract($row); > $orderid = $row; > $query2 = "SELECT * FROM orders WHERE orderid=\"$orderid\""; > $result2 = mysql_query($query2) or die("Error: cannot fetch >order<BR>$query2<BR>".mysql_error()); > extract(mysql_fetch_array($result2)); > } >} > > >The SQL works Ok. At least I get no errors now. >It's my PHP to display the SQL I think I get a result of 8 errors with >the following message. >Warning: Wrong datatype in call to extract() in >/www/u1255/eadmin/eshop_fns.php on line 40. >Where line 40 is: >extract(mysql_fetch_array($result2));
Steve,
maybe the second fetch doesn't return anything because the resultset is empty? You should assign the second fetch to a variable and test it before passing it to extract (as with the first fetch):
$row2 = mysql_fetch_array($result2); if (is_array($row2)) { extract($row2); // ... }
>What does extract do? I am under the assumption it extracts row >information so why a datatype error? >Any pointers?
--------------- [doc] --------------- int extract ( array var_array [, int extract_type [, string prefix]])
This function is used to import variables from an array into the current symbol table. It takes an associative array var_array and treats keys as variable names and values as variable values. For each key/value pair it will create a variable in the current symbol table, subject to extract_type and prefix parameters. --------------- [/doc] --------------
May I suggest getting the "Camel Book", or at least consult the EXCELLENT online PHP manual at http://www.php.net/manual/en/. If you read about mysql_fetch_array you'll notice the additional optional parameter "result_type". Since you're going to pass the resulting data to extract it helps to specify MYSQL_ASSOC as result_type, this will omit the numerically indexed data from the fetched array, which isn't used by extract() anyway.
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
attached mail follows:
On Wednesday 06 November 2002 16:52, Steve Jackson wrote: > Ok this is starting to get complex! (For me anyway) > This is my function: > function get_order_numbers() > { > $conn = db_connect(); > $query = "select orders.orderid from orders, email where orders.orderid > = email.orderid and email.checked='no'"; > $result = mysql_query($query) or die("Error: cannot select > orderid<BR>$query<BR>".mysql_error()); > while( $row = mysql_fetch_array($result)) > { > extract($row);
According to your query it should return a single result (assuming your orderid is unique -- and it should be), and that single result contains a single field called "orderid".
Use print_r($row) to see exactly what it contains (good for reference and debugging).
extract($row) would assign to $orderid the value of $row['orderid'] (ie $orderid = $row['orderid']) ...
> $orderid = $row;
... thus, I don't know why you have this line here. Remove it.
> $query2 = "SELECT * FROM orders WHERE orderid=\"$orderid\"";
This fails because $row is an array and you assigned that to $orderid.
> What does extract do? I am under the assumption it extracts row > information so why a datatype error?
rtfm for details and examples.
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* "Take that, you hostile sons-of-bitches!" -- James Coburn, in the finale of _The_President's_Analyst_ */
attached mail follows:
Hi. I'm not sure if is here where i have to ask this, but, if it's not i hope you say to me :D.
Well the question is: i want to know how can i make to insert into the $_GET or $_POST arrays, an entry with a value from javascript.
Thanks
attached mail follows:
vsv3
alu.ua.es wrote:
>Well the question is: i want to know how can i make to insert into >the $_GET or $_POST arrays, an entry with a value from javascript. > All the php processing (on the server) is complete before the javascript processing (on the client) commences, so you would need to submit to a new location with JS giving parameters in the url. These would then appear in the $_GET array for the location you submit to.
HTH Chris
attached mail follows:
Lee,
I think its the AddType line for php that you want to take out of the <IfDefine>
HTH Chris
Lee Philip Reilly wrote:
>Thanks for your reply. I took out the following lines, and restarted Apache, >but I still have the same problem... > >---------------- ></IfDefine> ><IfDefine HAVE_PHP> >LoadModule php_module modules/mod_php.so ></IfDefine> ><IfDefine HAVE_PHP3> >LoadModule php3_module modules/libphp3.so ></IfDefine> ><IfDefine HAVE_PHP4> >LoadModule php4_module modules/libphp4.so ></IfDefine> >---------------- > > > >
attached mail follows:
On Wednesday 06 November 2002 01:50, Lee Philip Reilly wrote: > Thanks for your reply. I took out the following lines, and restarted > Apache, but I still have the same problem... > > ---------------- > </IfDefine> > <IfDefine HAVE_PHP> > LoadModule php_module modules/mod_php.so > </IfDefine> > <IfDefine HAVE_PHP3> > LoadModule php3_module modules/libphp3.so > </IfDefine> > <IfDefine HAVE_PHP4> > LoadModule php4_module modules/libphp4.so > </IfDefine> > ----------------
You're looking at the wrong thing. IIRC you compiled php as CGI, those lines are only relevant if you're using PHP as a module.
I'm not sure, but I think you have to look the the "ExecCGI" option and use the "AddHandler" directive to tell apache to treat files ending with '.php' as a cgi program.
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* Men love to wonder, and that is the seed of science. */
attached mail follows:
No one replied to this message yet. I am trying to address it again, as probably the previuos newsmessage title wasn't very descriptive.
Thanks
Daniele
=================
Hi guys,
I have very weird problem.
I have installed the PHP version 4.2.3 on the LINUX virtual server of my web project. Previously I had the PHP version 4.0.6.
The error I get is very weird. When I insert a record with the phpMyAdmin, the first 4 characters of each field don't get saved. Same thing happened with some data entry interfaces I coded!
The only difference I can see in the two installation (provided the php.ini file is in the same location):
The old version 4.0.6 was installed by the server provider and my virtual server space I can only see the .so file. The new version 4.2.3 is actually inside my virtual server space. Hence, the path I provided in the php configuration is different (I don't have idea if this can influence something).
NEW VERSION (4.2.3) configuration run by me './configure' '--with-apxs=/usr/local/apache/1.3/bin/apxs' '--prefix=/usr/home/rockit/usr/local' '--with-mysql=/usr/home/rockit/usr/local/mysql' '--with-xml' '--enable-xslt' '--with-xslt-sablot=/usr/home/rockit/usr/local' '--with-regex=system' '--with-expat-dir=/usr/home/rockit/usr/local' '--with-iconv=/usr/home/rockit/usr/local' '--enable-inline-optimization' '--disable-debug' '--enable-memory-limit' '--enable-sigchild' '--without-pear' '--enable-mbstring' '--enable-mbstr-enc-trans' '--with-gdbm=/usr/local' '--enable-sockets' '--enable-versioning' '--with-ttf=/usr/local' '--enable-ftp' '--with-gd=/usr/local' '--with-zlib' '--enable-gd-native-ttf'
OLD VERSION (4.0.6) configuration run by the server provider './configure' '--enable-inline-optimization' '--with-apxs=/usr/local/apache/1.3/bin/apxs' '--with-config-file-path=/usr/local/lib' '--disable-debug' '--enable-memory-limit' '--enable-sigchild' '--with-gettext' '--without-pear' '--with-regex=system' '--enable-mbstring' '--enable-mbstr-enc-trans' '--with-iconv=/usr/local' '--with-gdbm=/usr/local' '--with-dbm=/usr/local' '--enable-sockets' '--enable-versioning' '--with-freetype-dir=/usr/local' '--with-ttf=/usr/local' '--enable-ftp' '--with-curl=/usr/local/curl' '--with-openssl=/usr/local/openssl' '--with-gd=/usr/local' '--with-freetype-dir=/usr/local' '--with-ttf=/usr/local' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr/local' '--with-t1lib=/usr/local' '--with-zlib' '--enable-gd-native-ttf' '--with-imap' '--with-mcrypt=/usr/local' '--with-mhash=/usr/local' '--with-dom=/usr/local' '--with-mysql=/usr/local/mysql' '--with-zlib' '--with-zlib'
I must admit that I didn't not include all parameter as the old installation, as I didn't know most options and thought is not needed. In the new installation I instead provided additional XML parameter (after installing the correspond modules, which all seem to work fine).
Hints on problem are very well welcome!
Daniele
attached mail follows:
I am Newbie in PHP My Problem It's Too Hard to Explain but i'll try its..
I have Two Text Fields The First Text Field i call it "InputX", the amount of InputX is Constant, and The Second Text Field I Call it "InputY", Generatable Field
I have the Button usefull for Generated "InputY" (so If I Click The Button It Will Produce amount of "InputY"). i call the
Button "AddRow"
I need to insert data from that form to the server, the script will save the value of Fields ("InputX" and INPUTY") by once
submit. And the amount of value of data saved depent on how many "InputY" I have.
This The sample of Value Of The Fields will saved into the server, if user click 5x "AddRow's Button".
INPUTXVALUE INPUTYVALUE INDEX SUB1 INDEX SUB2 INDEX SUB3 INDEX SUB4 INDEX SUBX
i have done before with my asp script. and it's Worked. <% i = 0 Inputx = request("Inputx") dim vary(100) for each y in request("InputY") vary(i) = y i = i + 1 next for each x in request("inputY") insertq = "Insert into Nsoftware(X, Y) values ('" & Inputx & "','" & vary(i) & "')" set save = conn.execute(insertq) i = i + 1 next %>
I try this script with php, but i found an Error.
<?php
$vary(100); $i = 0;
foreach($InputY as $y){ $vary($i) = $y; $i++; }
foreach($Nama_Software as $x){ $insertq = "Insert into NSoftware (X, Y) values ('$InputX','$vary($i)')"; echo $insertq."<br>"; mysql_query($insertq); $i++; }
Sorry it's to many CopyPasting..,
attached mail follows:
Hi Remon,
> I try this script with php, but i found an Error.
It would be helpful if you could show us this error message.
> $vary(100);
At the very least, you should change this line to
$vary = array();
Cheers Jon
attached mail follows:
This might help
http://www.mysql.com/doc/en/Date_and_time_functions.html
Here is an example that uses date functions. The following query selects all records with a date_col value from within the last 30 days:
mysql> SELECT something FROM tbl_name WHERE TO_DAYS(NOW()) - TO_DAYS(date_col) <= 30;
Pete
Jason wrote: > My logging application is feeding a MySQL database with data records > that are time stamped with GMT time. I would like to query the database > for records matching local time(eg. all records created on oct > 17,2002 local time). I would prefer if the records could be formated > in local time when returned from MySQL. What is the best way to do this. > > Jason > > > >
attached mail follows:
Hi,
I already have the 4.2.2 PHP version running on my server. But it was compiled without mysql. I want to add this option to use mysql. Must I to recompile my PHP with mysql option, or is there a simpler solution ?
Thanks a lot.
*-----------------------* Audrey Bihouee INSERM U533 Faculté de médecine, 1, rue Gaston Veil 44035 Nantes Cedex 1 Tel : 02.40.41.29.86 *-----------------------*
attached mail follows:
Hi
I want to make a secure site. The username , password and permission of the users must be stored in database. I only want certain icons (navigation bars) to be available to certain users. How would i be able to do this with permissions ?
Thanks Shaun
attached mail follows:
top frame: <form target="bottom_frame" action="show_form.php"> <select name="form" onChange="this.form.submit()"> <option value=""> -- choose a form -- </option> <option value="form1"> first form </option> <option value="form2"> second form </option> </select> <input type="submit> </form>
bottom frame (show_form.php): switch($_GET['form']){ case 'form1': include 'form1.php'; break; case 'form2': include 'form2.php'; break; case '': echo 'choose a form'; break; }
I showed you just the basics, don't forget to name the bottom frame bottom_frame (or change the target). This can be done also on a simple page
Chris Rehm wrote:
> Good point, lack of javascript is a consideration. > > The request is for a form where the second half format is dependent on > the first half. In other words, they make some choices on the top that > determine what the form on the bottom will be. But the guy who wants > this, wants it to be one screen. > > Marek Kilimajer wrote: > > Did you get a request for a two part form, or for a form on 2 pages? The > > problem I see is with browsers > > without javascript (either turned of or not implemented) > > >
attached mail follows:
Hi, we have upgraded from php4.0.6 to php4.2.2 The problem is that php4.2.2 remembers last GET and POST vars in HTTP_SESSION_VARS also. This ruins the functionality of many programs we are running. both 4.0.6 and 4.2.2 were configured and compiled with exactly the same parameters and we are using the same php.ini conf (which is attached in the mail)
In the features added between 4.0.6 and 4.2.2 we did not notice any changes that make such a change in php behaviour. Please advise how can we fix this behaviour without making changes in the code. Thanks a lot
ps. these are configure options for php4.0.6 and php4.2.2 we used.
./configure --prefix=/usr/local/web/progs/php-4.0.6 --with-db3 --with-db --with-jpeg-dir -with-tiff-dir \ --with-jpeg-dir --with-png-dir --enable-force-cgi-redirect --enable-discard-path --with-openssl \ --with-zlib --with-bz2 --enable-ftp --with-gettext --enable-sockets --enable-shared \ --with-gnu-ld --enable-versioning --enable-static --with-config-file-path=/usr/local/web/apache-php/conf \ --enable-magic-quotes --enable-track-vars --with-apxs=/usr/local/web/apache-php/bin/apxs \ --with-tsrm-pthreads --enable-yp --with-kerberos --with-imap --with-imap-ssl --without-dmalloc \ --enable-trans-sid --enable-mbstr-enc-trans --enable-mbstring
./configure --prefix=/usr/local/web/progs/php-4.2.2 --with-db3 --with-db --with-jpeg-dir -with-tiff-dir \ --with-jpeg-dir --with-png-dir --enable-force-cgi-redirect --enable-discard-path --with-openssl \ --with-zlib --with-bz2 --enable-ftp --with-gettext --enable-sockets --enable-shared \ --with-gnu-ld --enable-versioning --enable-static --with-config-file-path=/usr/local/web/apache-php/conf \ --enable-magic-quotes --enable-track-vars --with-apxs=/usr/local/web/apache-php/bin/apxs \ --with-tsrm-pthreads --enable-yp --with-kerberos --with-imap --with-imap-ssl --without-dmalloc \ --enable-trans-sid --enable-mbstr-enc-trans --enable-mbstring
- TEXT/PLAIN attachment: php.ini
attached mail follows:
Karl James wrote:
>Good Afternoon People > >I am trying to create a site where you can add/delete players >>From a roster > >So what I need help is how to automatically format the check >Boxes to appear in every row > use a table, name your checkboxes 'player[]' with value set to the player's id
>And to know how to do the add/delete part > use a select where you can choose an action, for the add part, use a separate form (may be on the same page) with inputs you need
>If anyone can come online with me and talk to me that would >Be tremendous if they have any free time on there hands. > >Thanks >Karl james > > > >
attached mail follows:
Do you have libcurl intaled?
Ernest E Vogelsinger wrote:
>Hi list, > >maybe someone has a simple answer to this: > >I am running Apache 1.3.22 with libphp4.so. Everything's fine, but when >starting php from the command line I get: > >php: relocation error: php: undefined symbol: curl-global-init > >Any idea what I should try? > >Thanks, > > >
attached mail follows:
If I understand you, you need to have a basic class with the one function and subclass it. Then you can reference the array as $this->$passed_in_array_name
John Kenyon wrote:
> I'm trying to write a function I can plop in a bunch of different > classes without having to modify it. > > Basically I have classes like: > > > class Example > { > var $array1; > var $array2; > var $array3; > > > etc. > > } > > and I want to have a function in that class that looks something like > this: > > function do_something_to_array($passed_in_array_name) > { > //this is what I've done so far, but which isn't working > $arr = '$this->' . $passed_in_array_name; > > // now I want $passed_in_array_name to be evaluated as an array > > eval ("\$arr = \"$arr\";"); > > // however even if 'array1' is the passed in value $arr is not the > // same as $this->array1 > ... > } > > As a side note there is another aspect of this that confuses me -- if > I do a print_r($arr) before the eval it returns the string > '$this->array1', if I do it after it returns Array (which is what it > seems it should do. However, if I then pass $arr to a function that > requires an array as an argument, like array_push, for example, I get > an error that says that function takes an array. Can anyone explain > this to me? The only guess I have is that my eval function is turning it > into a string which reads as Array instead of either a String object > or the > value of the string. > > More important though is the first problem of generically > accesing a member variable based on the passed in name of the > variable. In other words I want to be able to choose which array I > operate on by passing in the name of that array. > > > Any help on this problem is appreciated. I know there must be a way to > do this. Please let me know if I haven't formulated the problem > clearly enough. > > jck > > >
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]