| php+mysql statement timing out |
|
 |
Index ‹ php-general
|
- Previous
- 1
- cookies problemHi to all,
i've some probs using setcookie() fnc.
on my page.php i have 2 fnc:
first with login form and second with auth code (using MySQL DB).
my idea was to set up a cookie after verifing username/pass form my DB but
after that i'm getting a standrard error:-)
>>Warning: Cannot modify header information - headers already sent by
I know that i have to modify headers before anything else on this page but
i would like to setup a cookie only after proper user/pass combiantion
Anyone?
Zdenko
- 1
- Linking generic shared object into my PHP extensionI'm building a PHP extension in order to integrate a 3rd party closed
source library which was provided in a .so (shared object) file. My
extension is working quite well so far, but I can't figure out how to
automatically have this object link in during compile time.
If I step through the make command by hand, I've found the line I need
to influence is this one:
gcc -shared .libs/my_ext.o -Wl,-soname -Wl,my_ext.so -o .libs/
my_ext.so
which should become something like this
gcc -shared .libs/my_ext.o OTHER_OBJECT.so -Wl,-soname -
Wl,my_ext.so -o .libs/my_ext.so
Doing these last steps by hand makes it link just fine and my
extension works the way I want it to.
I've tried and failed with each of the following attempts to automate
the linking:
Putting the library in /usr/lib and setting LIBS=-lOTHER_OBJECT.so
Defining predep_objects and postdep_objects in config.m4
calling PHP_ADD_LIBRARY(OTHER_OBJECT) and
PHP_ADD_LIBRARY(OTHER_OBJECT.so) in config.m4
...plus several other approaches.
Surely this is a very simple hurdle, but any help you can provide is
greatly appreciated.
--Ian
- 5
- preg_replace broken in PHP 5.2.1Are the Zend folk aware that preg_replace returns a blank for string
replacement of long strings (somewhere over 32K) in 5.2.1?
This becomes an issue for very long wiki pages.
- Henrik
- 5
- dynamic drop-down list in arrayHello everyone.
Q. How do I create a dynamically-generated drop-down list for use in
an array.
I'm using PHP with a MySQL database (through phpMyAdmin)
My database table is called com_courses, and I want to pull the
distinct 'title' fields and have them appear as a drop down menu for
the user to select in a form.
Here is my array, with (at the moment) manually-entered 'titles'
(which I now need to be dynamically generated from my database field:
'com_courses.title'
array (
"coursetitle",
"Course Title:",
$EXTRA_SELECTLIST,
array ("Report Writing", "Recruitment & Selection", "Presentation
Skills", "Essential Telephone Skills", "Time Managememt", "Customer
Care", "Other"),
0
),
I am not an experienced programmer, but can play around with php to
customize programs. I've read up on arrays (I bought a "Programming
with PHP and MySQL" book, but it just stops short of this problem). I
can't figure this one out.
Is this enough info for you kind people to help me?
ANY real code would be soooooo helpful (so I could paste it in),
because, as I mentioned, I'm good at editing existing code rather than
creating code from scratch. But ANY help/guidance/funny comments would
be appreciated.
Thanks!!
Jonny
- 5
- newbie seeks help ref hyperlinkOk - not played with php for about 2 years and well - all my old scripts
have got corrupted - bugged.
Anyway - staring from scartch.
Can anyone put me out of my mysery. Tried to make in the following the
ref to "link" a hyperlink and no matter what I alter - it does not seem
to work. All I am trying to do is pull some basic info from a website -
site, comment and website link.:-
<?php
// connect to mysql and select database
$db = mysql_pconnect("localhost","xxxx","xxx");
mysql_select_db("xxxx",$db);
//require_once('settings.inc.php');
// build the query, order by newest ID and limit it to 10
$sql = "select * from test";
// run the query and set a result identifier to the recordset
$res = mysql_query($sql);
// loop the recordset
while ($name = mysql_fetch_array($res)) {
echo '<b>'.
' Site: '.$name["name"].'</b><br>'.
' Website: '.$name["link"].'<br>'.
' Comment: '.$name["comment"].'<br><br>';
}
?>
-
Thnaks
Scott
- 5
- Command line PHP: suppress warnings?Hello all.
I have some PHP scripts run by cron that email me all day for no good
reason. The scripts are outputting warnings like:
PHP Warning: Module 'mysql' already loaded in Unknown on line 0
PHP Warning: Module 'gd' already loaded in Unknown on line 0
PHP Warning: Module 'zlib' already loaded in Unknown on line 0
The environment is PHP 5.1.2 (cli) under FreeBSD.
The jobs are called like so:
0,15,30,45 * * * * /usr/local/bin/php -f /www/subsites/whatever/
htdocs/syncher.php
Though I have also tried this using the -q flag instaed of -f.
Any thoughts on suppressing this?
There doesn't seem to be a flag for it here:
http://us2.php.net/manual/en/features.commandline.php
TIA for any help!!!
FvB
- 6
- dir command in phpHi!
I have this line in my script:
dir = dir ($filepath);
It works fine...How should I do to add the -tr extension to the dir
command? (dir -tr)
Regards,
Patrik
- 6
- How to emulate isset() ? (is it possible?)
Take a look at this code (you can execute it):
error_reporting(E_ALL);
function byVal( $v) {}
function byRef(&$v) {}
print '<pre>';
byVal ($first['inexistent_index']); // gives a notice
var_dump($first); // gives a notice
print '<hr />';
byRef ($second['inexistent_index']); // does NOT give a notice
var_dump($second); // does NOT give a notice
print '<hr />';
isset($third); // does NOT give a notice
var_dump ($third); // gives a notice
print '</pre>';
In the $first case, using byVal(), I get *two* notices.
In the $second case, using byRef(), I get *zero* notice.
In the $third case, using isset(), I get *one* notice.
This means that:
1) byVal() does NOT define the array and raises a notice
(and var_dump() raises another notice).
2) byRef() defines the array and does NOT raise notices
(neither var_dump() raises a notice, since $second is defined).
3) isset() does NOT define the array and does NOT raise notices
(but var_dump() raises a notice, since $third is NOT defined).
As you can see, isset() is weird, and I need to emulate its behaviour.
The question is: is it possible to do that in PHP?
Greetings, Giovanni
- 6
- [PHP] free allocated memory: HOW ?Colin Guthrie wrote:
> Jochem Maas wrote:
>> yeah or exim, only I can't because it's one of the darn plesk servers - and changing
>> out the mail server is not something I can do.
>
> I have recently escaped Pleskhog day..... It's soooo refreshing - so
ROFL. if it's all the same 'Pleskhogday' is going into my arsenal of glib comments,
ready for the next late night plesk-initiated server madness.
> happy to just be given an apache config and let loose!!!
>
> Col
>
- 6
- Why is this not stripping the newlines/returns from my HTMLtext area?$string=eregi_replace("[\n\r]+","",$_POST['address']); This did the trick!
Seems to be this is a very basic thing yet it seems no definitive function
to do it? I ws barking up the right tree, knoew what the issues were, yet
still found it a tricky thing to pin down? Is there no dedicated function fo
rthis, must catch a few folk off guard??
Anyway, thanks man, very much appreciated.
"Philip Ronan" <email***@***.com> wrote in message
news:BFA3869E.3B142%email***@***.com...
> "Connector5" wrote:
>
>> /* Note that the default replacement is a single space */
>> function strip_eol($input_string = "", $replacement = " ")
>> {
>> if (strtoupper(substr(PHP_OS, 0,3) == 'WIN'))
>> {
>> return str_replace("\r\n", $replacement, $input_string);
>> }
>> else
>> {
>> return str_replace("\n", $replacement, $input_string);
>> }
>> }
>
> Some Mac browsers will juse use a single \r for line breaks. It's probably
> better to replace any combination of \n and/or \r like this:
>
> $string=eregi_replace("[\n\r]+","",$_POST['address']);
>
> --
> phil [dot] ronan @ virgin [dot] net
> http://vzone.virgin.net/phil.ronan/
>
- 6
- Passing values from one page to anotherHello all,
[snip]
--------------------------------------------
//Page0.php
<a href="page1.php?empid=1">Enter</a>
--------------------------------------------
--------------------------------------------
//page1.php
<script language="javascript">
function submitform()
{
//Check for empty values in text box
}
</script>
<form onsubmit='return submitform()' method=POST action='page2.php'>
<input type=text name=uname >
<input type=hidden name=empid value=<?php echo $empid;?>>
</form>
<?php
echo $empid;
?>
--------------------------------------------
--------------------------------------------
//page2.php
<?php
echo $empid;
?>
--------------------------------------------
In page 1 I am able to get the value 1 of empid.
But in page 2 I am not able to get it.
Any solutions
-murugesan
- 8
- Creating .chm files on the flyIs it possible to sreate .chm files on the fly, with content? I've
searched the whole web and I can't seem to be able to find any
extensions for this. Is there one out there someone could point me to?
Or, would it be possible without an extension?
Thanks
- 8
- php.ini will not load for IIS6Simply put, I cannot get php.ini to load while using Windows 2003/IIS6
Mind you, php.ini is in the windows directory, as it should be. And if I
run phpinfo() it shows the configuration file path as C:\WINDOWS\php.ini.
However, not a single setting in php.ini is actually reflected in the info
page. Nothing. It's like it sees the file, claims to be using it, and
completely ignores it. I can even remove or delete the file and phpinfo
just keeps on reporting the same thing.
Any insight? I've tried reboots and command prompt --> iisreset after I
make changes, to no avail.
- 13
- safe to delete elements of array in foreachAt Sun, 20 May 2007 10:23:31 -0400, Jerry Stuckle let his monkeys type:
>>>>
>>>> I'd think setting elements to NULL directly in the array isn't any
>>>> better,
>>>> you're still relying on the same 'feature'.
>>>>
>>>> Sh
>>> Yes, foreach() works on a copy. But while the manual indicates changes to
>>> the copy don't affect the original - they say nothing about when changes
>>> to the original will affect the copy.
>>>
>>
>> since its a copy the original should effect in any way the copy?
>>
>> I could only see this if the copy is not a deep copy.... but in php all
>> copies are deep?
>>
>>
>
> There is nothing indicating when the copy is updated from the original.
> It might be only at the beginning, everything through the loop or
> anything else.
>
> It's not documented - so you can't depend on the operation.
In fact, there may be a hint the array behaviour isn't as straightforward
as it seems in this case. Good point Jerry. As in this example:
http://www.thescripts.com/forum/thread631554.html where it appears at
least the array pointer (which seemed unaffected in my earlier test)
doesn't behave completely as one would expect if a foreach operated on a
totally isolated array copy.
Sh.
- 14
- PHP tutorials?any recommendations regarding a book that deals with PHP GD?
thank you.
|
| Author |
Message |
Shabam

