On Oct 20, 2013, at 4:01 AM, Ashley Sheridan wrote:
> Yes, I was going to ask, why are you storing your dates as strings?
> MySQL has a perfectly good DATE type. It's also generally faster
> comparing dates within a MySQL query than PHP code.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
On Sun, 2013-10-20 at 00:00 -0400, Bastien wrote:
>
> Thanks,
>
> Bastien
>
> > On Oct 19, 2013, at 10:44 PM, John Taylor-Johnston
> > wrote:
> >
> > I have date strings in my mysql db. -mm-dd.
> > I want to parse to see if the date is greater than november 2011 and less
> > than decemb
On Feb 20, 2013, at 9:10 AM, Jim Giner wrote:
> Basically it tells a savvy programmer whether or not his logic has caused the
> var in question to "exist". Many times it is important simply to know that,
> not what the var contains, which can lead to an error in processing.
>
> The isset() wi
isset checks if something is defined or if an array has a key with a value other
than null
read:
http://www.php.net/manual/en/function.isset.php#refsect1-function.isset-returnvalues
empty check isset PLUS if the value is not null, false, 0 and wahtever php
thinks is empty
read:
http://www.php.ne
On Tue, Feb 19, 2013 at 9:29 PM, John Taylor-Johnston
wrote:
>
> What is the difference between?
>
> if (empty... http://www.php.net/manual/en/function.empty.php "Determine
> whether a variable is empty"
> and
> if (isset... http://php.net/manual/en/function.isset.php "Determine if a
> variable
I bow to your skillz! That was pretty awesome!
Bastien Koert
On 2012-06-22, at 7:02 PM, Daniel Brown wrote:
> On Fri, Jun 22, 2012 at 5:07 PM, Daevid Vincent wrote:
>> http://www.addedbytes.com/blog/if-php-were-british/
>
>Eh, what the hell, it's Friday
>
>http://links.parasa
On 22/06/2012 22:07, Daevid Vincent wrote:
> http://www.addedbytes.com/blog/if-php-were-british/
LOL!
--
Mark Rousell
PGP public key: http://www.signal100.com/markr/pgp
Key ID: C9C5C162
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
> -Original Message-
> From: paras...@gmail.com [mailto:paras...@gmail.com] On Behalf Of Daniel
Brown
> Sent: Friday, June 22, 2012 4:03 PM
> To: Daevid Vincent
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] If PHP Were British
>
> On Fri, Jun 22, 2012 at
On Fri, Jun 22, 2012 at 5:07 PM, Daevid Vincent wrote:
> http://www.addedbytes.com/blog/if-php-were-british/
Eh, what the hell, it's Friday
http://links.parasane.net/eea4
--
Network Infrastructure Manager
http://www.php.net/
--
PHP General Mailing List (http://www.php.net/)
On Jun 22, 2012, at 5:07 PM, Daevid Vincent wrote:
> http://www.addedbytes.com/blog/if-php-were-british/
Oh, that is too funny!
I'll counter with my Hill-Billy version:
---
echo();
yell('revenewers commin');
---
var_dump();
take_a_dump();
preferred:
leave_one();
---
if:
On Tue, Jan 17, 2012 at 2:34 AM, ma...@behnke.biz wrote:
> You should not write the recipients email address in a hidden form, but
> instead
> read it from a config file. This way you can make sure, that no one alters it.
> Although this won't stop anyone from using the mailform.
Cannot emphasiz
Capchas can't hold off any decently smart robots, anyone doing their
research can find at least 3 tools that will defeat various capchas.
For example pwntcha is one, Dan Kaminsky did a talk at black hat and
defcon 16 on pwning audio capchas (and a lot of even good ones will
offer audio as an option
Haluk Karamete hat am 17. Januar 2012 um 04:51
geschrieben:
> Let' say we have a form mailer script, which takes any form ( whose
> action is directed to it ) and goes thru the submitting form's fields
> list ( programmatically) , to build a nice email on the fly and email
> the build up string
That's already pretty streamlined...
On Jul 13, 2011 11:22 PM, "Ron Piggott"
wrote:
>
> Is there a way to stream line this:
>
> if ( ( $val <> "with" ) AND ( $val <> "from" ) ) {
>
> Ron
>
> The Verse of the Day
> “Encouragement from God’s Word”
> http://www.TheVerseOfTheDay.info
if( $val !== "with" && $val !== "from")
simple comparison = faster solution... also you want type-safe
you could do something like
if(!in_array($val, array("from","with"))) but its neither elegant nor fast
On Jul 14, 2011 12:22 AM, "Ron Piggott"
wrote:
On 31 March 2011 15:53, Stuart Dallas wrote:
> On Thursday, 31 March 2011 at 15:45, Nicholas Cooper wrote:
> Good day,
> >
> > I have three arrays A, B and C. Anyone of them might not have the 'id'
> key
> > set which will give the Notice "Undefined index: id".
> >
> > I just wanted to know what
On Thursday, 31 March 2011 at 15:45, Nicholas Cooper wrote:
Good day,
>
> I have three arrays A, B and C. Anyone of them might not have the 'id' key
> set which will give the Notice "Undefined index: id".
>
> I just wanted to know what the correct approach to this problem would be;
> without maki
At 11:48 AM +0100 9/27/10, Ford, Mike wrote:
> -Original Message-
From: tedd [mailto:tedd.sperl...@gmail.com]
Sent: 25 September 2010 16:02
One can make the argument that the ELSE IF statement first surfaced
circa 1977 in FORTRAN 77 and the CASE statement came later in
FORTRAN
> -Original Message-
> From: tedd [mailto:tedd.sperl...@gmail.com]
> Sent: 25 September 2010 16:02
> One can make the argument that the ELSE IF statement first surfaced
> circa 1977 in FORTRAN 77 and the CASE statement came later in
> FORTRAN
> 90 circa 1991.
Being a fully-fledged membe
At 9:04 PM +0100 9/24/10, Ashley Sheridan wrote:
I don't often use this type of logic, but I have used it before and
it's served me well. Essentially, a switch is a glorified if
statement, and I find them a lot nicer to read and write than a
series of if/elseif blocks.
Thanks,
Ash
Ash:
Exa
At 3:54 PM -0400 9/24/10, Bob McConnell wrote:
From: tedd
At 2:23 PM -0400 9/24/10, Bob McConnell wrote:
>>A switch works when a single test can dispatch all possible branches.
If
you have a series of tests where each looks for a different subset of
>>conditions, you need an elseif.
On Fri, 2010-09-24 at 16:08 -0400, Joshua Kehn wrote:
> On Sep 24, 2010, at 4:04 PM, Ashley Sheridan wrote:
>
> > On Fri, 2010-09-24 at 15:54 -0400, Bob McConnell wrote:
> >
> >> From: tedd
> >>
> >>> At 2:23 PM -0400 9/24/10, Bob McConnell wrote:
>
> A switch works when a single tes
On Fri, 2010-09-24 at 15:54 -0400, Bob McConnell wrote:
> From: tedd
>
> > At 2:23 PM -0400 9/24/10, Bob McConnell wrote:
> >>
> >>A switch works when a single test can dispatch all possible branches.
> If
> >>you have a series of tests where each looks for a different subset of
> >>conditions,
On Fri, 2010-09-24 at 15:44 -0400, Steve Staples wrote:
> this would be the same as:
> (commented below)
>
> On Fri, 2010-09-24 at 15:30 -0400, tedd wrote:
> > At 2:23 PM -0400 9/24/10, Bob McConnell wrote:
> > >
> > >A switch works when a single test can dispatch all possible branches. If
> > >y
From: tedd
> At 2:23 PM -0400 9/24/10, Bob McConnell wrote:
>>
>>A switch works when a single test can dispatch all possible branches.
If
>>you have a series of tests where each looks for a different subset of
>>conditions, you need an elseif.
> Not so, O'wise one.
>
> This will work:
>
> swit
this would be the same as:
(commented below)
On Fri, 2010-09-24 at 15:30 -0400, tedd wrote:
> At 2:23 PM -0400 9/24/10, Bob McConnell wrote:
> >
> >A switch works when a single test can dispatch all possible branches. If
> >you have a series of tests where each looks for a different subset of
> >c
At 2:23 PM -0400 9/24/10, Bob McConnell wrote:
A switch works when a single test can dispatch all possible branches. If
you have a series of tests where each looks for a different subset of
conditions, you need an elseif.
Bob McConnell
Bob:
Not so, O'wise one.
This will work:
switch(1)
[snip]
I am not in the majority when I say for conditions where you have
more than two options use a switch control and not an elseif.
In 40+ years of programming, I have never used elseif because the
control confuses me. It is *much* easier for me to use, understand,
and document a switch stat
I found the problem while I was copying the code over. The problem is
that the if triggers in loop one, and the elseif triggers in loop two.
In other words, it does exactly what it's supposed to, I just didn't
think through what the loop would accomplish. Now to figure out how
to make it do what
From: tedd
> At 1:50 PM -0400 9/24/10, Andy McKenzie wrote:
>>Hey folks,
>>
>> Here's the deal. I have the following code:
>>
>>if($col_vals[$i][$val['column']] == $search_result[0][$col])
>> { echo ' selected="selected"'; }
>>elseif($val['default'] == $col_vals[$i][$val['column']])
>
At 1:50 PM -0400 9/24/10, Andy McKenzie wrote:
Hey folks,
Here's the deal. I have the following code:
if($col_vals[$i][$val['column']] == $search_result[0][$col])
{ echo ' selected="selected"'; }
elseif($val['default'] == $col_vals[$i][$val['column']])
{ echo ' selected="
if(1 == 1){
echo 'here';
}
elseif(1 == 1){
echo 'here"';
}
Will only echo "here" once.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Andy I see no reason why both echo's would fire; unless this block of code
gets executed multiple times. can we see more of the code?
Chris H.
On Fri, Sep 24, 2010 at 1:50 PM, Andy McKenzie wrote:
> Hey folks,
>
> Here's the deal. I have the following code:
>
> if($col_vals[$i][$val['column
On Tue, Jan 26, 2010 at 19:48, Daevid Vincent wrote:
>
> Another thing I just noticed, is that we (that is Dan and I) should NOT
> have used count()
> This is bad form and wasted cycles.
This is certainly correct, but it should also be noted that my
original code used it once (thus, it was in
> -Original Message-
> From: Daevid Vincent [mailto:dae...@daevid.com]
> Sent: 26 January 2010 03:52
>
> if (substr($mydata->restored,0,4) == "") { }
>
> Or in your very specific case you could do the harder way and note
> that
> strings work like simple arrays too in a way, so $mydat
> -Original Message-
> From: muquad...@gmail.com [mailto:muquad...@gmail.com] On
> Behalf Of shiplu
> Sent: Tuesday, January 26, 2010 4:25 PM
> To: Daniel Brown
> Cc: Daevid Vincent; PHP-General
> Subject: Re: [PHP] If the first four characters are ""
Ran this code (http://pastie.org/795983)
The result is,
array of 10,000
Array
(
[[]] => 5.66168689728
[strpos] => 5.70796895027
[substr] => 5.92751288414
[preg_match] => 6.21515512466
)
--
Shiplu Mokaddim
My talks, http://talk.cmyweb.net
Follow me, http://twitter.com/shiplu
S
On Tue, Jan 26, 2010 at 17:17, Daevid Vincent wrote:
>
> Well allow me to retort... :)
>
> Your test was for 5 measly array elements.
>
> Just for S&G I tried it with the strpos one too and modified your test
> slightly to handle bigger arrays...
>
[snip=code]
>
> I ran out of memory with more tha
> -Original Message-
> From: paras...@gmail.com [mailto:paras...@gmail.com] On
> Behalf Of Daniel Brown
> Sent: Tuesday, January 26, 2010 8:21 AM
> To: Daevid Vincent
> Cc: John Taylor-Johnston; PHP-General
> Subject: Re: [PHP] If the first four character
On Mon, Jan 25, 2010 at 22:51, Daevid Vincent wrote:
>> -Original Message-
>> From: paras...@gmail.com [mailto:paras...@gmail.com] On
>> Behalf Of Daniel Brown
>> Sent: Monday, January 25, 2010 6:43 PM
>> To: John Taylor-Johnston
>> Cc: PHP-General
>
maybe another way can be
$str = explode('-',$mydata->restored);
if($str[0] == '') { dostuff();}
;)
On 1/26/10, shiplu wrote:
> Another technique could be.
>
> $s = $mydata->restored;
>
> if($s[0]==$s[1]
> && $s[1]==$s[2]
> && $s[2]==$s[3]
> && $s[3]==0){
>
> do_work();
> }
>
>
> But I
Another technique could be.
$s = $mydata->restored;
if($s[0]==$s[1]
&& $s[1]==$s[2]
&& $s[2]==$s[3]
&& $s[3]==0){
do_work();
}
But I think you got the best solution already.
--
Shiplu Mokaddim
My talks, http://talk.cmyweb.net
Follow me, http://twitter.com/shiplu
SUST Programmers, http://g
On Mon, Jan 25, 2010 at 08:12:43PM -0800, Daevid Vincent wrote:
> > -Original Message-
> > From: Paul M Foster [mailto:pa...@quillandmouse.com]
> > Sent: Monday, January 25, 2010 8:05 PM
> > To: php-general@lists.php.net
> > Subject: Re: [PHP] If the first fo
On Mon, Jan 25, 2010 at 11:12 PM, Daevid Vincent wrote:
>> >From what I understand, strpos() faster than a lot of other similar
>> string functions and much faster than regexps. You could do:
>>
>> if (strpos($mydata->restored, '') === 0) {
>> do_stuff();
>> }
>
> Ah. Clever use of the "
> -Original Message-
> From: Paul M Foster [mailto:pa...@quillandmouse.com]
> Sent: Monday, January 25, 2010 8:05 PM
> To: php-general@lists.php.net
> Subject: Re: [PHP] If the first four characters are "", then do {}
>
> On Mon, Jan 25, 2010 at 09:36:5
On Mon, Jan 25, 2010 at 09:36:50PM -0500, John Taylor-Johnston wrote:
> I am reading the manual: http://ca.php.net/manual/en/ref.strings.php
>
> $mydata->restored = "-00-00";
>
> How do I express this? If the first four characters are "", then do {}
>
> What I am looking for is in strpos()
> -Original Message-
> From: paras...@gmail.com [mailto:paras...@gmail.com] On
> Behalf Of Daniel Brown
> Sent: Monday, January 25, 2010 6:43 PM
> To: John Taylor-Johnston
> Cc: PHP-General
> Subject: Re: [PHP] If the first four characters are "", then
- Original Message -
From: "John Taylor-Johnston"
To: "PHP-General"
Sent: Tuesday, January 26, 2010 12:36 PM
Subject: [PHP] If the first four characters are "", then do {}
I am reading the manual: http://ca.php.net/manual/en/ref.strings.php
$mydata->restored = "-00-00";
How
On Mon, Jan 25, 2010 at 21:36, John Taylor-Johnston
wrote:
> I am reading the manual: http://ca.php.net/manual/en/ref.strings.php
>
> $mydata->restored = "-00-00";
--
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Looking for hosting or
A pattern is simply a device used to skip out on costly dollars (as opposed
to cheap dollars). Software development is a low loyalties field. When new
workers come in and old ones are laid off, or when the project is complete
and you will likely not be working on the project again in the future,
Richard Quadling wrote:
2009/12/30 Tony Marston :
I have recently been engaged in an argument via email with someone who
criticises my low opinion of design patterns (refer to
http://www.tonymarston.net/php-mysql/design-patterns.html ). He says that
design patterns are merely a convention and no
2009/12/30 Tony Marston :
> I have recently been engaged in an argument via email with someone who
> criticises my low opinion of design patterns (refer to
> http://www.tonymarston.net/php-mysql/design-patterns.html ). He says that
> design patterns are merely a convention and not a reusable compon
I think it also to some extent comes down to having a shared
vocabulary. Pretty much the same way that you know which technique I'm
talking about when I use the word "recursion", which algorithm I'm
talking about when I say "quick sort" and which data structure I mean
when I say "linked list". It's
At 5:16 PM + 1/3/10, Tony Marston wrote:
I offer an alternative view - there are those programmers who need design
patterns to fill a hole in their experience, as a sort of mental crutch, and
there are those who do not need design patterns as they have the experience
and ability to work with
"Larry Garfield" wrote in message
news:201001010553.41956.la...@garfieldtech.com...
> On Friday 01 January 2010 05:26:48 am Tony Marston wrote:
>
>> > It depends what you're reusing. Design patterns are reusable concepts,
>> > not reusable code. That's the key difference.
>> >
>> > Knowledge o
On Friday 01 January 2010 05:26:48 am Tony Marston wrote:
> > It depends what you're reusing. Design patterns are reusable concepts,
> > not
> > reusable code. That's the key difference.
> >
> > Knowledge of design patterns is like knowledge of how different food
> > ingredients interact. "Hm,
"Larry Garfield" wrote in message
news:200912311743.16759.la...@garfieldtech.com...
> Meant to send this to the list, sorry.
>
> -- Forwarded Message ------
>
> Subject: Re: [PHP] If design patterns are not supposed to produce reusable
> code then why u
Meant to send this to the list, sorry.
-- Forwarded Message --
Subject: Re: [PHP] If design patterns are not supposed to produce reusable
code then why use them?
Date: Thursday 31 December 2009
From: Larry Garfield
To: "Tony Marston"
On Wednesday 30 December 200
On Wed, Dec 30, 2009 at 04:50:40PM -, Tony Marston wrote:
> I have recently been engaged in an argument via email with someone who
> criticises my low opinion of design patterns (refer to
> http://www.tonymarston.net/php-mysql/design-patterns.html ). He says that
> design patterns are merely a
At 4:50 PM + 12/30/09, Tony Marston wrote:
What is your opinion? Are design patterns supposed to provide reusable code
or not? If not, and each implementation of a pattern takes just as much time
as the first, then where are the productivity gains from using design
patterns?
--
Tony Marston
On Wed, 2009-12-30 at 16:50 +, Tony Marston wrote:
> I have recently been engaged in an argument via email with someone who
> criticises my low opinion of design patterns (refer to
> http://www.tonymarston.net/php-mysql/design-patterns.html ). He says that
> design patterns are merely a con
On Sun, Mar 08, 2009 at 03:03:33PM +1100, Naz wrote:
>
> Generally, the approach I take is as follows:
>
> $errors = array();
> if (empty($_POST['name']))
>array_push($errors, 'A name was not entered.');
> if (empty($_POST['address']))
>array_push($errors, 'An address was no supplied.');
>
PJ wrote:
This is probably a mysql question, but their list is rather dull - I
think they don't appreciate my humor. Beside this list is fun ... and
informative.
Anyway, I can't figure this out. I am trying to verify inputs on a form
and even if I have all the required fields right, I still get t
Al wrote:
PJ wrote:
PJ wrote:
Daniel Brown wrote:
On Wed, Mar 4, 2009 at 17:51, PJ wrote:
elseif ($obligatoryFieldNotPresent = 1) {
$obligatoryFieldNotPresent = 0;
}
Are you certain you only wanted a single equal operator in the
last elseif() cond
>>> $obligatoryFieldNotPresent=null;
>>>
>>> foreach($_POST, as $value)
>>> {
>>> if(!empty($value)continue;
>>
>> Parse error. ;-P
>>
> There should be no comma there.
That fixes one, what about the rest? ;)
--
Postgresql & php tutorials
http://www.designmagick.com/
--
PHP General
Daniel Brown-7 wrote:
>
> On Wed, Mar 4, 2009 at 20:10, Al wrote:
>>
>> $obligatoryFieldNotPresent=null;
>>
>> foreach($_POST, as $value)
>> {
>>if(!empty($value)continue;
>
> Parse error. ;-P
>
There should be no comma there. See
http://id2.php.net/manual/en/control-structures.
On Wed, Mar 4, 2009 at 20:10, Al wrote:
>
> $obligatoryFieldNotPresent=null;
>
> foreach($_POST, as $value)
> {
> if(!empty($value)continue;
Parse error. ;-P
--
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
50% Off All Shared Hos
finally found the problem... wrong names for string and this is what now
verifies correctly
if (strlen($_POST["titleIN"]) == 0 ) {
$obligatoryFieldNotPresent = 1;
}
elseif (strlen($_POST["first_nameIN"]) == 0 ) {
$obligatoryFieldNotPresent = 1;
}
elsei
PJ wrote:
PJ wrote:
Daniel Brown wrote:
On Wed, Mar 4, 2009 at 17:51, PJ wrote:
elseif ($obligatoryFieldNotPresent = 1) {
$obligatoryFieldNotPresent = 0;
}
Are you certain you only wanted a single equal operator in the
last elseif() condition? F
PJ wrote:
> PJ wrote:
>> Daniel Brown wrote:
>>
>>> On Wed, Mar 4, 2009 at 17:51, PJ wrote:
>>>
>>>
>>>
elseif ($obligatoryFieldNotPresent = 1) {
$obligatoryFieldNotPresent = 0; }
>>> Are you certain you only wanted a single equal operator in the
>>> last elseif() condi
Shawn McKenzie wrote:
Chris wrote:
PJ wrote:
Daniel Brown wrote:
On Wed, Mar 4, 2009 at 17:51, PJ wrote:
elseif ($obligatoryFieldNotPresent = 1) {
$obligatoryFieldNotPresent = 0;
}
Are you certain you only wanted a single equal operator in the
last elseif() condi
PJ wrote:
> Daniel Brown wrote:
>
>> On Wed, Mar 4, 2009 at 17:51, PJ wrote:
>>
>>
>>>elseif ($obligatoryFieldNotPresent = 1) {
>>>$obligatoryFieldNotPresent = 0;
>>>}
>>>
>>>
>> Are you certain you only wanted a single equal operator in the
>> last e
Chris wrote:
> PJ wrote:
>> Daniel Brown wrote:
>>> On Wed, Mar 4, 2009 at 17:51, PJ wrote:
>>>
elseif ($obligatoryFieldNotPresent = 1) {
$obligatoryFieldNotPresent = 0;
}
>>> Are you certain you only wanted a single equal operator in the
>>> last el
PJ wrote:
Daniel Brown wrote:
On Wed, Mar 4, 2009 at 17:51, PJ wrote:
elseif ($obligatoryFieldNotPresent = 1) {
$obligatoryFieldNotPresent = 0;
}
Are you certain you only wanted a single equal operator in the
last elseif() condition? Further, are you sure it shou
Daniel Brown wrote:
> On Wed, Mar 4, 2009 at 17:51, PJ wrote:
>
>>elseif ($obligatoryFieldNotPresent = 1) {
>>$obligatoryFieldNotPresent = 0;
>>}
>>
>
> Are you certain you only wanted a single equal operator in the
> last elseif() condition? Further, are you sure
On Wed, Mar 4, 2009 at 17:51, PJ wrote:
> elseif ($obligatoryFieldNotPresent = 1) {
> $obligatoryFieldNotPresent = 0;
> }
Are you certain you only wanted a single equal operator in the
last elseif() condition? Further, are you sure it should even be an
elseif() and not a str
There is IF EXISTS for tables, is there the same thing for columns in the
table
like
IF EXISTS column IN TABLE table
? Just an idea
2008/8/13 VamVan <[EMAIL PROTECTED]>
> Interesting. Thanks guys!!
>
> On Wed, Aug 13, 2008 at 1:32 AM, Robin Vickery <[EMAIL PROTECTED]> wrote:
>
> > 2008/8/12 Vam
Interesting. Thanks guys!!
On Wed, Aug 13, 2008 at 1:32 AM, Robin Vickery <[EMAIL PROTECTED]> wrote:
> 2008/8/12 VamVan <[EMAIL PROTECTED]>:
> > Hello,
> >
> > I am working on data migration for one mysql db to another using PHP. How
> do
> > I check if a particular table has a particular column.
2008/8/12 VamVan <[EMAIL PROTECTED]>:
> Hello,
>
> I am working on data migration for one mysql db to another using PHP. How do
> I check if a particular table has a particular column. If not alter...
>
> Thanks
>
Use the information_schema:
SELECT COUNT(*) AS column_exists FROM information_schem
Jay Blanchard wrote:
> [snip]
> I am working on data migration for one mysql db to another using PHP.
> How do
> I check if a particular table has a particular column. If not alter...
> [/snip]
>
> Use DESCRIBE TABLE;
>
Then you'd have to parse the output - how about
SELECT FROM LIMIT 1 ?
[snip]
I am working on data migration for one mysql db to another using PHP.
How do
I check if a particular table has a particular column. If not alter...
[/snip]
Use DESCRIBE TABLE;
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Thu, January 24, 2008 9:39 am, Pastor Steve wrote:
> Greetings,
>
> Can anyone point me in the right direction on this?
>
> I want a link to an image that appears below the link after it is
> clicked. I
> think it would be an ³if² statement, but I am not sure where to start.
What you describe
On Jan 24, 2008 10:39 AM, Pastor Steve <[EMAIL PROTECTED]> wrote:
> Greetings,
>
> Can anyone point me in the right direction on this?
>
> I want a link to an image that appears below the link after it is clicked.
> I
> think it would be an ³if² statement, but I am not sure where to start.
there
On Oct 18, 2007, at 9:50 PM, Bastien Koert wrote:
Are you sure that the value is a string? If its numeric, then try
the check without the quotes around the value
http://www.php.net/manual/en/language.operators.comparison.php
"If you compare an integer with a string, the string is convert
I'd suggest a tutorial or something on BOOLEAN or LOGICAL OPERATORS.
For example:
true and false = false
true or false = true
not true and not false = false
not true or not false = true
and so on...
The IF statement will simply take the result of a logical operation,
and the result will either be
if (!in_array($component_reference, array(5,17)))
// ...
More compact.
On Oct 18, 2007, at 5:49 PM, "ron.php" <[EMAIL PROTECTED]>
wrote:
When $component_reference is 5 or 19 I don't want the echo statement
to
output to the screen. What is the correct syntax? What I have
below isn't
w
Are you sure that the value is a string? If its numeric, then try the check
without the quotes around the value
bastien> From: [EMAIL PROTECTED]> To: php-general@lists.php.net> Date: Thu, 18
Oct 2007 19:49:55 -0500> Subject: [PHP] IF command> > When $component_reference
is 5 or 19 I don't w
On Thu, 2007-10-18 at 19:57 -0500, ron.php wrote:
> I just tried to send this to the list. I am not trying make it post again, I
> don't think I had the e-mail address correct the first time.
>
> I am trying to stop $component_reference from doing the echo below when the
> value is 5 or 19. I
just change OR by AND.
2007/10/19, ron.php <[EMAIL PROTECTED]>:
> I just tried to send this to the list. I am not trying make it post again, I
> don't think I had the e-mail address correct the first time.
>
> I am trying to stop $component_reference from doing the echo below when the
> value is
Hi, here is the code:
if ( ($component_reference != "5") AND ($component_reference != "19") ) {
echo "" .
$component_name . "";
}
2007/10/19, ron.php <[EMAIL PROTECTED]>:
> When $component_reference is 5 or 19 I don't want the echo statement to
> output to the screen. What is the correc
On Tue, July 31, 2007 6:10 am, Hulf wrote:
> for ($value = 0; $value <= 2000; $value += 100) {
>
> echo " selected="selected" }> $value";
You could slap a ?: tertiary operator in there:
echo " $value";
but it might be a bit less cluttered to do:
$selected = $min_rent == $value ? 'selected="sel
Or another way...
for ($value = 0; $value <= 2000; $value += 100)
{
echo sprintf("%s", $value,
(($min_rent==$value) ? " selected=\"selected\"" : NULL), $value);
}
Hulf wrote:
> **
> This Email Has Been Virus Swept
> **
> I am outputting a s
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of
> Alan Milnes
> Sent: 31 July 2007 12:41
> To: php-general@lists.php.net
> Subject: Re: [PHP] if inside an echo.
>
>
> On 31/07/07, Hulf <[EMAIL PROTECTED]> wrote:
> &g
Edward Kay wrote:
-Original Message-
From: Hulf [mailto:[EMAIL PROTECTED]
Sent: 31 July 2007 12:11
To: php-general@lists.php.net
Subject: [PHP] if inside an echo.
I am outputting a selectbox and want to do the follwoing. How can
I add the
IF statement inside the the echo?
for ($v
On 31/07/07, Hulf <[EMAIL PROTECTED]> wrote:
> I am outputting a selectbox and want to do the follwoing. How can I add the
> IF statement inside the the echo?
Something like this:-
for ($value = 0; $value <= 2000; $value += 100) {
echo " $value";
Alan
--
PHP General Mailing List (http://www.
> -Original Message-
> From: Hulf [mailto:[EMAIL PROTECTED]
> Sent: 31 July 2007 12:11
> To: php-general@lists.php.net
> Subject: [PHP] if inside an echo.
>
>
> I am outputting a selectbox and want to do the follwoing. How can
> I add the
> IF statement inside the the echo?
>
>
> fo
I think you want OR instead of AND in your query...
It will be very dificult for both:
name+city+state
name
to be in your list of cen_chiefs...
cen_chiefs would have to have *both*:
Joe Chicago IL
Joe
in it, in order for Joe from Chicago, IL to match with AND.
OR would get rows where either thei
Jason Pruim wrote:
On Jun 21, 2007, at 1:58 PM, Roberto Mansfield wrote:
Jason Pruim wrote:
It's not quite making sense to me though... My understanding of IF
statements is if the condition is met it ignores all the other if's. Is
that not correct? At this point it's just me trying to figure
On Jun 21, 2007, at 1:58 PM, Roberto Mansfield wrote:
Jason Pruim wrote:
It's not quite making sense to me though... My understanding of IF
statements is if the condition is met it ignores all the other
if's. Is
that not correct? At this point it's just me trying to figure
things out
for
Jason Pruim wrote:
>
> It's not quite making sense to me though... My understanding of IF
> statements is if the condition is met it ignores all the other if's. Is
> that not correct? At this point it's just me trying to figure things out
> for my knowledge :)
No, that's not how it works. If the
1 - 100 of 549 matches
Mail list logo