2007. 10. 3, szerda keltezéssel 16.07-kor Cameron Just ezt írta:
> One trick that one of my friends has taught me is to only use double
> quotes "s where needed as they are parsed by PHP and instead use single
> quotes 's
>
> i.e.
> $fred['john'] = 10;
> is better than
> $fred["john"] = 10;
>
>
I have a company table and a contacts table. In the contacts table, there
is a field called "companyID" which is a link to a row in the company table.
What is the easiest way to query the company table for all the company rows
whose ID is NOT linked to in the contact table? Basically, the oppo
hi Wolf and Jim, thanks for the answer! Very useful.
Now It would be wondeful if I can pick up the values from a CSV file
(coordinates) and apply a postGIS/postgreSQL function (Select ...) to this
data and add the resulting values as a new filed in the CSV !
Is that possible?
Thanks,
2007. 10. 3, szerda keltezéssel 05.21-kor [EMAIL PROTECTED] ezt írta:
> I have a company table and a contacts table. In the contacts table, there
> is a field called "companyID" which is a link to a row in the company table.
>
>
>
> What is the easiest way to query the company table for all th
Actually you still want to use a join, just an OUTER join instead of an INNER
one.
With an OUTER join, you can get all the rows that match as well as rows where
it doesn't match:
http://en.wikipedia.org/wiki/Join_(SQL)#Left_outer_join
In the example there, DepartmentID 36 is present in the `E
- Original Message -
From: "Zoltán Németh" <[EMAIL PROTECTED]>
it's not very efficient, but I don't have any better idea. someone else?
Indeed, that sort of query is one of the worst and there is little you can
do to improve it save making sure you have an index on the field of the
Zoltán Németh wrote:
> and anyway, the microseconds you could win with this really don't
> count that much to be worth the effort... find real bottlenecks and
> optimize against those.
And finally, if you're worried about microseconds, why are you using an
interpreted language?
/Per Jessen, Zü
Hi J,
Checkout this,
SELECT * FROM tbl_company where id not in (SELECT companyID from
tbl_contacts)
Regards,
Lasitha Alawatta
Application Developer
Destinations of the World Holding Establishment
P O Box: 19950
Dubai, United Arab Emirates
( Ph +971 4 295 8510 (Board) / 1464 (Ext.)
7 Fax
Sure, just use the code I/we provided as the basis for what you need.
When you get stuck, post your code and we'll be happy to look at it for you.
Wolf
pere roca <[EMAIL PROTECTED]> wrote:
>
> hi Wolf and Jim, thanks for the answer! Very useful.
> Now It would be wondeful if I can p
there is no way to create an abstract class in php4.
in an abstract class definition subclasses are forced to implement those
methods
that have been declared abstract. or they are allowed to declare the method
as abstract themselves and force their children to provide a concrete
definition.
the on
On 10/3/07, ashish.sharma <[EMAIL PROTECTED]> wrote:
>
>
> Hello All,
>
> I am working on PHP from quite some time. I am pretty much comfortable in
> writing PHP code but I always want that I should write good, quality code.
> For this I always look for the best practices which other developers use
On Wed, 2007-10-03 at 09:52 -0400, Nathan Nobbe wrote:
>
> one nice trick you can easily implement is to compress your code before
> pushing it to production.
> the php cli exposes a method for stripping out the whitespace and comments.
>
> php -w
Do it right, use a compile cache like Eaccelerato
On 10/3/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
>
> On Wed, 2007-10-03 at 09:52 -0400, Nathan Nobbe wrote:
> >
> > one nice trick you can easily implement is to compress your code before
> > pushing it to production.
> > the php cli exposes a method for stripping out the whitespace and
> com
On Wed, 2007-10-03 at 10:22 -0400, Nathan Nobbe wrote:
> On 10/3/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
> >
> > On Wed, 2007-10-03 at 09:52 -0400, Nathan Nobbe wrote:
> > >
> > > one nice trick you can easily implement is to compress your code before
> > > pushing it to production.
> > > th
All,
I am attempting to perform multiple prepared queries using mysqli. I
want to pull information out of one table based on the information in
another. I do not receive any errors and the rest of the page seems to
load correctly. Below is my code:
foreach ($uniqueids as $entryid) {
$getentry
""Nathan Nobbe"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> there is no way to create an abstract class in php4.
Oh yes there is! I knw, because I have done it! The definition of an
abstrract class is one that cannot be instantiated into an object. It can,
however, be extend
On Wed, 3 Oct 2007, Mark wrote:
> I'm currently fetching feeds about every hour (automatically in php)
> but sometimes there are no new updates in a feed for 2 hours. so no i
> wonder if it's possible to check the feed somehow to see if it changed
> since i last fetched it and if it's the case than
keeping data private is how encapsulation in facilitated.
here is a really simple way to violate encapsulation in php4
class BreakMe {
// private
var $iWishIWasPrivate;
}
// later on
$instance = new BreakMe();
$instance->iWishIWasPrivate = 'encapsulation violated';
if the member variable
On 10/3/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> I have a company table and a contacts table. In the contacts table, there
> is a field called "companyID" which is a link to a row in the company
> table.
>
>
>
> What is the easiest way to query the company table for all the company
> r
> Hi J,
>
>
> Checkout this,
>
>
> SELECT * FROM tbl_company where id not in (SELECT companyID from
> tbl_contacts)
>
Brilliant! This is exactly what I was looking for, and is quite
logical/readable! Thanks to everyone for the ideas!
J
>
>
>
>
> Regards,
> Lasitha Alawa
""Nathan Nobbe"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> keeping data private is how encapsulation in facilitated.
Absolute rubbish. Encapsulation is the act of placing data and the
operations that perform on that data in the same class. The data does not
have to be priva
On 10/3/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > Hi J,
> >
> >
> > Checkout this,
> >
> >
> > SELECT * FROM tbl_company where id not in (SELECT companyID from
> > tbl_contacts)
> >
>
>
> Brilliant! This is exactly what I was looking for, and is quite
> logical/readable! Thanks to every
On 10/3/07, Tony Marston <[EMAIL PROTECTED]> wrote:
>
>
> Encapsulation is NOT data hiding.
>
> I repeat, encapsulation has absolutely nothing to do with data hiding.
http://en.wikipedia.org/wiki/Information_hiding
encapsulation is facilitated via ppp in object oriented programming
languages.
I agree with this. Never use a subquery when a join will work. The
optimizer with thank you with performance.
James Ausmus wrote:
On 10/3/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Hi J,
Checkout this,
SELECT * FROM tbl_company where id not in (SELECT companyID from
tbl_contacts)
""Nathan Nobbe"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 10/3/07, Tony Marston <[EMAIL PROTECTED]> wrote:
>>
>>
>> Encapsulation is NOT data hiding.
>>
>> I repeat, encapsulation has absolutely nothing to do with data hiding.
>
>
> http://en.wikipedia.org/wiki/Information
On 10/3/07, Tony Marston <[EMAIL PROTECTED]> wrote:
>
> Encapsulation is NOT data hiding. Take a look at
please stop putting words into my mouth. i never once said encapsulation is
data hiding.
I stated PublicPrivateProctected facilitates encapsulation. tonight when i
get home ill post
a snipp
Advanced PHP Programming, Geo. Schlossnagle
Discusses large-scale, optimized websites in great detail
ashish.sharma wrote:
Hello All,
I am working on PHP from quite some time. I am pretty much comfortable in
writing PHP code but I always want that I should write good, quality code.
For this I
Hi Nathaniel,
When your query starts its second loop, the resultset from the first one is
still defined as the resultset in your prepared statement object. Before you
can get another resultset, you need to clear the first one using the
mysqli_stmt_free_result function. It would probably be be
""Nathan Nobbe"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 10/3/07, Tony Marston <[EMAIL PROTECTED]> wrote:
>>
>> Encapsulation is NOT data hiding. Take a look at
>
>
> please stop putting words into my mouth. i never once said encapsulation
> is
> data hiding.
> I stated
Well if you have the GD libs installed you could do something with
imagecreatefromjpeg() and just send a header with the following before
the page is displayed. header("Content-Type: image/jpeg");
Kevin Murphy wrote:
> Hello all,
>
> Following up with my success last week with putting downloadabl
Greetings,
I am attempting to alternate the colors of the container DIV. Anyone know
how to do this?
$optone
Edit
Delete
$study_title
$date
";
}
?>
Thank you very much,
--
Steve M.
On 10/3/07, Greg Donald <[EMAIL PROTECTED]> wrote:
> > cat fsockopen.php
> #!/usr/bin/env php
>
> $fp = fsockopen( 'destiney.com', 80, $errno, $errstr, 30 );
>
> if( !$fp )
> {
>echo "$errstr ($errno)\n";
> }
> else
> {
>$out = "GET /rss HTTP/1.1\r\n";
>$out .= "Host: destiney.com\r\n"
On 10/3/07, Steve Marquez <[EMAIL PROTECTED]> wrote:
> Greetings,
>
> I am attempting to alternate the colors of the container DIV. Anyone know
> how to do this?
you could always use javascript
we've used something like this with success:
http://www.sitepoint.com/article/background-colors-javascr
Carlton Whitehead wrote:
> Hi Nathaniel,
>
> When your query starts its second loop, the resultset from the first
> one is still defined as the resultset in your prepared statement
> object. Before you can get another resultset, you need to clear the
> first one using the mysqli_stmt_free_result
Steve Marquez wrote:
I am attempting to alternate the colors of the container DIV. Anyone know
how to do this?
I've used variants of this:
jon
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
thats the key use mod 2 and check if the result is 1 or 0.
-nathan
On 10/3/07, Jon Anderson <[EMAIL PROTECTED]> wrote:
>
> Steve Marquez wrote:
> > I am attempting to alternate the colors of the container DIV. Anyone
> know
> > how to do this?
>
> I've used variants of this:
>
>
>
>
>
> jo
[EMAIL PROTECTED] wrote:
I have a company table and a contacts table. In the contacts table, there
is a field called "companyID" which is a link to a row in the company table.
What is the easiest way to query the company table for all the company rows
whose ID is NOT linked to in the contac
Add this to your default.css file... Or to the page...
TR.dataRow1 { background-color: #e8f5f7; } /* light */
TR.dataRow2 { background-color: #dce8ea; } /* dark */
Then just do this:
>
Forget all that $i++ and (mod) % stuff...
And NEVER hardcode the colors in the page. Use CSS !
Adjust t
Martin Marques wrote:
> SELECT * FROM company WHERE id NOT IN (SELECT companyID FROM contacts);
Not ideal as has been mentioned else where in this thread.
Col
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I need to retrieve a huge amount of data form a database and do so many
times. To eliminate the overhead of connecting to the database and pulling
down all that info over and over, I'm trying to pull it down only once and
stick it into a session. The problem is I get the first few results and
Dan wrote:
> I need to retrieve a huge amount of data form a database and do so
> many times. To eliminate the overhead of connecting to the database
> and pulling down all that info over and over, I'm trying to pull it
> down only once and stick it into a session. The problem is I get the
> fir
Colin Guthrie wrote:
Martin Marques wrote:
SELECT * FROM company WHERE id NOT IN (SELECT companyID FROM contacts);
Not ideal as has been mentioned else where in this thread.
Col
I think one would have to take into account the DB type being used here.
I can have MySQL and PostgreSQL setup a
After thinking about this a while I also thought of making my own cache.
The problem with that is would it be any faster or have any less strain on
the server than having multiple requests/connections to the database?
- Dan
"Per Jessen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECT
Does the data change often? If not you could just enable query cache and
cache connection threads and you'd probably be fine.
Dan wrote:
After thinking about this a while I also thought of making my own
cache. The problem with that is would it be any faster or have any
less strain on the serve
Steve Marquez wrote:
Greetings,
I am attempting to alternate the colors of the container DIV. Anyone know
how to do this?
Thank you very much,
--
Steve M.
{$row['optone']}
Edit
Delete
{$study_title}
{$row['date']}
ROW;
}
}
?>
As you can see, a bunch of different ways to skin this particular cat.
For fun, I wanted to show you something I came up with early in my PHP
career. It's kinda dumb and some of the other ways shown are easier to
understand right off the bat, but here is an "alternate" way to do it.
My initia
The data doesn't change often but the querys do. Thats why I was
origionally thinking of just storing the entire result in a session and just
use the part of the session I needed. So caching wouldn't really work.
That was something intresting though that I didn't know earlier thanks!
- Dan
stick in in an array in a session
>>> "Dan" <[EMAIL PROTECTED]> 10/3/2007 2:21 PM >>>
I need to retrieve a huge amount of data form a database and do so many times. To eliminate the overhead of connecting to the database and pulling down all that info over and over, I'm trying to pull it
On Wed, 2007-10-03 at 14:49 -0700, Jim Lucas wrote:
>
> This is only from my own personal testing. Mind you that I have only been
> using PostgreSQL for a
> year or so. But one problem that I have always ran into with MySQL is that
> when JOIN'ing tables
> that have large data sets is a PITA.
On Wed, 3 Oct 2007, Robert Cummings wrote:
> I'd use the left join whenever available.
Similarly, I design for the left join whenever possible.
--
Greg Donald
Cyberfusion Consulting
http://cyberfusionconsulting.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http
Robert Cummings wrote:
On Wed, 2007-10-03 at 14:49 -0700, Jim Lucas wrote:
This is only from my own personal testing. Mind you that I have only been using PostgreSQL for a
year or so. But one problem that I have always ran into with MySQL is that when JOIN'ing tables
that have large data sets
I just found a tool called CodeLobster, but the site seems a little funky,
mostly because the owners first language is not English...is anyone using this
tool and is it any good?
Thanks
bastien
_
Be seen when you can't be he
In the following example I show a simple OOP example (because I felt
like it) and illustrate why using CSS classes is the most powerful way
to do row style cycling. Hopefully you're using a decent browser (almost
anything other than IE -- I recommend Opera :) but if not then IE7 will
suffice to ill
On Thu, 2007-10-04 at 11:23 +1000, Chris wrote:
> Robert Cummings wrote:
> > On Wed, 2007-10-03 at 14:49 -0700, Jim Lucas wrote:
> >> This is only from my own personal testing. Mind you that I have only been
> >> using PostgreSQL for a
> >> year or so. But one problem that I have always ran int
Robert Cummings wrote:
On Thu, 2007-10-04 at 11:23 +1000, Chris wrote:
Robert Cummings wrote:
On Wed, 2007-10-03 at 14:49 -0700, Jim Lucas wrote:
This is only from my own personal testing. Mind you that I have only been using PostgreSQL for a
year or so. But one problem that I have always ra
On 10/3/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
>
> Hopefully you're using a decent browser (almost
> anything other than IE -- I recommend Opera :)
>
opera is the best for straight browsing. ive found i could have 40 to 50
tabs open with no noticeable perforrmace hit. firefox bogs badly
Hi list, good day.
I have a simple script that inserts text on a mysql table, that has a field
named description and the type is text.
Everting works fine, except when I try to insert a text that includes a
simple quote.
For example
Yamil´s car
I send the character string to a varia
PHP List,
I would like to set up a function within my system that can test a file
that a user has uploaded and determine what kind of file it is. My
intention is to only handle a fairly small number of common file types*,
so I don't think I need to build anything too robust.
Of course, I che
There are any number of elements to try
htmlspecialchars
mysql_real_escape_string
addslashes
RTFM and see what works best for your situation
bastien> From: [EMAIL PROTECTED]> To: php-general@lists.php.net> Date: Thu, 4
Oct 2007 11:44:34 +0900> Subject: [PHP] inserting ´ in a db> > Hi li
Are there any known security issues/concerns with compiling PHP with
imap/pop3 support? Such as hijacking php pages and relaying spam, etc...?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Yamil Ortega wrote:
Hi list, good day.
I have a simple script that inserts text on a mysql table, that has a field
named description and the type is text.
Everting works fine, except when I try to insert a text that includes a
simple quote.
For example
Yamil´s car
http://www.php.n
On 10/3/07, Dave M G <[EMAIL PROTECTED]> wrote:
> So, ultimately, what I'm wondering is, what should I be using in order
> to determine file MIME types that will be the most commonly installed on
> servers with PHP?
I wrote something that does system("file -iNr $file") which gives you
the applicat
Are there any known security issues/concerns with compiling PHP with
imap/pop3 support? Such as hijacking php pages and relaying spam, etc...?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Don O'Neil wrote:
Are there any known security issues/concerns with compiling PHP with
imap/pop3 support? Such as hijacking php pages and relaying spam, etc...?
[ was posting this again a mistake or just impatience? ]
I'm not sure how opening an email inbox can hijack pages but maybe
someone
Robert Cummings wrote:
On Wed, 2007-10-03 at 14:49 -0700, Jim Lucas wrote:
This is only from my own personal testing. Mind you that I have only been using PostgreSQL for a
year or so. But one problem that I have always ran into with MySQL is that when JOIN'ing tables
that have large data sets
[EMAIL PROTECTED] (Chris) writes:
> > Everting works fine, except when I try to insert a text that includes a
> > simple quote.
> http://www.php.net/mysql_real_escape_string
I'll see you that and raise you PEAR's database interfaces:
http://pear.php.net/package/DB - especially DB_common:
I would also suggest to limit yourself to things you actually need not
to select the whole table.
Aleksandar
Jim Lucas wrote:
Colin Guthrie wrote:
Martin Marques wrote:
SELECT * FROM company WHERE id NOT IN (SELECT companyID FROM contacts);
Not ideal as has been mentioned else where in thi
Aleksandar Vojnovic wrote:
I would also suggest to limit yourself to things you actually need not
to select the whole table.
In this case you can't because you're looking for records that exist in
one table that don't exist in another.
Apart from looking at the whole table in each case how e
On Wednesday 03 October 2007, Tom Swiss wrote:
> [EMAIL PROTECTED] (Chris) writes:
> > > Everting works fine, except when I try to insert a text that includes a
> > > simple quote.
> >
> > http://www.php.net/mysql_real_escape_string
>
> I'll see you that and raise you PEAR's database interface
It seems you missed my point :) if you would need all the data then
select them all, but if you need only partial data from the table then
you could limit yourself to that specific columns. I doubt everybody
need everything all the time. True?
Aleksandar
Chris wrote:
Aleksandar Vojnovic wrot
Aleksandar Vojnovic wrote:
It seems you missed my point :) if you would need all the data then
select them all, but if you need only partial data from the table then
you could limit yourself to that specific columns. I doubt everybody
need everything all the time. True?
Ahh - you meant the se
[EMAIL PROTECTED] ("Jay Blanchard") writes:
> In certain cases 0 is the equivalent of FALSE and in other cases a 0 is
> just a 0... Exercise care when using 0 to determine if something is FALSE
> and understand that 0 has context.
I think "context" and "equivalence" are not completely accur
Pick one:
http://si2.php.net/manual/en/function.htmlentities.php
http://si2.php.net/manual/en/function.addslashes.php
http://si.php.net/mysql_escape_string
Aleksandar
Yamil Ortega wrote:
Hi list, good day.
I have a simple script that inserts text on a mysql table, that has a field
named de
73 matches
Mail list logo