|
Posted: 2004-3-2 0:54:36 |
Top |
php-general, php+mysql statement timing out
Ok I'm trying to run a php script written by someone else, not me, and it's
getting stuck in a particular step. Actually it isn't getting stuck per se,
but the browser is, because it's taking forever to return the results back
to the browser.
Here's the line that's responsible for this:
$users = $db->query_return_array("SELECT * FROM user");
It's getting stuck because in my database I have over 60,000 records. Now,
I'm just wanting to get over this step (it's an upgrade script), not looking
for fancy proper methods of php coding.
What alternative ways are there for me to prevent the browser from timing
out? I'm guessing some way of looping through the records, and updating the
client with simple update characters to prevent it from timing out.
Thanks in advance. :)
|
| |
|
| |
 |
John Smith

|
Posted: 2004-3-2 1:05:00 |
Top |
php-general >> php+mysql statement timing out
You could ad limit=10000 to the statement
echo a space
and run the query again and again
But are you sure this is the problem???
How long will it take the SQL server to get the data
The problem is probably somewhere else.
The greatest query I have is only 10.000 records but with severel inner and
left joins and the data gets sorted, this doesn't take more than a second on
my server.
And 6 seconds isn't by far long enough for a browser to time-out
"Shabam" <email***@***.com> schreef in bericht
news:email***@***.com...
> Ok I'm trying to run a php script written by someone else, not me, and
it's
> getting stuck in a particular step. Actually it isn't getting stuck per
se,
> but the browser is, because it's taking forever to return the results back
> to the browser.
>
> Here's the line that's responsible for this:
>
> $users = $db->query_return_array("SELECT * FROM user");
>
> It's getting stuck because in my database I have over 60,000 records.
Now,
> I'm just wanting to get over this step (it's an upgrade script), not
looking
> for fancy proper methods of php coding.
>
> What alternative ways are there for me to prevent the browser from timing
> out? I'm guessing some way of looping through the records, and updating
the
> client with simple update characters to prevent it from timing out.
>
> Thanks in advance. :)
>
>
>
>
|
| |
|
| |
 |
