php-general Digest 5 Nov 2003 14:23:20 -0000 Issue 2397
Topics (messages 168531 through 168554):
Re: Mail Delivery Acknowledgement
168531 by: John Nichel
Re: [Stats] PHP Net List: October 2003
168532 by: John Nichel
168537 by: Burhan Khalid
168541 by: John W. Holmes
168542 by: Roger Spears
168544 by: Marco Tabini
168545 by: Marek Kilimajer
168547 by: Jay Blanchard
Return mysql_fetch_array($result) from a function
168533 by: Terence
168534 by: David Otton
Re: help with EVAL direct
168535 by: j.sobotka.psgraph.cz
Building PHP source for Linux / Unix.
168536 by: Ananth Kesari
168539 by: Chris Hayes
Re: Handling checkboxes that aren't checked!!!
168538 by: Ford, Mike [LSS]
create a php timetable problem.
168540 by: irinchiang.justeducation.com
Re: Instant timeout
168543 by: Bogdan Stancescu
Changing the php.ini file
168546 by: Mike At Spy
168548 by: Jay Blanchard
168550 by: Bogdan Stancescu
168551 by: Mike At Spy
168552 by: Mike At Spy
168553 by: Marek Kilimajer
Sessions within new windows
168549 by: Donald Tyler
168554 by: Donald Tyler
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 ---
[EMAIL PROTECTED] wrote:
Thank you for contacting me
Your e-mail has been forwarded to the appropriate person Mr. Imran Asghar.
We welcome all comments and suggestions.
Due to the high volume of e-mails received, not all e-mails are responded to directly.
All e-mails that are responded to are handled in the order in which they are received. If you need more immediate information or assistance, call us on following telephone numbers
+92 3009467711
mv imran /dev/null
--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--- End Message ---
--- Begin Message ---
Bill Doerrfeld wrote:
<snip>
Top 20 Contributors by Number of Posts
----------------------------------------------------------------------
Marek Kilimajer 181
Curt Zirzow 164
Chris Shiflett 141
Robert Cummings 113
John Nichel 83
Jay Blanchard 78
Chris W. Parker 78
Eugene Lee 75
Tom Rogers 59
Evan Nemerson 59
Jason Wong 57
Burhan Khalid 52
Ryan A 52
Raditha Dissanayake 52
David Otton 49
Scott Fletcher 46
CPT John W. Holmes 43
- Edwin - 41
Leif K-Brooks 38
John W. Holmes 37
<snip>
Hey, I beat John Holmes!!!! That's me baby, quanity, not quality. ;)
--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--- End Message ---
--- Begin Message ---
John Nichel wrote:
<snip>
Hey, I beat John Holmes!!!! That's me baby, quanity, not quality. ;)
Yeah apparently it is :P
--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
--- End Message ---
--- Begin Message ---
John Nichel wrote:
Hey, I beat John Holmes!!!!
You mean you're bigger than 14 inc... err, nevermind, you're talking
about something else...
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
That is funny stuff......I often wonder why no one ever cracks jokes or
makes a connection...
John W. Holmes wrote:
John Nichel wrote:
Hey, I beat John Holmes!!!!
You mean you're bigger than 14 inc... err, nevermind, you're talking
about something else...
--- End Message ---
--- Begin Message ---
Probably because nobody wants to risk offending John--or (more likely)
because no one will admit knowing who the "other" John Holmes is ;-)
Cheers,
Marco
--------------------------
php|architect - The Magazine for PHP Professionals
Try us free at http://www.phparch.com!
Complete searchable PHP mailing list archives at
http://www.phparch.com/mailinglists
Roger Spears wrote:
That is funny stuff......I often wonder why no one ever cracks jokes or
makes a connection...
John W. Holmes wrote:
John Nichel wrote:
Hey, I beat John Holmes!!!!
You mean you're bigger than 14 inc... err, nevermind, you're talking
about something else...
--- End Message ---
--- Begin Message ---
I bet you did not have time because of your "other" activities. ;)
John W. Holmes wrote:
John Nichel wrote:
Hey, I beat John Holmes!!!!
You mean you're bigger than 14 inc... err, nevermind, you're talking
about something else...
--- End Message ---
--- Begin Message ---
[snip]
I bet you did not have time because of your "other" activities. ;)
>> Hey, I beat John Holmes!!!!
>
> You mean you're bigger than 14 inc... err, nevermind, you're talking
> about something else...
[/snip]
Aren't you dead? And have a movie? *ack* Wait, I know (wink, wink) you
have several "movies". I meant a biographical ....*dang*...they were all
sort of biographical, not to mention biological....you know what I mean.
--- End Message ---
--- Begin Message ---
Hi All,
I am trying to get the results of a function, which queries MySQL, back into
an array for me to order. I only want to print out certain fields (I call
the same query, but use different fields in different places).
This works is I print out the fields in the function itself:
while($row = mysql_fetch_array($result)) {
echo $row["id"] . "<br>";
}
This however prints out an unending list of values:
/* This is where I think it's getting messed up, since it doesnt seem to be
able to store the "query" in a variable. I suspect it's something to do
recursive and multi-dimension arrays
http://www.phpbuilder.com/manual/language.types.array.php*/
$mysql_query = mysql_fetch_array($result);
while($row = $mysql_query) {
echo $row["id"] . "<br>";
}
Can someone perhaps show me how to do it (or point me in the right
direction), since I need to do this:
function ReturnSQLResults() {
....................
$mysql_query = mysql_fetch_array($result);
return $mysql_query;
}
And then be able to just print the fields I require.
Thanks in advance!!!
Terence
--- End Message ---
--- Begin Message ---
On Wed, 5 Nov 2003 14:53:15 +0800, you wrote:
>I am trying to get the results of a function, which queries MySQL, back into
>an array for me to order. I only want to print out certain fields (I call
>the same query, but use different fields in different places).
>Can someone perhaps show me how to do it (or point me in the right
>direction), since I need to do this:
It depends on exactly how your data is formatted, which you don't tell us.
I'm going to assume your query returns two values, id and name, and you want
them returned as a dictionary.
Probably the simplest way is to build an array as you iterate over the
query, then return it. Something like:
function ReturnSQLResults() {
....................
$result = array ();
$rs = $mysql_query($sql);
if ($rs == FALSE)
{
return (NULL);
}
while (($row = mysql_fetch_array ($rs)) != FALSE)
{
$result[$row['id']] = $row['name'];
}
if (sizeof ($result) == 0)
{
return (FALSE);
}
return ($result);
}
You now have a function that returns NULL on error, FALSE if no records were
found, else an array of (id => name)
If you're returning more than two values, you'll probably want your array
structure to be:
(id => array(firstname, lastname))
in which case try
$result [$row['id']] = array ($row['firstname', $row['lastname']);
if you just want a straight array-of-arrays, something like
((id, firstname, lastname), (id, firstname, lastname))
then
$result[] = array($row['id', $row['firstname', $row['lastname')
will do it.
--- End Message ---
--- Begin Message ---
"Cpt John W. Holmes" wrote:
> From: <[EMAIL PROTECTED]>
>
> > OS RedHat 9 and RedHat 7.2
> > Apache 1.3.27 and Apache 2
> >
> > I have problem with direct eval, in version PHP4.2.2 is all OK
> > in version PHP 4.3.3 -> direct eval bad
> >
> > here cut code
> >
> > $s = '$ret = ibase_execute($this->query, $arg_list[0], $arg_list[1],
> > $arg_list[2], $arg_list[3], $arg_list[4], $arg_list[5], $arg_list[6]);';
> >
> > eval($s);
> >
> > end cut code
> >
> > in PHP 4.3.3 -> log message
> > [Tue Nov 4 08:37:07 2003] [error] PHP Warning: ibase_execute():
> > attempted update during read-only transaction in
> > /www/test.php(204) : eval()'d code on line 1
> >
> > not write to DB
>
> Wild guess here, but it looks like you're trying to do an UPDATE query where
> you're only allowed to do a SELECT query (read-only). The error is not
> because of eval(), it's because of an incorrect usage of ibase_execute().
>
> ---John Holmes...
Thanks you,
I'm not understant, in version PHP 4.2.2 ext. modul interbase is OK. Function
ibase_execute, write with parameter work OK.
I'm change in ext. modul interbase function ibase_execute, now is working OK.
Jiri Sobotka
--- End Message ---
--- Begin Message ---
Hi,
I am a beginner to building PHP source code for Linux / Unix. I am
looking for a document that takes me through a step-by-step guidelines
of doing this. Can someone point to a link for this?
Thanks,
Ananth.
--- End Message ---
--- Begin Message ---
At 10:00 5-11-03, you wrote:
Hi,
I am a beginner to building PHP source code for Linux / Unix. I am
looking for a document that takes me through a step-by-step guidelines
of doing this. Can someone point to a link for this?
did you find http://nl.php.net/manual/en/installation.php ?
--- End Message ---
--- Begin Message ---
On 04 November 2003 20:43, Pablo Gosse contributed these pearls of wisdom:
> On Tuesday, November 04, 2003 12:45 PM Kevin wrote:
>
> [snipped]
>> How can I test for it without getting an error if it is not
> checked??
> [/snipped]
>
> Hey Kevin. Use isset($var) to test if a var has been set.
>
> So you would need:
>
> If (isset($_POST['checkboxname']) && $_POST['checkboxname'] ==
> 'on')
Personally, I prefer to use the @ error-suppression operator for this:
if (@$_POST['checkboxname'] == 'on')
{ echo 'Selected';
> }
> else
> {
> echo 'Not selected';
> }
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
--- End Message ---
--- Begin Message ---
Hi all:
A question to ask all PHP programmers out there...
Right now I am doing a timetable system whereby in each cell, it will display
a class code eg.3PE1234. But right now I want it to be in the way that I want
the user to be able to add the class code to the table cell through a user
interface. I was thinking I could put a "-"(dash) in all my cell which will be
clickable. When user click on this "dash" they will be directed to a user
interface with a drop down menu of class codes. (Class codes are retrieved
from database). I will then select the class code I would like to put into
this cell. Once submit, I will be linked back to the timetable , this time the
cell should display the class code I have added to the cell earlier on. Any
idea how can I go about doing this??...But anyway, I find this solution is
not ass user friendly as user will have to add class codes to the cell by a
clicking "cell-by-cell".
As each cell represents which day and what time the class will be
held. I was thinking of an alternate solution whereby I can create an user
interface such that when I have a drop down menu displaying the time eg.
1. 12.00-14.00
2. 14.00-16.00
3. 16.00-18.00
etc.....
and another drop down displaying the day (in my case, it is display as the
column) eg.
1. Monday
2.Tuesday
3. Wednesday
4. Thursday
5. Friday
etc....
and then lastly the drop down menu to display my class where I can select the
class I want to add to the cell on that particular DAY and TIME
For example, I would like to add the class "3PM1010" to the cell when the time
is "12.00-14.00" and the day is on "Monday", and thus I will select the
prospective value from each of the drop down menu from the above drop down
menu.
I hope I have made myself clear enough and really hope to receive some help
real soon. If there should be any doubts, feel free to drop me an email.
All help are greatly appreciated.
Warmest regards,
Irin.
--- End Message ---
--- Begin Message ---
Do you have this problem (your PHP page times out) or do is this the
desired result? For the latter, you've been answered, for the former it
might be a core error in your code which PHP can't handle -- in this
case the results are unpredictable, I typically get a "document contains
no data" error, but I guess you could also get a time out, depending on
the web server and its version. If this is the case, make a copy of the
script and start chopping out pieces from it until you don't get the
error anymore. The last chunk you deleted contains the problem. :)
Bogdan
Mike Yrabedra wrote:
What would cause a php page to instantly prompt a timeout error when
loading?
+--------------------------------------------+
Mike Yrabedra (President)
323 Incorporated
Home of MacDock.com, MacAgent.com and MacShirt.com
+--------------------------------------------+
W: http://www.323inc.com/
P: 770.382.1195
F: 734.448.5164
E: [EMAIL PROTECTED]
I: ichatmacdock
+--------------------------------------------+
"Whatever you do, work at it with all your heart,
as working for the Lord, not for men."
~Colossians 3:23 <{{{><
+--------------------------------------------+
--- End Message ---
--- Begin Message ---
I changed a value for max uploads in my php.ini file (linux box); I
restarted apache, then the whole server, to get the new value to come up
and, generally, take affect.
Neither of those things did it. Does anyone know what I need to do to get
the ini file re-read by the OS, or system, so that the new value goes into
effect?
Thanks,
-Mike
--- End Message ---
--- Begin Message ---
[snip]
I changed a value for max uploads in my php.ini file (linux box); I
restarted apache, then the whole server, to get the new value to come up
and, generally, take affect.
Neither of those things did it. Does anyone know what I need to do to
get
the ini file re-read by the OS, or system, so that the new value goes
into
effect?
[/snip]
In your upload dialog form do you have something similar to this
<input type="hidden" name="MAX_FILE_SIZE" value="30000">
if so, it may need changing. If not, it may need adding.
--- End Message ---
--- Begin Message ---
Oh, yes, this is a big one, you must reset the whole state power grid. :)
Simply restarting Apache should do it. Check if your problem doesn't
come from somewhere else - how are you checking if the changes took
effect? Also, are you sure you're editing the proper php.ini and not
some older install's or a backup or something? Check by setting some
self-evident setting in php.ini and restarting Apache. Also, if you're
sending the data to a database, make sure it's not the database who's
barfing due to its own config settings or limitations.
HTH
Bogdan
Mike At Spy wrote:
I changed a value for max uploads in my php.ini file (linux box); I
restarted apache, then the whole server, to get the new value to come up
and, generally, take affect.
Neither of those things did it. Does anyone know what I need to do to get
the ini file re-read by the OS, or system, so that the new value goes into
effect?
Thanks,
-Mike
--- End Message ---
--- Begin Message ---
I do have that in my form, it is set to 15 megs. I set the server (php.ini)
to allow 15 megs. Still can't get anything past 2 megs to upload. :\
Thanks for help,
-Mike
> -----Original Message-----
> From: Jay Blanchard [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, November 05, 2003 9:15 AM
> To: Mike At Spy; [EMAIL PROTECTED]
> Subject: RE: [PHP] Changing the php.ini file
>
>
> [snip]
> I changed a value for max uploads in my php.ini file (linux box); I
> restarted apache, then the whole server, to get the new value to come up
> and, generally, take affect.
>
> Neither of those things did it. Does anyone know what I need to do to
> get
> the ini file re-read by the OS, or system, so that the new value goes
> into
> effect?
> [/snip]
>
> In your upload dialog form do you have something similar to this
>
> <input type="hidden" name="MAX_FILE_SIZE" value="30000">
>
> if so, it may need changing. If not, it may need adding.
>
>
--- End Message ---
--- Begin Message ---
I'll go double check to make sure I am hitting the right php.ini, but I
think that is the only one the server reported with a 'whereis'.
I am taking the data and writing it to a file, so the db isn't an issue.
I'll mess with some of other settings and see what happens.
:)
Thanks,
-Mike
>
> Oh, yes, this is a big one, you must reset the whole state power grid. :)
>
> Simply restarting Apache should do it. Check if your problem doesn't
> come from somewhere else - how are you checking if the changes took
> effect? Also, are you sure you're editing the proper php.ini and not
> some older install's or a backup or something? Check by setting some
> self-evident setting in php.ini and restarting Apache. Also, if you're
> sending the data to a database, make sure it's not the database who's
> barfing due to its own config settings or limitations.
>
> HTH
>
> Bogdan
>
> Mike At Spy wrote:
>
> > I changed a value for max uploads in my php.ini file (linux box); I
> > restarted apache, then the whole server, to get the new value to come up
> > and, generally, take affect.
> >
> > Neither of those things did it. Does anyone know what I need
> to do to get
> > the ini file re-read by the OS, or system, so that the new
> value goes into
> > effect?
> >
> > Thanks,
> >
> > -Mike
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
post_max_size is another setting that has effect on uploads. It should
be higher than upload_max_filesize.
Mike At Spy wrote:
I changed a value for max uploads in my php.ini file (linux box); I
restarted apache, then the whole server, to get the new value to come up
and, generally, take affect.
Neither of those things did it. Does anyone know what I need to do to get
the ini file re-read by the OS, or system, so that the new value goes into
effect?
Thanks,
-Mike
--- End Message ---
--- Begin Message ---
Hi,
Not sure if this is a PHP or Browser issue but here is my problem:
I have a site that has a members section. In the news area, when a user
clicks the link for an article, it pops open a new window a requests the
article via a PHP script.
What's happening is that when the new window pops up, the script isn't
getting the session info properly. I changed it so that the page opens
up in the main window instead of a new one and it works fine.
I presume this is because the browser is not sending the session ID to
the script when opening the new window. Does anyone know of a way for me
to fix this without embedding the session ID in the URL?
I thought the only criteria that the browser used when deciding if to
send a Session ID or not was if the page is located at the same domain
name.
P.S. Its Internet Explorer 6 I am using.
Thanks.
--- End Message ---
--- Begin Message ---
Just a quick update:
It seems to only be a problem with Internet Explorer on the PC. Both IE
& Safari on MacOSX work as expected.
-----Original Message-----
From: Donald Tyler [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 05, 2003 8:17 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Sessions within new windows
Hi,
Not sure if this is a PHP or Browser issue but here is my problem:
I have a site that has a members section. In the news area, when a user
clicks the link for an article, it pops open a new window a requests the
article via a PHP script.
What's happening is that when the new window pops up, the script isn't
getting the session info properly. I changed it so that the page opens
up in the main window instead of a new one and it works fine.
I presume this is because the browser is not sending the session ID to
the script when opening the new window. Does anyone know of a way for me
to fix this without embedding the session ID in the URL?
I thought the only criteria that the browser used when deciding if to
send a Session ID or not was if the page is located at the same domain
name.
P.S. Its Internet Explorer 6 I am using.
Thanks.
--- End Message ---