php-general Digest 3 Feb 2004 14:16:27 -0000 Issue 2568
Topics (messages 176645 through 176677):
Re: auto forms from mysql database
176645 by: Justin Patrin
Question about dates
176646 by: Renan G. Galang
176647 by: John Nichel
176650 by: John W. Holmes
Re: [Stats] PHP Net List: January 2004
176648 by: John Nichel
176660 by: Raditha Dissanayake
Retrieve specific data from MySQL
176649 by: Matt Hedges
176651 by: John Nichel
176652 by: Jochem Maas
176653 by: Matt Hedges
176654 by: John Nichel
176655 by: Jochem Maas
176658 by: Matt Hedges
SQL Query Not Kosher?
176656 by: Mr. Austin
176657 by: Mr. Austin
176670 by: Marek Kilimajer
Re: looking for a way to manually free memory in the middle of a script
176659 by: kumar mcmillan
Selling PHP Code? PHP Careers?
176661 by: Galen
starting a session
176662 by: Angelo Zanetti
176672 by: memoimyself.yahoo.com.br
Re: Zlib Compression || Implementation || Bandwidth Savings?
176663 by: rush
176668 by: Ammar Ibrahim
176674 by: rush
PHP and DataSet from C# (VB)
176664 by: Sichta Daniel
176665 by: Stuart
176666 by: Stuart
Re: PHP timeout
176667 by: Mario
Re: Adding one month to a given date
176669 by: Ammar Ibrahim
my changes in php.ini are not recognized
176671 by: Burckhardt Übersohn
New lines
176673 by: Nico Berg
176677 by: Jason Wong
R: [PHP] SQL Query Not Kosher?
176675 by: Alessandro Vitale
Problems with exec
176676 by: Jason Freeman
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 ---
Justin French wrote:
On Tuesday, February 3, 2004, at 12:19 PM, Justin Patrin wrote:
Sounds like you want to look into some of the PEAR projects.
DB_DataObject knows about field types and can do required fields and
such. DB_DataObject_FormBuilder can give you a form to edit fields
which can be customized in *any* way you want it to be. It includes
facilities for hiding fields as well as *many* others. I'm also
working on DB_DataObject_FormBuilder_Frontend which will give you a
whole frontend to choose tables and view / edit fields from any table.
http://pear.php.net/package/DB_DataObject
http://pear.php.net/package/DB_DataObject_FormBuilder
They DO sound like what I want, and I've been looking at the above
already, but I don't want the overhead or requirements of Pear. This
will end up as a distro, and adding pear to the equation is far from
desirable.
Thanks anyway!
Justin French
What overhead and requirements? It doesn't take that much to load PEAR
(mod_php will hold 'compiled' versions in memory, too) and I don't see
the requirements as much either. A few hundred K of files (not all of
which will be loaded at any given time) for a good framework, unified
error handling, and lots of functionality that you don't have to
re-invent is well worth it.
--
paperCrane <Justin Patrin>
--- End Message ---
--- Begin Message ---
I just need a confirmation, when the getdate() function is invoked inside a PHP
script, the date returned will be the server hosting the pages' date and not the
client requesting the page, right? or am i wrong in my assumption? Thanks guys.
--- End Message ---
--- Begin Message ---
Renan G. Galang wrote:
I just need a confirmation, when the getdate() function is invoked inside a PHP script, the date returned will be the server hosting the pages' date and not the client requesting the page, right? or am i wrong in my assumption? Thanks guys.
Correct.
--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--- End Message ---
--- Begin Message ---
Renan G. Galang wrote:
I just need a confirmation, when the getdate()
function is invoked inside a PHP script, the date
returned will be the server hosting the pages' date
and not the client requesting the page, right? or
am i wrong in my assumption? Thanks guys.
Yes, you are not wrong in your assumption.
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
Bill Doerrfeld wrote:
<snip>
Top 20 Contributors by Number of Posts
----------------------------------------------------------------------
Richard Davey 80
John Nichel 75
John W. Holmes 73
Jason Wong 68
Chris Shiflett 66
Ryan A 61
Freedomware 60
Jay Blanchard 51
Ben Ramsey 50
Stuart 49
Raditha Dissanayake 41
Matt Matijevich 39
daniel 38
memoimyself 37
Marek Kilimajer 37
DvDmanDT 35
CPT John W. Holmes 30
Radwan Aladdin 30
Tom Rogers 29
Justin Patrin 29
Great, now my wife has physical proof to back up her claim that I spend
too much time posting to mailing lists. ;)
--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--- End Message ---
--- Begin Message ---
A late burs in the last week got me in. :-)
John Nichel wrote:
Bill Doerrfeld wrote:
<snip>
Top 20 Contributors by Number of Posts
----------------------------------------------------------------------
Richard Davey 80
John Nichel 75
John W. Holmes 73
Jason Wong 68
Chris Shiflett 66
Ryan A 61
Freedomware 60
Jay Blanchard 51
Ben Ramsey 50
Stuart 49
Raditha Dissanayake 41
--
Raditha Dissanayake.
------------------------------------------------------------------------
http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.
--- End Message ---
--- Begin Message ---
Hello,
I have a basic question I can't figure out.
My site lets people enter in their information... I now want to be able for
a user to search the database. For example, enter in "firstname" or
"lastname" in a text box, hit submit, and have the results returned.
How do I write this in PHP?
I've tried lots of twists on SELECT * FROM table WHERE lastname=$lastname...
but can't get it to work...
any help greatly appreciated,
thanks,
Hedges
--- End Message ---
--- Begin Message ---
Matt Hedges wrote:
Hello,
I have a basic question I can't figure out.
My site lets people enter in their information... I now want to be able for
a user to search the database. For example, enter in "firstname" or
"lastname" in a text box, hit submit, and have the results returned.
How do I write this in PHP?
I've tried lots of twists on SELECT * FROM table WHERE lastname=$lastname...
but can't get it to work...
any help greatly appreciated,
thanks,
Hedges
How 'bout....
SELECT * FROM dbName.tableName WHERE lastname LIKE '%$lastname%'
--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--- End Message ---
--- Begin Message ---
$lastname = (string) $_POST['lastname'];
// probably want to do some sanity checks on the input
// e.g. watch out for names like O'Reilly
$lastname = str_replace("'","''",$lastname);
// the contents of variable must be inside single quotes
$sql = "SELECT * FROM table WHERE lastname='$lastname'";
// or try the SQL 'LIKE' syntax
$sql = "SELECT * FROM table WHERE lastname LIKE '$lastname'";
// may be use a wildcard
$sql = "SELECT * FROM table WHERE lastname LIKE '$lastname%'";
Matt Hedges wrote:
Hello,
I have a basic question I can't figure out.
My site lets people enter in their information... I now want to be able for
a user to search the database. For example, enter in "firstname" or
"lastname" in a text box, hit submit, and have the results returned.
How do I write this in PHP?
I've tried lots of twists on SELECT * FROM table WHERE lastname=$lastname...
but can't get it to work...
any help greatly appreciated,
thanks,
Hedges
--- End Message ---
--- Begin Message ---
Thank you for your replies...
I have it showing the last name... but what I can't figure out is how for it
to reference to the whole entry.
So, for example, when someone enters to search for the last name "Smith,"
all the "Smiths" are pulled up, sorted by first name and linked by id.
How do I do this?
thank you very much,
Hedges
Now, How do I get
"Matt Hedges" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello,
>
> I have a basic question I can't figure out.
>
> My site lets people enter in their information... I now want to be able
for
> a user to search the database. For example, enter in "firstname" or
> "lastname" in a text box, hit submit, and have the results returned.
>
> How do I write this in PHP?
>
> I've tried lots of twists on SELECT * FROM table WHERE
lastname=$lastname...
> but can't get it to work...
>
> any help greatly appreciated,
> thanks,
> Hedges
--- End Message ---
--- Begin Message ---
Matt Hedges wrote:
Thank you for your replies...
I have it showing the last name... but what I can't figure out is how for it
to reference to the whole entry.
So, for example, when someone enters to search for the last name "Smith,"
all the "Smiths" are pulled up, sorted by first name and linked by id.
How do I do this?
thank you very much,
Hedges
SELECT * FROM dbName.tableName WHERE lastname LIKE '%$lastname%' ORDER
BY firstname
And look here for how to execute your query...
http://us4.php.net/manual/en/function.mysql-query.php
And here on how to loop thru the result set...
http://us4.php.net/manual/en/function.mysql-fetch-array.php
--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--- End Message ---
--- Begin Message ---
its not clear to me what exactly you are asking but it sounds like you
would do well to read up on some MySQL syntax - specifically 'JOIN'
syntax and 'ORDER BY' syntax.
---
if you mean 'Smith' should match 'Smith', 'Smiths' & 'Smithson'
then use the wildcard syntax (e.g.... LIKE '%Smith%' ....) shown in the
previous 2 emails.
Matt Hedges wrote:
Thank you for your replies...
I have it showing the last name... but what I can't figure out is how for it
to reference to the whole entry.
So, for example, when someone enters to search for the last name "Smith,"
all the "Smiths" are pulled up, sorted by first name and linked by id.
How do I do this?
thank you very much,
Hedges
Now, How do I get
"Matt Hedges" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hello,
I have a basic question I can't figure out.
My site lets people enter in their information... I now want to be able
for
a user to search the database. For example, enter in "firstname" or
"lastname" in a text box, hit submit, and have the results returned.
How do I write this in PHP?
I've tried lots of twists on SELECT * FROM table WHERE
lastname=$lastname...
but can't get it to work...
any help greatly appreciated,
thanks,
Hedges
--- End Message ---
--- Begin Message ---
Thanks, ya'll! Got it working.
"Matt Hedges" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello,
>
> I have a basic question I can't figure out.
>
> My site lets people enter in their information... I now want to be able
for
> a user to search the database. For example, enter in "firstname" or
> "lastname" in a text box, hit submit, and have the results returned.
>
> How do I write this in PHP?
>
> I've tried lots of twists on SELECT * FROM table WHERE
lastname=$lastname...
> but can't get it to work...
>
> any help greatly appreciated,
> thanks,
> Hedges
--- End Message ---
--- Begin Message ---
Hi all:
I am trying to get this to work, but always get the same error: that the resource in
mysql_affected_rows() is not valid. Anyone see why this would be? All variables have
been tested for accuracy.
$query = mysql_query("UPDATE stories SET status='approved' WHERE story_id={$id}");
if(mysql_affected_rows($query) == 1) {
print("Your approval of \"$title\" was successful. If this user entered an email
address, they have been sent a notice of its approval and publication on the site.");
} else {
print("The approval of \"$title\" was not successful. Please check with the site
administrator for assistance.");
}
The above SQL statement works perfectly with phpMyAdmin (and, oddly enough, works with
the above script, yet the Warning is produced and the 'not successful' message is
displayed) Any thoughts are appreciated!
Mr. Austin
--- End Message ---
--- Begin Message ---
That would explain why it displays the second message saying it was not
successful. But why then does it still display this warning?
Warning: mysql_affected_rows(): supplied argument is not a valid MySQL-Link
resource in c:\apache\htdocs\admin\stories.php on line 112
Mr. Austin
----- Original Message -----
From: "Jochem Maas" <[EMAIL PROTECTED]>
To: "Mr. Austin" <[EMAIL PROTECTED]>
Sent: Monday, February 02, 2004 10:41 PM
Subject: Re: [PHP] SQL Query Not Kosher?
> from the php function manual:
>
> <quote>
> Note: When using UPDATE, MySQL will not update columns where the new
> value is the same as the old value. This creates the possibility that
> mysql_affected_rows() may not actually equal the number of rows matched,
> only the number of rows that were literally affected by the query.
> </quote>
>
> http://nl2.php.net/mysql_affected_rows
>
> Mr. Austin wrote:
>
> > Hi all:
> >
> > I am trying to get this to work, but always get the same error: that the
resource in mysql_affected_rows() is not valid. Anyone see why this would
be? All variables have been tested for accuracy.
> >
> > $query = mysql_query("UPDATE stories SET status='approved' WHERE
story_id={$id}");
> > if(mysql_affected_rows($query) == 1) {
> > print("Your approval of \"$title\" was successful. If this user
entered an email address, they have been sent a notice of its approval and
publication on the site.");
> > } else {
> > print("The approval of \"$title\" was not successful. Please check
with the site administrator for assistance.");
> > }
> >
> > The above SQL statement works perfectly with phpMyAdmin (and, oddly
enough, works with the above script, yet the Warning is produced and the
'not successful' message is displayed) Any thoughts are appreciated!
> >
> > Mr. Austin
> >
>
>
--- End Message ---
--- Begin Message ---
The argument to mysql_affected_rows must be mysql CONNECTION identifier
(from mysql_connect), not RESULT identifier (from mysql_query). Removing
the argument will work for you.
Mr. Austin wrote:
Hi all:
I am trying to get this to work, but always get the same error: that the resource in mysql_affected_rows() is not valid. Anyone see why this would be? All variables have been tested for accuracy.
$query = mysql_query("UPDATE stories SET status='approved' WHERE story_id={$id}");
if(mysql_affected_rows($query) == 1) {
print("Your approval of \"$title\" was successful. If this user entered an email
address, they have been sent a notice of its approval and publication on the site.");
} else {
print("The approval of \"$title\" was not successful. Please check with the site
administrator for assistance.");
}
The above SQL statement works perfectly with phpMyAdmin (and, oddly enough, works with the above script, yet the Warning is produced and the 'not successful' message is displayed) Any thoughts are appreciated!
Mr. Austin
--- End Message ---
--- Begin Message ---
On Feb 2, 2004, at 7:15 PM, Justin Patrin wrote:
Kumar McMillan wrote:
If this does happen to be a GD or PHP memory leak, I would suggest
writing a driver script which calls a sub-script which does the
processing. Have the driver keep track of all of the files and hand
one (or some number) to the processor, which processes them. Use
system() to call the processor.
ahhh... works so much smoother. did a little switch with getopt() and
used the same file as the subscript too.
after doing this though I can see the memory explosion happening on the
same image files so I take it there is something up with those files
and not a memory leak in imagecreatefromjpg() when called repeatedly.
Either way, calling a separate process allowed me to isolate the
problem files and get on with the show.
thanks, Kumar
--
paperCrane <Justin Patrin>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi PHP list,
I seem to have a knack for really powerful, creative PHP code. With a
little effort, I have yet to find any real limitations I cannot
overcome with PHP/MySQL/PostgreSQL. Not that there aren't any, just
that almost (emphasis on "almost") anything web related, I can do. I'm
pretty confident I could develop things as complex as Amazon.com and
eBay and perhaps even improve on them. At least that's what I like to
think :)
I'm not the kind of person who likes to spend years on a project. I put
lots of energy, creativity, and effort in, get an amazing result, then
move onto something else. That's my tendency, although I can restrain
myself a bit, especially if there is significant profit for me.
Creative programming is my thing. I'm pretty good at graphic design
(i.e. web page layouts) too...
I keep developing PHP-related ideas I want to pursue. Some of them are
fully implemented, others partially, and many not at all. Already I've
developed a powerful fuzzy search system that most programmers find
very impressive. Others projects go all up and down the spectrum of
possibilities.
I'm writing this to ask the collective "advice" of the php mailing
list. As it stands, I'm a college student and working part-time on PHP
development in Vancouver, Washington, USA. I've had excellent raises,
now making over 60% more since September, but I'm probably not going to
go much further in this small company. I'm thinking about other options
- maybe self employment or going in with a business partner - or
perhaps some more clear career paths.
Does anyone have suggestions for me? I'm especially interested in
anyone self-employed or working with a business partner - something I'm
seriously considering - or in some kind of start up company. What are
your thoughts and feelings? Do you like it?
Feel free to reply off-list if you think this topic is off-topic and/or
you don't want to blast your information to the whole world.
Thanks,
Galen
--- End Message ---
--- Begin Message ---
Hi,
is there ever a certain situation where you would have something at the top
of your page before session_start();? If so why would it be before
session_start();?
thanx in advance
Angelo Zanetti
Z Logic
[c] +27 72 441 3355
[t] +27 21 464 1363
[f] +27 21 464 1371
www.zlogic.co.za
--------------------------------------------------------------------
Disclaimer
This e-mail transmission contains confidential information,
which is the property of the sender.
The information in this e-mail or attachments thereto is
intended for the attention and use only of the addressee.
Should you have received this e-mail in error, please delete
and destroy it and any attachments thereto immediately.
Under no circumstances will the Cape Technikon or the sender
of this e-mail be liable to any party for any direct, indirect,
special or other consequential damages for any use of this e-mail.
For the detailed e-mail disclaimer please refer to
http://www.ctech.ac.za/polic or call +27 (0)21 460 3911
--- End Message ---
--- Begin Message ---
Hello Angelo,
On 3 Feb 2004 at 9:36, Angelo Zanetti wrote:
> is there ever a certain situation where you would have something at the top
> of your page before session_start();? If so why would it be before
> session_start();?
The closest thing to a "certain situation" that I can think of is when want to set
session
variables only if certain conditions are met (e.g. only if the password submitted by a
user matches the one in the database). In this case, for obvious reasons, you'll need
PHP code before the session_start() statement.
Does this help at all?
Erik
--- End Message ---
--- Begin Message ---
"Cf High" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Question is, how to implement compression?
>
> Is it enough to just ini_set() zlib compression to ON? i.e. will all
content
> be automatically be compressed, or do I need to ob_start() &
ob_end_clean()
> at the start and end of each page?
I am not sure about ini_set, I am doing it manually, here is the article
which gave me directions:
http://www.phpbuilder.com/columns/argerich20010125.php3?page=2
rush
--
http://www.templatetamer.com/
--- End Message ---
--- Begin Message ---
if this works for you, could you please post your story in the group. this
is very interesting if you could save 50% of your bandwidth just by turning
the zlib flag :)
good Luck,
Ammar
"Cf High" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hey all.
>
> Having a good problem -- our hockey report site has jumped from 10
> gigs/month to 30+ gigs/month & growing.
>
> We're getting killed in bandwidth fees at the moment; barring switching to
> another host, will utilizing ZLIB compression significantly reduce
> bandwidth?
>
> Also, in terms of ZLIB settings, I've ini_set() zlib compression to ON.
>
> Additionally, do I need to ob_start() (& flush) page output?
>
> I am uncertain how to implement the following:
>
> example.php
>
> <?
> session_start();
>
> ini_set("zlib.output_compression","ON");
> ini_set("zlib.output_compression_level",4);
>
> ob_start();
>
> $page_contents = fopen(** read file contents to variable **);
>
> ob_end_flush();
> ?>
>
> Thanks for any advice,
>
> --Noah
>
> --
--- End Message ---
--- Begin Message ---
"Ammar Ibrahim" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> if this works for you, could you please post your story in the group. this
> is very interesting if you could save 50% of your bandwidth just by
turning
> the zlib flag :)
if you check amount of data that gets transfered from
http://www.moj-posao.net/ (once that images are cached, which is usually
imediately after the first page is loaded) you will see that amount
transfered is is in region of 10k, while the html source of the page is
about 50k. You do the math :) It is also has a great effect on page loading
time for dial-up users.
rush
--
http://www.templatetamer.com/
--- End Message ---
--- Begin Message ---
Hi there !!
Is there a way how can PHP can handle data (get data ) from DataSet
generated from dll buld in C# ?
I have dll which is whole database layer and I need to retrieve data in php.
THX
Ing. Daniel Šichta
Siemens Program and System Engineering s.r.o.
EIF AS TIS
Bytčická 2
01001 Žilina
SLOVENSKO
Tel.: +421(41) 505 5889
Fax: +421(41) 505 5809
mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
http://www.siemens-pse.sk/
--- End Message ---
--- Begin Message ---
Sichta Daniel wrote:
Is there a way how can PHP can handle data (get data ) from DataSet
generated from dll buld in C# ?
I have dll which is whole database layer and I need to retrieve data in php.
If the DLL exposes an interface via COM, then yes. See http://php.net/com
If not, you can but it would likely involve writing a PHP extension to
interact with the DLL. PHP|A[1] has a good article on this in the
January issue.
--
Stuart
[1] PHP|A: http://www.phparch.com/
--- End Message ---
--- Begin Message ---
Sichta Daniel wrote:
THX for links but could you please give me url of that article ?
http://www.phparch.com/issue.php?mid=22
Well worth the US$2.49!!
--
Stuart
--- End Message ---
--- Begin Message ---
Hi all
just a note that the problem was with the php 4.3.2 version finally and
nothing to do with permissions.
So if anyonwe has a similar problem, install a different version (the 4.3.4
is working fine here)
Mario
----- Original Message -----
From: "Mario" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 30, 2004 3:28 PM
Subject: Re: [PHP] PHP timeout
> it looks like it has nothing to do with MySQL and just with php
>
> I'm running a simple script like
> $x=23;
>
> echo $x;
>
> and it displays the number 23 properly, but the page keeps loading like
> there is something else to load too.
>
> ----- Original Message -----
> From: "Raditha Dissanayake" <[EMAIL PROTECTED]>
> To: "Mario" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Friday, January 30, 2004 1:33 PM
> Subject: Re: [PHP] PHP timeout
>
>
> > Hi,
> >
> > Make sure the mysql service is started and make sure that there isn't
> > anything else competing for the same port (3306) beyond that i am afraid
> > i cannot help as i am not a windows expert.
> >
> >
> > Mario wrote:
> >
> > >both php and mysql is on the same machine.
> > >
> > >even running the following timesout:
> > ><?php
> > >
> > >if (!($mylink = @mysql_pconnect("localhost","*****","******")))
> > >
> > >print "<h3>Problem connecting to the database server</h3>\n";
> > >
> > >exit();
> > >
> > >}
> > >
> > >mysql_select_db("xxxxxxx") or die ("<h3>Problem connecting to the
> > >database</h3><br>Description:" . mysql_error());
> > >
> > >?>
> > >
> > >
> > >
> > >
> > >
> > --
> > Raditha Dissanayake.
> > ------------------------------------------------------------------------
> > http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
> > Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
> > Graphical User Inteface. Just 150 KB | with progress bar.
> >
> > --
> > 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 ---
Use mysql's Date Functions. works like magic :)
Good Luck,
Ammar
"Merlin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi there,
>
> I am trying to add one month to a given date. Somehow I am lost
> inbetween mktime, date and unix timestamps ;-(
>
> Can anybody give me a hint on that?
>
> The date format I do have is: 2003-10-19
>
> Guess this does not work:
> $ptm = '2003-10-19';
> $ptm = 1 + mktime('YmdHis',$ptm);
>
> Thanx for any help,
>
> Merlin
--- End Message ---
--- Begin Message ---
I am just starting in php
(but 10 years experience in developping, last 5 years in JAVA).
I have installed on a Windows 2000 PC:
Apache 2.0 as localhost-server, MySQL 4.0.17 and PHP 4.3.4-Win32.
All parts seem to work properly.
My first steps into php also looked quite well.
Next level: sending HTML-forms and then reading the POSTed vars on another
page, also was running fine.
B*U*T, when defining some $_SESSION vars, their values were NOT available on
another page in the same session. (I was using session-start properly).
When testing and experimenting with phpinfo, ini_get(), and similars, I
found this:
The php.ini file is C:\WINNT\php.ini, also found by
get_cfg_var("cfg_file_path").
When I do some changes in the ini,
maybe for session_save.path (which was "/tmp" and I change to
"C:\PHP\sessiondata"),
and I stop and start the apache again (sometimes I stoped and restarted
Windows), then the ini_get("session.save_path") delivers again "/tmp".
The same happens with other ini-variables: (very important is, to get
error-messages, but I cannot change the specific vars in the ini, better: I
can change, but it has no effect).
I was looking, if there are other "ini"s in my system, but NO. And...
and...and ...:two days work without result.
The question, I see, is: from where does Apache+PHP take the values for the
ini-Params, because from my php.ini obviously NOT.
Thank you in advance for reading (and laughing ?) about my silly problem.
Maybe, you have an idea, what is to do ?
Buri (say simply "Buri" instead of Burckhardt)
--- End Message ---
--- Begin Message ---
Hi all,
I have a list of words (sense):
FIRST
SECOND
AND THIRD
FOURTH
etc
fread gives back "FIRST SECOND AND THIRD FOURTH"
How can i get the list as is?
Nico
--- End Message ---
--- Begin Message ---
On Tuesday 03 February 2004 21:26, Nico Berg wrote:
> fread gives back "FIRST SECOND AND THIRD FOURTH"
How did you ascertain that?
> How can i get the list as is?
Taking a wild guess I would say you need to familiarise yourself with HTML
before using PHP. In the meantime you could have a look at nl2br().
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Artificial intelligence has the same relation to intelligence as
artificial flowers have to flowers.
-- David Parnas
*/
--- End Message ---
--- Begin Message ---
try removing curly braces as follows:
$query = mysql_query("UPDATE stories SET status='approved' WHERE
story_id={$id}");
|
|
|
\/
$query = mysql_query("UPDATE stories SET status='approved' WHERE
story_id=$id");
or
$query = mysql_query("UPDATE stories SET status='approved' WHERE
story_id=${id}");
this applies if story_id is of type int in mysql table definition, or you
should enclose it among '' if is of type char, varchar or similar.
cheers
alessandro
-----Messaggio originale-----
Da: Mr. Austin [mailto:[EMAIL PROTECTED]
Inviato: martedì 3 febbraio 2004 5.35
A: [EMAIL PROTECTED]
Oggetto: [PHP] SQL Query Not Kosher?
Hi all:
I am trying to get this to work, but always get the same error: that the
resource in mysql_affected_rows() is not valid. Anyone see why this would
be? All variables have been tested for accuracy.
$query = mysql_query("UPDATE stories SET status='approved' WHERE
story_id={$id}");
if(mysql_affected_rows($query) == 1) {
print("Your approval of \"$title\" was successful. If this user entered
an email address, they have been sent a notice of its approval and
publication on the site.");
} else {
print("The approval of \"$title\" was not successful. Please check with
the site administrator for assistance.");
}
The above SQL statement works perfectly with phpMyAdmin (and, oddly enough,
works with the above script, yet the Warning is produced and the 'not
successful' message is displayed) Any thoughts are appreciated!
Mr. Austin
--- End Message ---
--- Begin Message ---
Hi there
I'm having a bit of trouble with executing system commands. My script reads as follows.
<?
exec("smbclient -L \\xxx.xxx.xxx.xxx -N", $output);
print_r($output);
?>
The problem is that when I run this script the page does not load and apache crashes.
Does anyone know a way around this problem??
Thanks
--- End Message ---