Shabam

|
Posted: 2004-3-2 1:24:00 |
Top |
php-general >> php+mysql statement timing out
"John Smith" <email***@***.com> wrote in message
news:c1vqgn$cpi$email***@***.com...
> You could ad limit=10000 to the statement
> echo a space
> and run the query again and again
>
> But are you sure this is the problem???
> How long will it take the SQL server to get the data
> The problem is probably somewhere else.
>
> The greatest query I have is only 10.000 records but with severel inner
and
> left joins and the data gets sorted, this doesn't take more than a second
on
> my server.
> And 6 seconds isn't by far long enough for a browser to time-out
I'm not an expert in all of this, but I'm sure it's getting stuck here:
$users = $db->query_return_array("SELECT * FROM user");
$totusers = $db->num_rows();
As for your proposed solution, how would I loop it 10,000 at a time, echo a
space, then requery to get the next 10,000, and then add it to the $users
array? It's vital the end array is the same, as latter code will need it.
Thanks.
|
| |
|
| |
 |
John Smith

|
Posted: 2004-3-2 2:25:00 |
Top |
php-general >> php+mysql statement timing out
"Shabam" <email***@***.com> schreef in bericht
news:email***@***.com...
> "John Smith" <email***@***.com> wrote in message
> news:c1vqgn$cpi$email***@***.com...
> > You could ad limit=10000 to the statement
> > echo a space
> > and run the query again and again
> >
> > But are you sure this is the problem???
> > How long will it take the SQL server to get the data
> > The problem is probably somewhere else.
> >
> > The greatest query I have is only 10.000 records but with severel inner
> and
> > left joins and the data gets sorted, this doesn't take more than a
second
> on
> > my server.
> > And 6 seconds isn't by far long enough for a browser to time-out
>
> I'm not an expert in all of this, but I'm sure it's getting stuck here:
>
> $users = $db->query_return_array("SELECT * FROM user");
> $totusers = $db->num_rows();
>
> As for your proposed solution, how would I loop it 10,000 at a time, echo
a
> space, then requery to get the next 10,000, and then add it to the $users
> array? It's vital the end array is the same, as latter code will need it.
> Thanks.
>
>
This might do the trick depending on the keys the array returns,
but I think this is some Unique Key from de DB so there should be no
problems with double keys.
I haven't tried it but I think it would work.
//Replace "$users = $db->query_return_array("SELECT * FROM user");" with
this code
echo "<!--";
$limit=100;
$users=array();
$temp_users = $db->query_return_array("SELECT * FROM user limit ".$limit);
while($count($temp_user)<$limit)
{
$users=array_merge($temp_users,$users)
$temp_users = $db->query_return_array("SELECT * FROM user limit ".$limit);
echo " ";
}
$users=array_merge($temp_users,$users)
echo "-->";
|
| |
|
| |
 |
