Something that is chiefly bottlenecked at the database isn't going to be
improved enough at the C level to be worth the trouble. Always optimize
where it's slow. Database design and indexing helps. Minimizing
unnecessary queries, writing good ones, helps too.
Once you get to the point that
I would do something like
$fp = fopen($file_location, 'r');
while (!$fp) {
$csv_line = fgetcsv($fp);
//insert line into database here after appropriate validation and cleaning
}
On Fri, 30 Sep 2005 06:29:11 -0400, Chris <[EMAIL PROTECTED]> wrote:
Greetings PHP community,
I have a CSV text fil
Actually I think fgetcsv will work with any valid file pointer and at
least in PHP 5, the streams implementation will allow you to use a variety
of protocols to create the stream.
http://us2.php.net/manual/en/wrappers.php
I understand that it isn't even too teribbly difficult to implement yo
Either cast your empty ints (which should make it zero) or do an if
(!isset($variable)) { $variable = 'NULL'; }
Ben
On Tue, 18 Oct 2005 12:15:41 -0400, "Shaun" <[EMAIL PROTECTED]>
wrote:
Hi,
Up to this point in time I used to construct my insert statements like
this
$qid = mysql_quer
gt;
wrote:
Hi Ben,
Thanks for your reply, woudn't that insert a string with a value
of'NULL';?
""Ben Litton"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Either cast your empty ints (which should make it zero) or do an if
(!iss
Good explanation but I think he wanted to avoid quoting the integers. I
may be wrong, but I think not quoting integers is a decent practice
because it makes it easier to port your SQL over to a different database
if you later decide you must do so. Of course he could just add a single
quote
You're using two =='s for your assignment.
On Tue, 18 Oct 2005 15:15:59 -0400, "Shaun" <[EMAIL PROTECTED]>
wrote:
Hi all,
Thanks for your replies, rather than check each vaule by name I am
trying to
produce a more dynamic solution:
foreach ($_POST as $key => $value) {
if ($value == ''
I liked Schlossnagle's 'Advanced PHP Programming'
http://www.amazon.com/exec/obidos/tg/detail/-/0672325616/qid=1129664190/sr=8-1/ref=pd_bbs_1/002-6178615-3953615?v=glance&s=books&n=507846
It has a little primer on a variety of things but is for the php5 user.
You might also want to read a boo
You could certainly write an extension to do so. That's what I did (mostly
I was writing one for another purpose and added a function I stole from
O'Reilly. You can find the C code I used here:
http://www.oreillynet.com/pub/a/network/excerpt/spcookbook_chap03/index3.html.
It's pretty clever
While not ideal, you could do a select on a db. MS SQL and MySQL both have
functions to generate unique id's and I imagine the other databases do as
well. While running a "SELECT uuid()" and hitting the database for each
one of these things is annoying, it is one possible pseudo-solution.
O
Check in the comments section of ths page: http://us3.php.net/htmlentities
. You're not the first person to have this problem.
Ben
On Mon, 31 Oct 2005 10:30:49 -0500, Dan McCullough
<[EMAIL PROTECTED]> wrote:
I having been looking for some snippet to help me with changing MS
Word double,
I'm not sure if there's a way around this, though there's a few simple
precautions you can take. You can put a function that returns the resource
in an include file outside of the public html folders, which helps a
little bit. It's also always good to give the least permission possible
and
You can do this if you register a different add-type. Say php5 for the php
5.1 pages and just php for the regular ones. You may (I can't recall) have
to install one as mod_php and the other as a cgi. There are surely guides
on the internet to help you get both running simultaneously.
On Mon
13 matches
Mail list logo