php-general Digest 1 Aug 2007 07:21:28 -0000 Issue 4936
Topics (messages 259952 through 259971):
Re: Pirate PHP books online?
259952 by: Ryan A
259953 by: Ryan A
259955 by: Stut
259957 by: Ryan A
259960 by: David Powers
259961 by: Tijnema
259962 by: tedd
259965 by: Robert Cummings
Problem with filemtime
259954 by: Kevin Murphy
259956 by: Stut
259958 by: Eddie Dunckley
Re: Reading registry values
259959 by: \"Crash\" Dummy
259970 by: Travis D
Re: headers-excel file-bad data
259963 by: tedd
Re: Job Opportunity: PHP Developer
259964 by: tedd
259967 by: Michael Preslar
Re: Profile / Debug w/o server modification?
259966 by: Instruct ICC
subtitute of mysql_error()
259968 by: Patrik Hasibuan
I am confused to mysql_query.
259969 by: Patrik Hasibuan
Re: Unexpected values in an associative array
259971 by: Travis D
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 ---
> > Yes, but that's why it's called faith.
>
> My point was that it makes no sense to try and prove
> or demonstrate
> anything using God because the existance of God
> itself cannot be proven
> or demonstrated.
Stut,
There will be a demonstration of god's existance in a
little while, please look up when you are burning and
I am sipping nector.
Sorry, couldnt resist, no offense meant ;)
Cheers!
R
------
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)
____________________________________________________________________________________
Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel
and lay it on us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7
--- End Message ---
--- Begin Message ---
> >>You have a right to your belief, but that doesn't
> make your belief right.
> >
> >This works both ways.
>
> Oh yeah, well my dad can beat up your dad.
Well, get both your dads together coz my dad can beat
both of them up.
Reasoning, I'm pretty young compared to most of you
guys so my dad is younger than your dads.... plus i'll
secretly give him a baseball bat... ;)
Cheers!
R
P.S no guns allowed in this discussion
------
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)
____________________________________________________________________________________
Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel
and lay it on us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7
--- End Message ---
--- Begin Message ---
Ryan A wrote:
Yes, but that's why it's called faith.
My point was that it makes no sense to try and prove
or demonstrate
anything using God because the existance of God
itself cannot be proven
or demonstrated.
Stut,
There will be a demonstration of god's existance in a
little while, please look up when you are burning and
I am sipping nector.
That would also be the day the devil drives to work in a snow plough right?
Sorry, couldnt resist, no offense meant ;)
None taken. My beliefs are my beliefs and yours are yours, and you are
entitled to say anything you want, as am I. If you prefer to lead a
blinkered life go ahead, but I prefer to use my head to find my way
through life rather than live by the "teachings" of a bunch of fiction
written by men.
If this "God" really thinks that makes me unworthy that's its business.
I really don't want anything to do with any entity that thinks like that.
-Stut
--
http://stut.net/
--- End Message ---
--- Begin Message ---
Hey!
> > Sorry, couldnt resist, no offense meant ;)
>
> None taken. My beliefs are my beliefs and yours are
> yours
Yep, and what I said was in jest, and you took it in
jest.End of discussion between us :)
Am just replying to anyone else who's reading this,
please lets not fork this into a god discussion too ;)
Cheers!
Ryan
------
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)
____________________________________________________________________________________
Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel
and lay it on us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7
--- End Message ---
--- Begin Message ---
Larry Garfield wrote:
If a plumber fixes your toilet, he gets paid once.
A plumber came recently to fix our hot water system. It took him less
than one hour. He got paid about $100.
If a writer writes a book, he gets paid n times, where n is a (hopefully for
him) ever-increasing number.
I write a book (actually, I've written several). It takes me on average
seven or eight months' full-time work. You buy a copy of my book, I get
$1.50-$2.25. For me to get the same rate of pay as a plumber, I would
need to sell 70,000 copies of each book. I should be so lucky.
David Powers
--- End Message ---
--- Begin Message ---
On 8/1/07, David Powers <[EMAIL PROTECTED]> wrote:
> Larry Garfield wrote:
> > If a plumber fixes your toilet, he gets paid once.
>
> A plumber came recently to fix our hot water system. It took him less
> than one hour. He got paid about $100.
>
> > If a writer writes a book, he gets paid n times, where n is a (hopefully for
> > him) ever-increasing number.
>
> I write a book (actually, I've written several). It takes me on average
> seven or eight months' full-time work. You buy a copy of my book, I get
> $1.50-$2.25. For me to get the same rate of pay as a plumber, I would
> need to sell 70,000 copies of each book. I should be so lucky.
>
> David Powers
Yes, and the president gets a lot more....
Tijnema
--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info
--- End Message ---
--- Begin Message ---
At 9:21 AM -0500 7/31/07, Larry Garfield wrote:
Disclaimer: Yes, I was raised by a pair of college history professors. :-)
Ahhh, that explains it.
Cheers,
tedd
PS: I'm done.
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
On Tue, 2007-07-31 at 14:29 -0700, Ryan A wrote:
> Hey!
>
> > > Sorry, couldnt resist, no offense meant ;)
> >
> > None taken. My beliefs are my beliefs and yours are
> > yours
>
> Yep, and what I said was in jest, and you took it in
> jest.End of discussion between us :)
>
> Am just replying to anyone else who's reading this,
> please lets not fork this into a god discussion too ;)
Some light humour:
http://www.unm.edu/~humanism/socvsjes.htm
Cheers,
Rob.
--
...........................................................
SwarmBuy.com - http://www.swarmbuy.com
Leveraging the buying power of the masses!
...........................................................
--- End Message ---
--- Begin Message ---
I'm running the following script (simplified for discussion) to
create a CSV file. My problem here is that the first filemtime and
the last filemtime always equal each other. What I am trying to get
is the filemtime ($new_last_modified) of the file that was just
executed 3 lines earlier. Is there something I need to do
differently? I tried putting a sleep(20) after the fclose, but that
didn't seem to help.
$csv_file = "myFile.csv";
$last_modified_csv = filemtime($csv_file);
$fh = fopen($csv_file, 'w') or die("can't open file");
fwrite($fh, "Data Goes Here");
fclose($fh);
$new_last_modified = filemtime($csv_file);
--
Kevin Murphy
Webmaster: Information and Marketing Services
Western Nevada College
www.wnc.edu
775-445-3326
--- End Message ---
--- Begin Message ---
Kevin Murphy wrote:
I'm running the following script (simplified for discussion) to create a
CSV file. My problem here is that the first filemtime and the last
filemtime always equal each other. What I am trying to get is the
filemtime ($new_last_modified) of the file that was just executed 3
lines earlier. Is there something I need to do differently? I tried
putting a sleep(20) after the fclose, but that didn't seem to help.
$csv_file = "myFile.csv";
$last_modified_csv = filemtime($csv_file);
$fh = fopen($csv_file, 'w') or die("can't open file");
fwrite($fh, "Data Goes Here");
fclose($fh);
$new_last_modified = filemtime($csv_file);
The data returned by filemtime is cached. Use clearstatcache to clear
the cache (http://php.net/clearstatcache).
-Stut
--
http://stut.net/
--- End Message ---
--- Begin Message ---
On Tue 31 Jul 07 22:57, Kevin Murphy wrote:
> $csv_file = "myFile.csv";
> $last_modified_csv = filemtime($csv_file);
>
> $fh = fopen($csv_file, 'w') or die("can't open file");
> fwrite($fh, "Data Goes Here");
> fclose($fh);
add a clearstatcache() in here.
(and sometimes just for because you might want to emit a buffer, a
flush();
> $new_last_modified = filemtime($csv_file);
--
Eddie Dunckley - [EMAIL PROTECTED] - Realtime Travel Connections
IBE Development, www.rttc.co.za, cell 083-379-6891, fax 086-617-7831
Where 33deg53'37.23"S 18deg37'57.87"E Cape Town Bellville Oakdale ZA
"Honk if you hate peace and quiet."
--- End Message ---
--- Begin Message ---
> Hope this isn't overkill but it is a module (read "COM", or "VBA module")
> to manipulate the registry:
"Overkill" is a massive understatement. :-)
As noted elsewhere in this thread, I got what I wanted by using the PHP "exec"
command to execute a VB script, which has all the registry access I need. Much
simpler than compiling and installing a COM object module. :-)
To answer everyone's curiosity as to why I want to access the registry, I am
working on my home computer with a dynamic IP, and I need to know what it is so
I can modify my httpd.conf (or hosts) file, if necessary. The ASP page I am
converting is my browser home page, which has lots of useful stuff I obtain with
server side scripts. Here is a snapshot (no, this isn't my home server).
http://crash.thedatalist.com/temp/home16m.png
I am currently running both servers (Apache and IIS), but I'd like to use a
universal scripting format.
--
Crash
Please reply to the group. E-mail is blocked.
--- End Message ---
--- Begin Message ---
On 7/31/07, Crash Dummy <[EMAIL PROTECTED]> wrote:
>
> > Hope this isn't overkill but it is a module (read "COM", or "VBA
> module")
> > to manipulate the registry:
>
> "Overkill" is a massive understatement. :-)
No doubt.
To answer everyone's curiosity as to why I want to access the registry, I am
> working on my home computer with a dynamic IP, and I need to know what it
> is so
> I can modify my httpd.conf (or hosts) file, if necessary.
You might use http://www.php.net/reserved.variables "SERVER_ADDR" to get the
address of the host you are running under if you wanted to access it from
PHP only.
Travis Doherty
--- End Message ---
--- Begin Message ---
At 1:32 PM -0400 7/31/07, blackwater dev wrote:
Hello,
I have an excel file that I am generating. If I copy over the generated
file and then open it in excel, it works fine, if I try to let the user
download it using the headers below, when I then open it excel complains
that it is an unrecognizable format and the info is garbled...any ideas???
Yes, an idea -- this might be due to a bug that's found in excel
files if a value exist (or doesn't) in the first cell or column of
the spreadsheet. I vaguely remember running into that several years
ago.
You can Google "excel bug first cell"
HTH,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
At 12:11 PM -0400 7/31/07, Denice Fitzgerald wrote:
The company is a technology innovator
and are known for being the top technology company in Las Vegas.
And this technology innovator requires people on-site to program?
Sounds like typical technology to me.
Why can't one of these technology innovator companies move next door to me?
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
Dont know if this would be of any use to anyone but.. meh..
I interviewed with a company called "The Selling Source", based out of
Las Vegas, for a PHP position.. Was told "They are always hiring PHP
developers".. The recruiter I had been working with made it sound like
TSS had a huge turn over rate.
I ended up find a job locally, so didnt have to move to Sin City..
On 7/31/07, tedd <[EMAIL PROTECTED]> wrote:
> At 12:11 PM -0400 7/31/07, Denice Fitzgerald wrote:
> > The company is a technology innovator
> >and are known for being the top technology company in Las Vegas.
>
> And this technology innovator requires people on-site to program?
> Sounds like typical technology to me.
>
> Why can't one of these technology innovator companies move next door to me?
>
> Cheers,
>
> tedd
> --
> -------
> http://sperling.com http://ancientstones.com http://earthstones.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
From: "Richard Lynch" <[EMAIL PROTECTED]>
Your dev box should only match in software versions (okay, and any
really funky specialized hardware like a hardware random number
generator MAYBE).
Don't ask them for a Gigaplex Mu-on 16-cpu 64 Gig RAM 4 Terabyte hard
drive box.
Take an old box out of your closet and install the same versions of
the OS, Webserver, DB, and PHP and call it done.
Now, a QA box, where you do load-testing and serious "release
candidate" testing, yeah, THAT should match the production box, if at
all possible...
Do you know of any (free as in money) disk imaging software that would
capture all the patches/configurations/etc. Actually, as I write this, I
remember the reason the imaging tool I used had mysterious failures was
probably due to bad memory, and I could use a different box now.
Thanks for the advice.
Regarding duplicating the box versus software:
I'm working on a C++ project on a Mac Pro and a MacBook Pro. Both have
Intel Core 2 Duo (but the Mac Pro states Xeon, while the MacBook Pro does
not detail that. The Mac Pro is 4 cores while the MacBook Pro is 2 cores).
Both use MinGW for Mac 3.4.5, the same mtapi
http://www.metaquotes.net/files/mtapi.zip and Wine 0.9.40. Same OS version
of course, and only 2GB RAM in both each.
I was able to compile on the Mac Pro, but when I tried on the MacBook Pro, I
receive undefined reference to [EMAIL PROTECTED] I also saw that on the Mac Pro,
but I don't remember exactly what I did to resolve it. I used -shared on
the MacBook Pro, and I know I did not use that on the Mac Pro. But now I'm
getting
../Client/MetaTraderAPI.o: In function `atexit':
/Volumes/senscass/mingw/build_runtime/../mingw-runtime-3.9/dllcrt1.c:161:
multiple definition of `_atexit'
/usr/local/i386-mingw32-3.4.5/lib/gcc/i386-mingw32/3.4.5/../../../../i386-mingw32/lib/crt2.o:/Volumes/senscass/mingw/build_runtime/../mingw-runtime-3.9/crt1.c:269:
first defined here
../Client/MetaTraderAPI.o: In function `_onexit':
/Volumes/senscass/mingw/build_runtime/../mingw-runtime-3.9/dllcrt1.c:177:
multiple definition of `__onexit'
/usr/local/i386-mingw32-3.4.5/lib/gcc/i386-mingw32/3.4.5/../../../../i386-mingw32/lib/crt2.o:/Volumes/senscass/mingw/build_runtime/../mingw-runtime-3.9/crt1.c:277:
first defined here
../Client/MetaTraderAPI.o: In function `_onexit':
/Volumes/senscass/mingw/build_runtime/../mingw-runtime-3.9/dllcrt1.c:183:
multiple definition of `___do_sjlj_init'
/usr/local/i386-mingw32-3.4.5/lib/gcc/i386-mingw32/3.4.5/crtbegin.o:crtstuff.c:(.text+0x0):
first defined here
It was concept code from my memory and I'm going to have to make sure I
duplicate my steps, but other than the processor, I thought I had identical
environments.
I haven't had time to test the PHP environment you suggested.
_________________________________________________________________
Local listings, incredible imagery, and driving directions - all in one
place! http://maps.live.com/?wip=69&FORM=MGAC01
--- End Message ---
--- Begin Message ---
Dear my friends....
What is the substitute of mysql_error() ?
This line of my code does not work anymore:
$hslgbr=mysql_query("$sqlgbr","$konek") or die ( mysql_error()
);
Thank you very much in advance.
--
Patrik Hasibuan <[EMAIL PROTECTED]>
Junior Programmer
--- End Message ---
--- Begin Message ---
Dear my friends...
This sql string produces proper output in my MySQL-Query:
select image_src from products where product_id='10';
the output is:
gambarproduk/0/10/1.jpg
But my php code does not produce anything.
Please tell me what is my mistake.
===
<?php
if (isset($pid)){
$koneksi=mysql_connect("127.0.0.1","root","mysuccess");
$stringsql="select style,
description,
price
from styles
where product_id='$pid';";
$hsl=mysql_query("$stringsql","$koneksi");
while ($brs=mysql_fetch_row($hsl)){
list($edisi,$deskripsi,$harga)=$brs;
}
$konek=mysql_connect("127.0.0.1","root","mysuccess");
if ($konek){
echo "konek berhasil <br>";
$sqlgbr="select image_src
from products
where product_id='$pid';";
echo "$sqlgbr <br>";
$hslgbr=mysql_query("$sqlgbr","$konek");
if (!$hslgbr){
echo "query gambarproduk tidak berhasil <br>";
}elseif ($hslgbr){
echo "array gambar";
}
while ($brsgbr=mysql_fetch_row($hslgbr)){
list($gambarproduk)=$brsgbr;
echo "urlgambar: $gambarproduk <br>";
}
}
}
?>
===
--
Patrik Hasibuan <[EMAIL PROTECTED]>
Junior Programmer
--- End Message ---
--- Begin Message ---
On 7/31/07, Ken Tozier <[EMAIL PROTECTED]> wrote:
>
> ...
>
// set fetch prefs
> $this->db->setAttribute(PDO:: FETCH_ASSOC,
> true); // also tried 1
> ...
>
Is that the way to do it?
Hmm.. Maybe I sent you in the wrong direction - I can't find any docs on
using setAttribute to set the fetch mode. Anyway, setAttribute always works
like this:
setAttribute(attribute_to_set,value_to_set_to);
I was expecting something like:
setAttribute(PDO::FETCH_MODE, PDO::FETCH_ASSOC);
I don't think that works though, can't find anything in docs relating to
attribute called FETCH_MODE. Anyway I dug in some code and this is what you
can do:
foreach ($pdo->query($query, PDO::FETCH_ASSOC)) {}
Query can take a second parameter.
Another option:
PDOStatement->setFetchMode(PDO::FETCH_ASSOC).. so your original code goes
from:
foreach ($pdo->query($query) as $row) {}
To:
$statement = $pdo->query($query);
$statement->setFetchMode(PDO::FETCH_ASSOC);
foreach( $statement as $row) {}
There must be a way to set it with setAttribute for the connection though,
instead of just on a per-statement basis...
Travis Doherty
--- End Message ---