Shabam

|
Posted: 2004-3-2 7:16:00 |
Top |
php-general >> php+mysql statement timing out
> //Replace "$users = $db->query_return_array("SELECT * FROM user");" with
> this code
> echo "<!--";
> $limit=100;
> $users=array();
> $temp_users = $db->query_return_array("SELECT * FROM user limit ".$limit);
> while($count($temp_user)<$limit)
> {
> $users=array_merge($temp_users,$users)
> $temp_users = $db->query_return_array("SELECT * FROM user limit
".$limit);
> echo " ";
> }
> $users=array_merge($temp_users,$users)
> echo "-->";
It doesn't work, even though I cleaned up some of the code errors. The line
"while($count($temp_user)<$limit)" should be
"while(count($temp_users)<$limit)", and even then it returns false on the
very first try because the count = 100 right off the bat.
Help?
|
| |
|
| |
 |
Doug Hutcheson

|
Posted: 2004-3-2 13:05:00 |
Top |
php-general >> php+mysql statement timing out
"Shabam" <email***@***.com> wrote in message
news:email***@***.com...
> > //Replace "$users = $db->query_return_array("SELECT * FROM user");" with
> > this code
> > echo "<!--";
> > $limit=100;
> > $users=array();
> > $temp_users = $db->query_return_array("SELECT * FROM user limit
".$limit);
> > while($count($temp_user)<$limit)
> > {
> > $users=array_merge($temp_users,$users)
> > $temp_users = $db->query_return_array("SELECT * FROM user limit
> ".$limit);
> > echo " ";
> > }
> > $users=array_merge($temp_users,$users)
> > echo "-->";
>
> It doesn't work, even though I cleaned up some of the code errors. The
line
> "while($count($temp_user)<$limit)" should be
> "while(count($temp_users)<$limit)", and even then it returns false on the
> very first try because the count = 100 right off the bat.
>
> Help?
>
>
I think you are trying to retrieve $limit records at a time from
your database and merge these into an array. Is that right?
If so, you really want to loop while the number of returned records
is equal to $limit. If the select fails, or returns fewer records,
you have either consumed all records or have hit an error.
I would recode it something like this (warning - aircode):
==========================================
echo "<!--";
$limit=100;
$users=array();
/*
* Set up a loop exit condition
*/
$not_done = true;
/*
* Loop until the condition is met
*/
while($not_done)
{
/*
* Retrieve a chunk of records and collapse gracefully on error
*/
$temp_users = $db->query_return_array("SELECT * FROM user limit
".$limit) or die ("Error retrieving records: ".dberrorblah..);
/*
* Perform the merge
*/
$users=array_merge($temp_users,$users)
/*
* Decide whether we have reached the end of the record set
*/
$not_done = $count($temp_user) == $limit ? true : false;
/*
* Extend our output string by one space
*/
echo " ";
}
echo "-->";
==========================================
Hope it helps.
Kind regards,
Doug
|
| |
|
| |
 |
John Smith

|
Posted: 2004-3-2 15:23:00 |
Top |
php-general >> php+mysql statement timing out
"Doug Hutcheson" <email***@***.com> schreef
in bericht news:RCU0c.148$email***@***.com...
> "Shabam" <email***@***.com> wrote in message
> news:email***@***.com...
> > > //Replace "$users = $db->query_return_array("SELECT * FROM user");"
with
> > > this code
> > > echo "<!--";
> > > $limit=100;
> > > $users=array();
> > > $temp_users = $db->query_return_array("SELECT * FROM user limit
> ".$limit);
> > > while($count($temp_user)<$limit)
> > > {
> > > $users=array_merge($temp_users,$users)
> > > $temp_users = $db->query_return_array("SELECT * FROM user limit
> > ".$limit);
> > > echo " ";
> > > }
> > > $users=array_merge($temp_users,$users)
> > > echo "-->";
> >
> > It doesn't work, even though I cleaned up some of the code errors. The
> line
> > "while($count($temp_user)<$limit)" should be
> > "while(count($temp_users)<$limit)", and even then it returns false on
the
> > very first try because the count = 100 right off the bat.
> >
> > Help?
> >
> >
>
> I think you are trying to retrieve $limit records at a time from
> your database and merge these into an array. Is that right?
>
> If so, you really want to loop while the number of returned records
> is equal to $limit. If the select fails, or returns fewer records,
> you have either consumed all records or have hit an error.
>
> I would recode it something like this (warning - aircode):
> ==========================================
> echo "<!--";
> $limit=100;
> $users=array();
> /*
> * Set up a loop exit condition
> */
> $not_done = true;
>
> /*
> * Loop until the condition is met
> */
> while($not_done)
> {
>
> /*
> * Retrieve a chunk of records and collapse gracefully on error
> */
> $temp_users = $db->query_return_array("SELECT * FROM user limit
> ".$limit) or die ("Error retrieving records: ".dberrorblah..);
>
> /*
> * Perform the merge
> */
> $users=array_merge($temp_users,$users)
>
> /*
> * Decide whether we have reached the end of the record set
> */
> $not_done = $count($temp_user) == $limit ? true : false;
>
> /*
> * Extend our output string by one space
> */
> echo " ";
> }
>
> echo "-->";
> ==========================================
>
> Hope it helps.
> Kind regards,
> Doug
>
> --
> Remove the blots from my address to reply
>
>
My mistake, I always take the first $limit and not the second $limit with
the second time,
I've changed 3 lines!!!
> > > //Replace "$users = $db->query_return_array("SELECT * FROM user");"
with
> > > this code
> > > echo "<!--";
> > > $limit=100;
$count=0;
> > > $users=array();
> > > $temp_users = $db->query_return_array("SELECT * FROM user limit
> ".$limit);
> > > while($count($temp_user)<$limit)
> > > {
> > > $users=array_merge($temp_users,$users)
> > >$temp_users = $db->query_return_array("SELECT * FROM user limit $count,
".$count+$limit);
$count+=$limit;
> > > echo " ";
> > > }
> > > $users=array_merge($temp_users,$users)
> > > echo "-->";
> >
|
| |
|
| |
 |
| |
 |
Index ‹ php-general |
- Next
- 1
- selling country domainshello friends,
i know this is a php list but i am confused thats why i am asking a bit off
topic.i have few .be domains and now i want to sell ,but i donot know where
to sell them.can you tell me the name of sites where i can sell my .be
domains.all domains are keyword rich and bears commercial value.
my domains collection include
domainaffiliates.be
hideurl.be
onlysoftwares.be
search-egine-optimisation.be
web-developement.be
website-designing.be
text-links.be
batchmates.be
xtremewebhosting.be
seoservice.be
ipbhosting.be
vbhosting.be
autoget.be
technologyguide.be
assemblers.be
askguru.be
webmastersfriend.be
internetriches.be
helpdeskreviews.be
techarticles.be
blog-link-generator.be
buyselldomains.be
searchenginefriendlyurls.be
mod-rewrite.be
websecurityservices.be
phpbbseo.be
ipbseo.be
vbulletinseo.be
seoindia.be
seoconsultant.be
i want to sell the above name,can u tell of the name of few sites where i
can sell these names.
- 2
- SessionsHi All,
I'm struggling with a session problem and I'm not sure where I should be
looking for the answer.
Most of my pages begin like this:
====================================
include_once('cfheader.php');
$feedback = cfHeader("Main Page");
//Start of page code
====================================
The cfheader.php file begins like this:
====================================
<?PHP
session_start();
function cfHeader($Title,$Protect=false)
{
$feedback="";
//IF we're loggin on then destory and get new session
if (IsSet($_POST['login']))
{
include_once('userreg.inc');
session_destroy(); //Destroy current session before continuing
$feedback =do_login();
}
if ($Protect==true && !IsSet($_SESSION['name']))
{
//No Session.
echo "<META HTTP-EQUIV='refresh' content='2;URL=mypage.php'>"; //Redirect
exit;
}
====================================
This works fine on my development PC, (PHP v 4.3.1) and on my primary test
site (PHP v4.2.2).
However when I try it on the target site (PHP v4.1.2) then I find that
immediately after starting the session everything works fine, however when I
move to any other page the session information is lost and I'm redirected to
log in again.
I was looking over the PHPInfo but to be honest I can't see what it is
that's different.
All help is gratefully appreciated.
regards,
Dave
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.497 / Virus Database: 296 - Release Date: 04/07/2003
- 3
- [PHP] PHP function for length of the array???At 15:44 6-1-04, you wrote:
>Hi!
>
> Anyone know what is the php function for finding the length of the array?
>I haven't found the answer at http://us3.php.net/manual/en/ref.array.php .
looking for the number of elements? -> count($arrayname)
- 4
- XML/HTML encoding?I'm doing some XML processing with PHP5
I'm using UTF-8 encoding
When I look at my xml doc it looks something like
<?xml version="1.0" ?>
<doc>
<text>dotted e (? works</text>
</doc>
(I hope you see a dotted e)
After xslt I end up with a html document with a souce that looks
something like
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>dotted e (? works</title>
</head>
<body>
Etc.....
This is what I want
But my browser displays "dotted e () works"
Because I don't want yes or no: Please tell me what (maybe obvious
thing) I'm doing wrong
Thanks
---
Vincent Jansen
- 5
- newbie: writing to php error/trace logHi,
I am using apache/php on linux. When hacking code, I usually have a separate
console window with 'tail -f phplog' so I can see what's going wrong.
What I'd really like to do is put debugging trace in my code that comes out
in the same log file. I RTFM'd but there doesn't seem to be any function to
do this.
failing that, is there a better way of working that I hadn't discovered?
many thanks
Andy
- 6
- #40613 [NEW]: Abort during PHP requestFrom: jblaguarigue at worldonline dot fr
Operating system: Windows XP
PHP version: 5.2.1
PHP Bug Type: *General Issues
Bug description: Abort during PHP request
Description:
------------
From version 5.2.0 to 5.2.1 my website doesn't have the same functioning.
After investigations, the problem provides from a lot of array DOM
encapsulations.
My site contains classes for HTML with a DOM structure and most of classes
are container type. This container is PHP array based.
The php script in version 5.2.1 crashes during the script, the same script
(with the same data) good works under 5.2.0.
Reproduce code:
---------------
abstract class Conteneur {
private $title;
protected $lstObj = array ();
protected $className;
protected $id;
protected $name;
abstract public function toHtml();
public function addObject($object) {
if (null != $object) {
array_push($this->lstObj, $object);
}
}
public function addObjects($objects){
foreach ($objects as $obj){
array_push($this->lstObj, $obj);
}
}
...
class Div extends Conteneur {
public function __construct($object = null, $className = null) {
$this->addObject($object);
$this->className = $className;
}
...
The crash provides during an addObject method call when adding an object
to the Div class.
Expected result:
----------------
The complete DOM encapsulation
Actual result:
--------------
White page, the PHP crashes
--
Edit bug report at http://bugs.php.net/?id=40613&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=40613&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=40613&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=40613&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=40613&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=40613&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=40613&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=40613&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=40613&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=40613&r=support
Expected behavior: http://bugs.php.net/fix.php?id=40613&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=40613&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=40613&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=40613&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=40613&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=40613&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=40613&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=40613&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=40613&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=40613&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=40613&r=mysqlcfg
- 7
- Posting a form to another script ?Is there a way to "post" a form to another php script? For example
input.php retrieves some user variables then posts the results to
another script , say form.php?
I know this can be done using perl's LWP by creating an agent. Let me
know if this makes sense or not? I know I can use GET, but I want to
avoid GET for some other reasons.
Thanks!
- 8
- Server crash -> free PHP source for everyone?! Bug or feature?I have read that it is impossible to get .PHP source from Web page.
Which is good, as PHP page can contain database passwords and other
sensitive data. However, yesterday, I have tried to access one of my
favourite web pages, and instead of web in IE, I got download option.
I downloaded given file... Well, to my suprise, it was some php code
from that page... How is that possible?
What if PHP engine crashes? Instead of parsing through it, web server
will forward pure php file? Isn`t that BIG security issue?
- 9
- script/binary that tracks links through logsdoes anyone know of a program/script that tracks incoming links from site
that youve traded links with. but not a simple php script that requires the
other site to link to www.mysite.com/links_in/12/ but some software that
analyses apache access logs for the referer field. this would mean the other
site would only have to link www.mysite.com and the script/program would do
the rest.
if theres none, im writing one.
- 10
- Import/export problem with CSV/PHP/MySQLHi to all,
I need to design an import/export system. Data comes from a filemaker
pro DB in a big CSV file. Some alterations are made on the data as it is
imported into my mysql table. Data is something like :id,text1html,
text1raw,... .
Problems :
1. Texts can contain html tags, including entities (" etc), so
using only the ';' as separator does not work.
2. Some line are so long that is appears php breaks them down, so I lose
data reading the file.
For 1, I've come across fgetcsv() in recent posts. Works fine for now.
For 2, I can't seem to find a solution. I've tried to detect "broken"
lines and stick them back together but no effect...
Another problem arises when I try to export the data back into CSV, as
it is suposed to be used in Excel. The CR/LF that are in the text are
logically interpreted as new rows in Excel. How can I get around this ?
Is there a special "new line" character that excel would not interpret
as new row ? Should I try another file format ?
Thanks in advance for any idea/hint/link !
BR,
Damien
---
"So you're just taking your caffeine level past the medical definition
of 'stimulant' into the 'poisons' category?"
Bastard Operator From Hell
- 11
- Format datetime with query?On Fri, 24 Aug 2007 01:23:53 +0200, MattMika <email***@***.com> wrote:
> Is there a way to format datetime (2007-08-23 07:00:00) into something
> like Aug. 23rd, 2007 7am within a query?
>
> A little explanation. This is an events table that is queried from a
> PHP class triggered from flash via AMFPHP, the mysql result is then
> sent back to Flash.
>
> I plan of having php forms to add, edit and delete entries in this
> table so was thinking I could just have a datetime field and a
> format_date field that would get a formatted version of the datetime
> when inserted or updated.
>
Is it MySQL? If so:
http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_date-format
--
Rik Wasmus
- 12
- how do you force Return-Path: variable in mail()?I am sending email using the mail() function on a hosted account. I am
trying to override the RETURN-PATH variable but it is not working. The
server keeps overriding the variable I put in.
Here's what I have:
....
$headers = "From: me <email***@***.com>\r\n"
$headers .= "Return-Path: me <email***@***.com>\r\n";
....
When I send one to myself and display full headers, it shows my
email***@***.com as the Return-Path. Obviously, this is not good.
Any ideas?
- 13
- error logging MySQL syntax errors?I am getting semi-ambiguous messages in the browser like:
> You have an error in your SQL syntax; check the manual that
> corresponds to your MySQL server version for the right syntax to use
> near '' at line 4
Is there a way in my PHP script to turn on a logging that is more
specific about which MySQL statement in the page is the problem? "line
4" certainly doesn't help.
Tim
- 14
- Thinking on a "Single Sign on" solution from a newbieHello,
Well, here I go with my thinking, like I say in the subject:
What a have:
- Fedora Linux+PHP4+MySQL
- QMAIL Mail Server
- 100+ users with login count for they mail boxes
- Horde framework + IMP for WebMail using IMAP
What a have to do or I WANT TO DO:
- Make 2 Web Sites - One with PHPBB Forum and another for uploads
files
- The 2 sites need login in for users
- I want to use they accounts in the mail servers!
The solution:
- I can to know if they are valid users in the mail server using the
PHP library IMAP.
- I going to copy the model of Microsoft Passport. The use SQL Sever
for the back end to keep the session, and they use a lot of site that
go to the same "site" to login, give a cookie to the client, make a
reference for that cookie in the database, and jump?
Well, this is just thinking?
What do you think?
Thank you in advance.
Carlos
- 15
- mySQL to connect in PHP in Windows?I'm using WinXP Pro, with Apache 1.3? and PHP5.
Then today I installed mySQL 2.0.49.
Technically it works. I can use the command line to create tables and
insert data, I can use WinmySQLAdmin to view processes, etc.
But when I make a test script in PHP, nothing happens.
For example:
$dbh = mysql_connect("localhost", "username", "password") or die("I
cannot connect to the database because: " . mysql_error());
Nothing happens. I don't even get the error message. So changing
"localhost" to the PC name and the IP address of course didn't work,
because PHP isn't seeming to be talking to mySQL.
I opened up my php.ini and uncommented the one and only line with
mysql.dll in it.
Is there something in Apache's httpd.conf, that might need to be
changed? I couldn't find any commented out mysql lines.
Thanks for any help!
Liam
|
|
|