| ftp_close() vs. ftp_quit() |
|
 |
Index ‹ php-general
|
- Previous
- 4
- $this->
Don Hobson wrote:
> I am looking at Chapter 8 of the phpunit pocket guide.
> http://www.phpunit.de/pocket_guide/3.0/en/test-first-programming.html
>
> Why do we have to use $this-> to access the $balance variable. There can
> only be one, right?
>
>
> class BankAccount
> {
> private $balance = 0;
>
> public function getBalance()
> {
> return $this->balance;
> }
Nope. The member variable $balance is different from the local
(function) variable $balance. So, consider this case:
class BankAccount
{
private $balance = 0;
public function setBalance($balance) {
$this->balance = $balance;
}
}
- 4
- Unkowingly Took PHP Job with undgodly PHP Gurus ...Need a good tutorial on Classes, OOP, Template systems, etc, because
absolutely nothing, and I mean nothing looks familiar to my
procedural based programming that has served me for years. Should I
even bother learning this stuff or just continue writing as I
normally do and have them inplement it into their system? Plus of
course they are all Linux Gods and I use Windows That doesn't help
either. Any really good tutorial out there that could get me up to
speed quick?
- 5
- [PHP] Deleting array fields...* Thus wrote Jason Giangrande (email***@***.com):
> Is there a way to delete array fields without resort the keys? The keys
> of this particular array are the position of the words it holds to their
> position in a string and if they are changed it screws everything up. I
> tried using array_splice but that, unfortunately, rearranges the keys.
> So, to reiterate, what I want to do is remove a key from an array but
> not have the keys automatically reassigned.
>
> Thanks,
> Jason Giangrande
unset($array['item']);
I don't think it rearranges it. perhaps the docs should mention this in
the array section. I only remember unset because of a big discussion
about its behavior a while back.
HTH,
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
- 5
- Problem with REQUEST_URII hope I'm not doing something really stupid .... but I can't get this
to work properly.
I'm using $_SERVER['REQUEST_URI'] to get the name of the *referring*
page for use in a custom 404 page.
All works hunky-dory (with an .htaccess script and so on) ... but the
value always seems to return the *current* page (ie. the actual error
page that the user lands on) - not the "from" (referring) page.
OK ... so I tried a simple page with a regular URL link to another
page. The value of $_SERVER['REQUEST_URI'] on that 2nd page was also
the name of that 2nd page - yet $_SERVER['HTTP_REFERER'] gives the
required value.
What am I missing (apart from brain cells!)?
Is there a way of determining the referring page on non-Apache
servers?
Adam.
- 6
- PHP 5.03 IIS 6 Oracle 9i connection help neededHi, I set up PHP 4.xx using Apache 1.3 on Windows XP to begin a
project. The project now needs to be moved to a real test box.
Admittedly, I am not quite sure how I was able to access Oracle on my
machine, but I know I have the Oracle client installed, have two odbc
DSNs (CAI/PT Oracle 8) installed and uncommented php_oci8.dll and
php_oracle.dll. Other than that, I kind of just played around until it
worked.
Now my code needs to be moved to a W2k3 IIS 6 machine. PHP 5.0.3 was
installed. The database is on a different server and is Oracle 9i.
Some of the same steps were followed, but I am not able to connect. I
want to have the proper connection procedures. Can someone outline the
steps I need to take, or provide a link to a tutorial for a setup
similar to this one?
Thanks,
Jay
- 8
- [PHP-DB] HELP!Why don't you post the code you are trying to work with and we could
help you from that point on.
Akmal wrote:
> I'm trying to create a guestbook and... I'm having trouble getting a certain
> amount of entries per page. Please help, a snippet of a code would be nice.
> Thanks!
>
> -Akmal-
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.547 / Virus Database: 340 - Release Date: 02/12/2003
>
--
Tyler Lane <email***@***.com>
Lyrical Communications
- 10
- [PHP] fgetcsvzhuravlev alexander wrote:
> Hello.
>
> I wonder if PHP has fgetcsv() function why doesn't
> PHP has fputcsv ?
>
> -- zhuravlev alexander
> u l s t u n o c
> (email***@***.com)
>
>
>
because it would be bloat, basically. We now have file_put_contents in
php5, which I like...but still view as bloat. You can easily enough use
fopen and fwrite to add content to the csv file.
- 10
- mail()Hi, I need to send a reminder to all the users in my website.
To minimize bandwidth I would like to send just an email to a domain and
then all the remaining users in the BCC.
What would be the $to field in mail() since I send all the destinations in
$headers?
Thanks.
--
*** s2r - public key: (http://leeloo.mine.nu/s2r-gmx.sig)
- 11
- passing args to php pageI have a php page[1] with 'includes'[2]. The page correctly
displays a calendar of the current month and current year if
$Month and $Year are not assigned, but if I try to call the page
with blog.php?Month=12&Year=2006 in the URL nothing seems to
change. Any ideas?
[1] blog.php
[snip html headers etc]
<?php
$Title= "Blog";
include( "calendar.php");
?>
[snip body and footers etc]
[2] calendar.php
<?php
if( !$Month) $Month= date( "m");
if( !$Year) $Year= date( "Y");
$Timestamp= mktime( 0, 0, 0, $Month, 1, $Year);
$MonthName= date( "F", $Timestamp);
print( "<table border=0 cellpadding=1 cellspacing=0 align=center>");
print( "<tr><td colspan=7 align=center>$MonthName</td></tr>");
print( "<tr>
<td>Su</td>
<td>Mo</td>
<td>Tu</td>
<td>We</td>
<td>Th</td>
<td>Fr</td>
<td>Sa</td>
</tr>\n");
$MonthStart= date( "w", $Timestamp);
if( $MonthStart == 0) {
$MonthStart= 7;
}
$LastDay= date( "d", mktime( 0, 0, 0, $Month+1, 0, $Year));
$StartDate= -$MonthStart;
for( $k=1; $k<=6; $k++) {
print( "<tr>");
for( $i=1; $i<=7; $i++) {
$StartDate++;
if( ( $StartDate<=0) || ( $StartDate>$LastDay)) {
print( "<td> </td>");
} elseif ( ( $StartDate>=1) && ($StartDate<=$LastDay)) {
print( "<td>$StartDate</td>");
}
}
print( "</tr>\n");
}
print( "</table>");
?>
--
Troy Piggins ,-O (o- O All your sigs are belong to us.
http://piggo.com/~troy O ) //\ O
RLU#415538 `-O V_/_ OOO
hackerkey://v3sw5HPUhw5ln4pr6OSck1ma9u6LwXm5l6Di2e6t5MGSRb8OTen4g7OPa3Xs7MIr8p7
- 11
- Skagen Ladies Watch 358XSSSMPD ReplicaSkagen Ladies Watch 358XSSSMPD Replica, Fake, Cheap, AAA Replica watch
Skagen Ladies Watch 358XSSSMPD Link : http://www.aaa-replica-watch.com/Skagen_358XSSSMPD.html
Buy the cheapest Skagen Ladies Watch 358XSSSMPD in toppest Replica .
www.aaa-replica-watch.com helps you to save money! Skagen-358XSSSMPD ,
Skagen Ladies Watch 358XSSSMPD , Replia , Cheap , Fake , imitation ,
Skagen Watches
Skagen Ladies Watch 358XSSSMPD Information :
Brand : Skagen Watches (http://www.aaa-replica-watch.com/
Replica_Skagen.html )
Gender :
Model : Skagen-358XSSSMPD
Case Material :
Case Diameter :
Dial Color :
Bezel :
Movement :
Clasp :
Water Resistant :
Crystal :
Our Price : $ 168.00
Availability: In StockSkagen Ladies Watch 358XSSSMPDStainless Steel
case with a Mesh Stainless Steel Bracelet. Mirrored polished steel
bezel. Mother of Pearl dial with silver tone hands and four sparkling
crystal hour markers. Scratch resistant mineral crystal. Precise
quartz movement. Case is 22mm wide and 5.5mm thick.Skagen Ladies Watch
358XSSSMPD is brand new, join thousands of satisfied customers and buy
your Skagen Ladies Watch 358XSSSMPD with total satisfaction . A
Haob2b.com 30 Day Money Back Guarantee is included with every Skagen
Ladies Watch 358XSSSMPD for secure, risk-free online shopping.
Haob2b.com does not charge sales tax for the Skagen Ladies Watch
358XSSSMPD, unless shipped within New York State. Haob2b.com is rated
5 stars on the Yahoo! network.
Skagen Ladies Watch 358XSSSMPD Replica, With the mix of finest
craftsmanship and contemporary styling, not only does it reflect the
time but also care you put into looking good. choose one to promote
your quality and make yourself impressive among people
Thank you for choosing www.aaa-replica-watch.com as your reliable
dealer of quality waches including Skagen Ladies Watch 358XSSSMPD . we
guarantee every watch you receive will be exact watch you ordered.
Each watch sold enjoy one year Warranty for free repair. Every order
from aaa-replica-watches is shipped via EMS, the customer is
responsible for the shipping fee on the first order, but since the
second watch you buy from our site, the shipping cost is free. Please
note that If the total amount of payment is over $600(USD), the
customer is required to contact our customer service before sending
the money in case failed payment. If you have any other questions
please check our other pages or feel free to email us by service@aaa-
replica-watch.com.
The Same Skagen Watches Series :
Skagen Squared Rose Gold Ladies Watch 396XSRR :
http://www.aaa-replica.com/skagen_squared_rose_gold_watch_396XSRR.html
Skagen Chronograph Men's Watch 331LSLB :
http://www.aaa-replica.com/skagen_chronograph_mens_watch_331LSLB.html
- 12
- [PHP] Parsing brackets in textDotan Cohen wrote:
> I need to replace text enclosed in brackets with links. How can I get
> that text, though? I've tried numerous variations of the following,
> with no success:
> $articleText=preg_replace('/\[[a-z]]/i' , makeLink($1), $articleText);
>
> I cannot get the text between the brackets send to the makeLink
> function. Could someone push me in the right direction? An example of
> the text would be:
> $articleText="Ajax is an acronym of Asynchronous [JavaScript] and [XML]";
>
> Where I'd like the strings "JavaScript" and "XML" sent to the makeLink
> function. Thanks in advance.
Don't know if this is your problem but you need to escape the trailing ]
as well:
preg_replace('/\[[a-z]\]/i', .....
--
Postgresql & php tutorials
http://www.designmagick.com/
- 12
- back on bug 42065 , strange behavior with ArrayObjectHi, at first, read that bug report : http://bugs.php.net/bug.php?id=42065
I would like to say that it doesn't seem to be fixed as it's said.
When I execute the bug 42065 test case, it still fails.
In reality, another code brought me to that bug, please consider this :
<?php
class a
{
public $array = array('key'=>'2');
public function getArray()
{
return $this->array;
}
}
$a = new a;
$tab = $a->getArray();
$tab['key'] = 5;
print_r($a);
print_r($tab);
Outputs :
a Object
(
[array] => Array
(
[key] => 2
)
)
Array
(
[key] => 5
)
No problem, that's expected.
Now consider that :
$a = new a;
$tab = new ArrayObject($a->getArray());
$tab['key'] = 5;
print_r($a);
print_r($tab);
Outputs :
a Object
(
[array] => Array
(
[key] => 5
)
)
ArrayObject Object
(
[key] => 5
)
So, the original array, inside the 'a' object has been modified, but it
souldn't have.
This behavior is like the one described in bug 42065
Plateform : Windows
PHP : latest 5.2 snapshot - Apache SAPI.
If you really want the original array not to be modified, you should act
like this :
$tab = new ArrayObject((array)$a->getArray());
Strange isn't it ?
- 12
- Problems when using PASSWORD( $pass) in PHP/MySqlHello.
I have a login pages with two fields. One for username and one for
password.
The username and password are stored in a mysql table.
When I am using plain-text password. It is no problem to login.
But when I use the PASSWORD() function, it is not possible to login at
all.
Is it because of the way I query the database?
I like to use the PASSWORD() function since it make a password like
"jad79daf78" to be similar to
"9834asfg25t4i930aga494asfd4faf444ijsd4457" in the password cell
instead of plain "jad79daf78"
Karl
- 13
- Upload ProgressDoes anyone know a way to make a file upload progress bar without using
cgi or patching php with additional functions?
- 13
- need to close stdin pipe from proc_open() before reading stdout pipe??Hi!
I want to read/write commands and program input to/from /bin/bash
several times before I close the stdin pipe. However, reading
from cat hangs unless I first close the stdin pipe.
<?php
$descriptorspec = array(
0 => array("pipe", "r"), // stdin is a pipe that the child
will read from
1 => array("pipe", "w"), // stdout is a pipe that the child
will write to
2 => array("pipe", "w") // stderr
);
$process = proc_open("/bin/bash", $descriptorspec, $pipes);
if (is_resource($process)) {
// $pipes now looks like this:
// 0 => writeable handle connected to child stdin
// 1 => readable handle connected to child stdout
// 2 => readable handle connected to child stderr
echo rand()," cat...<br>\n";
flush();
fwrite($pipes[0], "cat\n");
#
sleep(1);
echo rand()," hallo...<br>\n";
flush();
fwrite($pipes[0], "hallo<br>\n");
fflush($pipes[0]); # fflush() doesn't help
# ********* I don't want to fclose stdin here
fclose($pipes[0]);
echo rand()," reading stdout...<br>\n";
flush();
while(!feof($pipes[1])) {
echo fgets($pipes[1], 1024);
}
echo rand()," reading stderr...<br>\n";
flush();
while(!feof($pipes[2])) {
echo fgets($pipes[2], 1024);
}
# ********* I want to fclose stdin here, but reading from stdin
above will hang then
#
fclose($pipes[0]);
fclose($pipes[1]);
fclose($pipes[2]);
// It is important that you close any pipes before calling
// proc_close in order to avoid a deadlock
$return_value = proc_close($process);
echo "command returned $return_value\n";
}
?>
--
Webspace; Low end Serverhousing ab 15 e, etc.: http://www.bksys.at
Linux Admin/Programmierer: http://bksys.at/bernhard/services.html
|
| Author |
Message |
Markus

|
Posted: 2007-5-21 19:34:50 |
Top |
php-general, ftp_close() vs. ftp_quit()
Hi
I encountered that FTP connections seem to remain open on the FTP
server, though my FTP class has a shutdown function that ftp_quit()s the
connection.
I did not find any info in the manual regarding the differences of
ftp_close() and ftp_quit(). Do I have to use ftp_close()? Or even first
close, then quit? Is it possible that ftp_quit() does not close the
connection on the FTP server? Or do I have to look for something else?
Thanks for some hints!
Markus
|
| |
|
| |
 |
purcaholic

|
Posted: 2007-5-21 19:55:00 |
Top |
php-general >> ftp_close() vs. ftp_quit()
On 21 Mai, 13:34, Markus <derernst@NO#SP#AMgmx.ch> wrote:
> Hi
>
> I encountered that FTP connections seem to remain open on the FTP
> server, though my FTP class has a shutdown function that ftp_quit()s the
> connection.
>
> I did not find any info in the manual regarding the differences of
> ftp_close() and ftp_quit(). Do I have to use ftp_close()? Or even first
> close, then quit? Is it possible that ftp_quit() does not close the
> connection on the FTP server? Or do I have to look for something else?
>
> Thanks for some hints!
> Markus
Hi,
ftp_close() and ftp_quit() do the same job, ftp_quit() is an alias of
ftp_close().
The function ftp_close() needs the connetion ressource id as parameter
to close a earlier opened connection. Maybe you call ftp_close without
a ressource id or with a wrong ressource id, this could be a reason of
remained ftp connections.
purcaholic
|
| |
|
| |
 |
Markus

|
Posted: 2007-5-21 21:50:00 |
Top |
php-general >> ftp_close() vs. ftp_quit()
purcaholic schrieb:
> On 21 Mai, 13:34, Markus <derernst@NO#SP#AMgmx.ch> wrote:
>> Hi
>>
>> I encountered that FTP connections seem to remain open on the FTP
>> server, though my FTP class has a shutdown function that ftp_quit()s the
>> connection.
>>
>> I did not find any info in the manual regarding the differences of
>> ftp_close() and ftp_quit(). Do I have to use ftp_close()? Or even first
>> close, then quit? Is it possible that ftp_quit() does not close the
>> connection on the FTP server? Or do I have to look for something else?
>>
>> Thanks for some hints!
>> Markus
>
>
> Hi,
>
> ftp_close() and ftp_quit() do the same job, ftp_quit() is an alias of
> ftp_close().
Thank you for this info. It is bad news for me, as it does contradict my
assumptions regarding my actual problem. Anyway both functions seem to
be wrongly documented in the manual:
void ftp_close ( resource $ftp_stream )
int ftp_quit ( int $ftp_stream )
As the signatures differ, they do not really seem to be aliases of one
another. But actually they seem to behave the same, both not according
to the manual: var_dump(ftp_close($conn_id)) and
var_dump(ftp_quit($conn_id)) both display bool(true)... I filed a bug
about this.
Anyway: Is there a possibility to find out whether a connection has been
terminated on the FTP server side, too? (I mean, besides asking the ISP
to give me access to log files.)
|
| |
|
| |
 |
Schraalhans Keukenmeester

|
Posted: 2007-5-21 22:51:00 |
Top |
php-general >> ftp_close() vs. ftp_quit()
At Mon, 21 May 2007 13:34:50 +0200, Markus let his monkeys type:
> Hi
>
> I encountered that FTP connections seem to remain open on the FTP
> server, though my FTP class has a shutdown function that ftp_quit()s the
> connection.
>
> I did not find any info in the manual regarding the differences of
> ftp_close() and ftp_quit(). Do I have to use ftp_close()? Or even first
> close, then quit? Is it possible that ftp_quit() does not close the
> connection on the FTP server? Or do I have to look for something else?
>
> Thanks for some hints!
> Markus
How exactly did you assert the connection wasn't closed after ftp_close()?
Just tried it on my localhost and my isp's server, in both cases the
connection is closed according to the vsftpd log (localhost) and the Plesk
Control Panel (isp).
Where did you find the types involved with ftp_quit()?
The dutch php manual mirrors don't give any return and parameter
type for ftp_quit():
http://nl2.php.net/manual/en/function.ftp-quit.php
http://nl2.php.net/manual/en/function.ftp-close.php
Sh.
|
| |
|
| |
 |
Markus

|
Posted: 2007-5-21 23:28:00 |
Top |
php-general >> ftp_close() vs. ftp_quit()
Schraalhans Keukenmeester schrieb:
> At Mon, 21 May 2007 13:34:50 +0200, Markus let his monkeys type:
>
>> Hi
>>
>> I encountered that FTP connections seem to remain open on the FTP
>> server, though my FTP class has a shutdown function that ftp_quit()s the
>> connection.
>>
>> I did not find any info in the manual regarding the differences of
>> ftp_close() and ftp_quit(). Do I have to use ftp_close()? Or even first
>> close, then quit? Is it possible that ftp_quit() does not close the
>> connection on the FTP server? Or do I have to look for something else?
>>
>> Thanks for some hints!
>> Markus
>
> How exactly did you assert the connection wasn't closed after ftp_close()?
> Just tried it on my localhost and my isp's server, in both cases the
> connection is closed according to the vsftpd log (localhost) and the Plesk
> Control Panel (isp).
It is a guess. I located the delays in the PHP script in the ftp login
command, and I encountered the same delays connecting to the ftp server
with FileZilla, and the delays occur only after the PHP script had been
running some times. So my conclusion was that something in my script
slows down the ftp server; I don't know much about ftp, and assumed this
could possibly be open connections that are only closed after the
timeout period. I will ask my ISP how to access the ftp log to find out
more.
> Where did you find the types involved with ftp_quit()?
> The dutch php manual mirrors don't give any return and parameter
> type for ftp_quit():
> http://nl2.php.net/manual/en/function.ftp-quit.php
> http://nl2.php.net/manual/en/function.ftp-close.php
Yes I also found the correct documentations in the english version of
the manual; the errors are in the german version. Sorry for this badly
researched statement.
|
| |
|
| |
 |
Kim AndrAker

|
Posted: 2007-5-21 23:35:00 |
Top |
php-general >> ftp_close() vs. ftp_quit()
Markus wrote:
> purcaholic schrieb:
> >On 21 Mai, 13:34, Markus <derernst@NO#SP#AMgmx.ch> wrote:
> > > Hi
> > >
> > > I encountered that FTP connections seem to remain open on the FTP
> > > server, though my FTP class has a shutdown function that
> > > ftp_quit()s the connection.
> > >
> > > I did not find any info in the manual regarding the differences of
> > > ftp_close() and ftp_quit(). Do I have to use ftp_close()? Or even
> > > first close, then quit? Is it possible that ftp_quit() does not
> > > close the connection on the FTP server? Or do I have to look for
> > > something else?
> > >
> > > Thanks for some hints!
> > > Markus
> >
> >
> > Hi,
> >
> > ftp_close() and ftp_quit() do the same job, ftp_quit() is an alias
> > of ftp_close().
>
> Thank you for this info. It is bad news for me, as it does contradict
> my assumptions regarding my actual problem. Anyway both functions
> seem to be wrongly documented in the manual:
>
> void ftp_close ( resource $ftp_stream )
> int ftp_quit ( int $ftp_stream )
>
> As the signatures differ, they do not really seem to be aliases of
> one another. But actually they seem to behave the same, both not
> according to the manual: var_dump(ftp_close($conn_id)) and
> var_dump(ftp_quit($conn_id)) both display bool(true)... I filed a bug
> about this.
Which manual have you been reading? These are the only official manual
entries for ftp_quit() and ftp_close():
http://php.net/ftp_quit
http://php.net/ftp_close
Both should, and they do, return a boolean value (TRUE on success or
FALSE on failure) according to your own tests (and since ftp_quit() is
an alias for ftp_close(), there shouldn't be a difference, either).
> Anyway: Is there a possibility to find out whether a connection has
> been terminated on the FTP server side, too? (I mean, besides asking
> the ISP to give me access to log files.)
There's no way of telling, much like there's no way of telling whether
the connection to a web server was properly closed on the server side
after you've visited a website.
The only way of telling whether a connection has been terminated on the
server side, is to ask the administrator or owner of the server you're
connecting to.
--
Kim Andr?Aker?
- email***@***.com
(remove NOSPAM to contact me directly)
|
| |
|
| |
 |
ED

|
Posted: 2007-5-22 17:41:00 |
Top |
php-general >> ftp_close() vs. ftp_quit()
"Markus" <derernst@NO#SP#AMgmx.ch> wrote in message
news:46517c0c$email***@***.com...
> Hi
>
> I encountered that FTP connections seem to remain open on the FTP server,
> though my FTP class has a shutdown function that ftp_quit()s the
> connection.
>
> I did not find any info in the manual regarding the differences of
> ftp_close() and ftp_quit(). Do I have to use ftp_close()? Or even first
> close, then quit? Is it possible that ftp_quit() does not close the
> connection on the FTP server? Or do I have to look for something else?
>
> Thanks for some hints!
> Markus
hi Markus,
Just a thought, but maybe try sending an FTP QUIT command to the server
before closing the conn - it may give the server the hint to close its
connection(s):
ftp_raw($ftpconn, 'QUIT');
ftp_close($ftpconn);
cheers,
ED
|
| |
|
| |
 |
Markus

|
Posted: 2007-5-22 18:26:00 |
Top |
php-general >> ftp_close() vs. ftp_quit()
ED schrieb:
> "Markus" <derernst@NO#SP#AMgmx.ch> wrote in message
> news:46517c0c$email***@***.com...
>> Hi
>>
>> I encountered that FTP connections seem to remain open on the FTP server,
>> though my FTP class has a shutdown function that ftp_quit()s the
>> connection.
>>
>> I did not find any info in the manual regarding the differences of
>> ftp_close() and ftp_quit(). Do I have to use ftp_close()? Or even first
>> close, then quit? Is it possible that ftp_quit() does not close the
>> connection on the FTP server? Or do I have to look for something else?
>>
>> Thanks for some hints!
>> Markus
>
>
> hi Markus,
>
> Just a thought, but maybe try sending an FTP QUIT command to the server
> before closing the conn - it may give the server the hint to close its
> connection(s):
>
> ftp_raw($ftpconn, 'QUIT');
> ftp_close($ftpconn);
Thank you, good point! As ftp_raw() is PHP5 only and the application is
supposed to run from PHP 4.3 upwards, I added reduction of the timeout
period, so the number of possibly open connections on the server should
be reduced to a reasonable amount:
if (function_exists('ftp_raw')) {
ftp_raw($ftpconn, 'QUIT');
}
else {
ftp_set_option($ftpconn, FTP_TIMEOUT_SEC, 1);
}
ftp_close($ftpconn);
|
| |
|
| |
 |
| |
 |
Index ‹ php-general |
- Next
- 1
- [PHP] PHP MySQL Insert SyntaxInsert is for a new row
Alter or Update is for an exsisting row
/*I'm trying to insert values from an array into MySQL DB but the insert
begins at the last record in the table and not at first record in the table.
I have added the cellSuffixes column after I already populated 30 records in
other columns*/
Code:
foreach($list as $key=>$value)
{
$query = "INSERT INTO carriers (cellSuffixes) VALUES('$value')";
mysql_query($query,$connex) or die("Query failed: ".
mysql_error($connex));
}
echo "done";
mysql_close($connex);
//I don't know what the sytax s/b to get the data to be inserted in the
first row of the column.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
- 2
- #40373 [NEW]: calling "print()" on an ArrayObject fails silently.From: james at thundermonkey dot net
Operating system: WinXP SP2
PHP version: 5.2.0
PHP Bug Type: SPL related
Bug description: calling "print()" on an ArrayObject fails silently.
Description:
------------
When attempting to "print()" an ArrayObject (rather than "print_r()") no
ouput is returned, no errors are displayed and the script aborts silently.
Reproduce code:
---------------
<?php
$x = new ArrayObject(array('a', 'b'));
print $x;
print "Reached this point!";
exit();
/* in php.ini: error_reporting = E_ALL | E_STRICT */
?>
Expected result:
----------------
*Some kind of error message saying that the ArrayObject couldn't be
converted to a string followed by:*
Reached this point!
Actual result:
--------------
(no output at all)
--
Edit bug report at http://bugs.php.net/?id=40373&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=40373&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=40373&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=40373&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=40373&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=40373&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=40373&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=40373&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=40373&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=40373&r=support
Expected behavior: http://bugs.php.net/fix.php?id=40373&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=40373&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=40373&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=40373&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=40373&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=40373&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=40373&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=40373&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=40373&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=40373&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=40373&r=mysqlcfg
- 3
- "No input file specified."
As an experiment I wrote a simple C program that invokes
PHP using system(), but I'm getting an error "No input file
specified.".
What I do is:
setenv ("REQUEST_METHOD", "GET", 1);
setenv ("QUERY_STRING", "abc=123", 1);
and then I invoke PHP thus:
system "/usr/local/bin/php myfile.php < dummyfile > foo";
where dummyfile is either empty or just contains the line
"abc=123".
Yet, I get this error. No finnagling is fix it.
Can anyone explain why this is happening?
Thanks,
333
- 4
- O.T. web site contractor wantedHello,
I'm looking for a web site contractor to redo my site from scratch.
Although i know Html, Css, and enough Php to get me by without looking at
the manual to many times, i do not have the time right now to redo the site
although the need is great. I am looking for a standards-compliant Strict
Xhtml 1.0 and Css site, with Php support for the dynamic portions. I am not
looking for Javascript, Flash, or frames. I can provide additional details
if interested in the job, but i see a 10-page site max, with myself taking
over maintaining it. If interested please include an estimate.
Thanks.
Dave.
- 5
- [PHP] Recomended Shopping Cartson 10/9/03 15:27, Adrian Esteban Madrid at email***@***.com wrote:
> I need to setup a shopping cart (SP) for a client and time/budget calls
> for a premade SP. I've checked hotscripts.com and google and it seems to
> me that there are as many SP in PHP as CMS or Frameworks in PHP, in
> other words, too many to review. I've heard complaints about osCommerce
> as being nice but too hard to modify to your needs. Are there any
> recomendations on SP that you actually use in medium to large projects
> and you were happily surprised?
>
> Thanks in advance,
I really like eShox, check it out at http://www.eshox.com, it's based on
osCommerce, but it's quite a lot better.. actually a whole lot better! It's
$299 and the support you get for it is amazing also.. Every person that I
know of that has used their support has been more than pleased.. almost
embarrassingly pleased :)
Cheers!
Rick
"If a man is called to be a streetsweeper, he should sweep streets even as
Michelangelo painted, or Beethoven composed music, or Shakespeare composed
poetry. He should sweep streets so well that all the hosts of heaven and
earth will pause to say, "Here lived a great streetsweeper who did his job
well." - Dr. Martin Luther King, Jr.
- 6
- xml won't parse....I'm pretty much an xml newbie....
And I'm stumped.
The following bit of XML barfs with Invalid document end at line 9:
<?xml version="1.0" ?>
<l0>
<zncol>7</zncol>
<speed>8</speed>
<length>2400</length>
<depth>0.5</depth>
<currentField>103</currentField>
<xcol>1</xcol>
</l0>
<l1>
<brgf1>0.000</brgf1>
<brgt1>0.000</brgt1>
<axa1>0</axa1>
<axb1>2</axb1>
<axc1>4</axc1>
<axd1>6</axd1>
</l1>
And I have no idea why....
I've used two completely different parsers and both barf...
This particular one I copied from http://us2.php.net/manual/en/ref.xml.php
Example 1.... So it should be good....
It barfs on my target - an ARM running a self-compiled php4 and my home
box, i386-box running debian php5.... So it's not platform based.
Any ideas?
--
o__
,>/'_ o__
(_)\(_) ,>/'_ o__
Yan Seiner, PE (_)\(_) ,>/'_ o__
Certified Personal Trainer (_)\(_) ,>/'_ o__
Licensed Professional Engineer (_)\(_) ,>/'_
Who says engineers have to be pencil necked geeks? (_)\(_)
- 7
- Need PHP help ASAP!
Hi, i'm having trouble running a shout script that i bought with a game.
If anyone is willing to help, please contact me below. Thanks!
MSN: email***@***.com
AIM: Manners10000
E-mail: email***@***.com
##-----------------------------------------------#
Article posted from PHP Freaks NewsGroup
http://www.phpfreaks.com/newsgroup
Get Addicted: php.genera
##-----------------------------------------------##
- 8
- Getting orientation of a PDF fileHi,
I'm using PHP 4.4.4. How (if possible) would I get the orientation
(either portrait or landscape) of a PDF file using PHP?
Thanks, - Dave
- 9
- Question about referencesI have a question about refrences.
I know if you have a function that returns an array and you designate
it and its recipient by "at" signs the reference is included.
/*** SAMPLE 1 *********/
function &refer_this(){ return array(1, 2, 3); };
$my_var =& $refer_this();
/***** END SAMPLE 1 **********/
What about situations where there isn't an equal sign to ampersand? for
instance if you include the array in an array directly? or as a
parameter in another function?
/********* SAMPLE 2 ***********/
$my_array = array(4, refer_this(), 6);
/********** SAMPLE 3 ************/
function &refer_that(&$ele1, $ele2, $ele3)
{
return array($ele1, $ele2, $ele3);
}
$my_other_array =& refer_that(refer_this(), 8, 9);
/******* END SAMPLES ***************/
is the referential integrity maintained in these cases?
- 10
- [PHP] Testing people
On Thu, 2006-10-05 at 03:36 -0700, Ryan A wrote:
> Hey all,
>
> this is a two part question but I need just one solution:
>
Done. Go to http://avoir.uwc.ac.za/ and download Kewl.NextGen. Then
install it and use the moduleadmin to install MCQ (multiple Choice
Questions) module. It does everything (and more) that you need.
If you need help, join either (or both) the users list and the
developers list.
--Paul
All Email originating from UWC is covered by disclaimer http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm
- 11
- Compiling PHP Extensions in Visual C++Hi,
I'm busy porting a PHP-Extension written by the company I work for from
Linux to Win32 (XP).
Everything worked fine. I fixed the errors and warnings, copied the dll
to the extensions directory, entered the dll as extension into php.ini
and this is, where trouble starts.
When PHP is called on apache starting up, it throws an error at me
saying "Unknown(): Unable to load dynamic library '...' Module not found.
Then I browsed through the source code of the extensions, that are
included in the php-4.3.6-sources, to figure out, what they are doing
different - and at this point, the story gets weird:
I compiled the bz2-Project (no errors, no warnings), and replaced
php_bz2.dll in the extensions-Folder with the version I just compiled -
resulting in the same "Unknown(): ..." Error-Message for php_bz2.dll (of
course I checked, that the original indeed works).
Has anyone heard of this problem before?
TIA
Sebastian Morawietz
- 12
- [PHP-INSTALL] Any ideas how to get this to work??This is a multi-part message in MIME format.
I'm new, i'm confused and I am stuck...The following code came in a web app I just bought... I keep getting the error code "Critical error: Unable to load CodeCrypter module."
I understand "dl" does not work on xp any ideas how I can work around the @dl and get this to work???
<?php
if(!function_exists("cc_output"))
{ $cc_module = "cc.".strtolower(substr(php_uname(),0,3)).".".phpversion().".cc"; if (strtolower(substr(php_uname(), 0, 7)) == "windows")
{ $fl_dir = substr(getcwd(), 3); }
else
{ $fl_dir = getcwd(); }
$cc_path = str_repeat("../", 14).$fl_dir."/"; @dl($cc_path."cc/".$cc_module); while(!function_exists("cc_output") && (strlen($cc_path)>0)) { $cc_path = substr($cc_path,0,strlen($cc_path)-1); @dl($cc_path."cc/".$cc_module); }
if (!function_exists("cc_output"))
{ echo "Critical error: Unable to load CodeCrypter module."; exit; } }
cc_output("qwcYS+Sy7Ghqcyl+gICGkjel79N/g4mhrAcVP706rg11XyNpO7QiacNM5K8QMJCwQsZV/ etc....etc... etc
other relevant info...
OS= XP
apache
php 4.1.1
I'd appreciate any help i could get with this, support is almost non existant and if I can't figure it out I'm out about $600......
Thank
Melissa
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1226" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>I'm new, i'm confused and I am stuck...The
following code came in a web app I just bought... I keep getting the error code
"Critical error: Unable to load CodeCrypter module."</FONT></DIV>
<DIV><FONT face=Arial size=2> I understand "dl" does not work on xp any
ideas how I can work around the @dl and get this to work???</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><?php </FONT></DIV>
<DIV><FONT face=Arial size=2>if(!function_exists("cc_output"))</FONT></DIV>
<DIV><FONT face=Arial size=2> { $cc_module =
"cc.".strtolower(substr(php_uname(),0,3)).".".phpversion().".cc"; if
(strtolower(substr(php_uname(), 0, 7)) == "windows") </FONT></DIV>
<DIV><FONT face=Arial size=2>
{ $fl_dir = substr(getcwd(), 3); } </FONT></DIV>
<DIV><FONT face=Arial size=2>else </FONT></DIV>
<DIV><FONT face=Arial size=2> { $fl_dir =
getcwd(); } </FONT></DIV>
<DIV><FONT face=Arial size=2>$cc_path = str_repeat("../",
14).$fl_dir."/";
@dl($cc_path."cc/".$cc_module);
while(!function_exists("cc_output") &&
(strlen($cc_path)>0))
{ $cc_path =
substr($cc_path,0,strlen($cc_path)-1);
@dl($cc_path."cc/".$cc_module); }
</FONT></DIV>
<DIV><FONT face=Arial size=2>if
(!function_exists("cc_output")) </FONT></DIV>
<DIV><FONT face=Arial size=2>{ echo
"Critical error: Unable to load CodeCrypter
module."; exit;
} }</FONT></DIV>
<DIV><FONT face=Arial
size=2>cc_output("qwcYS+Sy7Ghqcyl+gICGkjel79N/g4mhrAcVP706rg11XyNpO7QiacNM5K8QMJCwQsZV/
etc....etc... etc</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>other relevant info...</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>OS= XP</FONT></DIV>
<DIV><FONT face=Arial size=2>apache </FONT></DIV>
<DIV><FONT face=Arial size=2>php 4.1.1</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I'd appreciate any help i could get with this,
support is almost non existant and if I can't figure it out I'm out about
$600......</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thank </FONT></DIV>
<DIV><FONT face=Arial size=2>Melissa</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV><?/fontfamily></BODY></HTML>
- 13
- 14
- Xampp question, pretty much 0T
Hello!
I have been using XAMPP for quite some time now (thanks to the recommendations from this list) without any real complaints...
and the only reason I am writing here is because i am sure a lot of you guys run the same thing considering the amount of people who recommended it to me when I asked for an easy install of AMP.
It was easy to install and has given me months of hassle free use... but today i have started facing some strange problems of everytime I start Apache... it crashes my laptop, anybody else run into this?
I use this only for PHP, no perl.
My config:
Win Vista home premium with all updates and patches (genuine, not pirate copy)
core2 duo 2ghz
2 gigs ram
Nothing installed today for it to be acting up so.
Do you suggest I reinstall? or can I just reinstall Apache in some way? If i have to reinstall is there an easy way of backing up my stuff and then reinstalling then putting my stuff back? (I know i can just copy the files that were in the htdocs... but am talking about an easy way to copy the files and the DBs and put them back... or is that just wishful thinking?
TIA,
Ryan
------
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
- 15
- Sending email directly to Outlook instead through ISP's SMTP server.Hello
Is it possible to configure Apache or PHP to send an email created via
PHP script directly to MS Outlook on my computer?
Would I need to install a local SMTP server?
I want to avoid using the SMTP server of my ISP. It is only for testing
purposes.
Your help will be appreciated.
Bundy
|
|
|