Thanks!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hello,
is an alternative syntax.
http://php.net/manual/en/control-structures.alternative-syntax.php
Premek.
On Wed, 10 Jul 2013 13:15:22 +0200, Jim Giner
wrote:
Can someone tell me what this syntax is? I looked around but don't see
any mention of it.
while(condition) : (statement);
Can someone tell me what this syntax is? I looked around but don't see
any mention of it.
while(condition) : (statement);
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
> -Original Message-
> From: ma...@behnke.biz [mailto:ma...@behnke.biz]
> Sent: Tuesday, February 07, 2012 10:47 AM
> To: php-general@lists.php.net; ad...@buskirkgraphics.com
> Subject: Re: [PHP] syntax question
>
>
>
> ad...@buskirkgraphics.com hat
ad...@buskirkgraphics.com hat am 7. Februar 2012 um 15:11 geschrieben:
> I have been struggling with this issue for an hour and honestly I am not
> sure why.
>
> I consider myself to be pretty savvy with MySQL but I am running into an
> syntax error that is just flat out eluding me.
>
>
>
> $qu
> -Original Message-
> From: Louis Huppenbauer [mailto:louis.huppenba...@gmail.com]
> Sent: Tuesday, February 07, 2012 9:24 AM
> To: ad...@buskirkgraphics.com
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] syntax question
>
> Generally... Wouldn'
Generally... Wouldn't grouping by an id (which is normally unique) have no
real benefit... Except some strange behaviour?
Just to clarify: Why aren't you sticking to the LIMIT 1?
2012/2/7
> I have been struggling with this issue for an hour and honestly I am not
> sure why.
>
> I consider mysel
I have been struggling with this issue for an hour and honestly I am not
sure why.
I consider myself to be pretty savvy with MySQL but I am running into an
syntax error that is just flat out eluding me.
$query = "SELECT `table2`.`name` from `table1` ,`table2` WHERE
`table2`.`user_id`=`table1`.
On 8/3/11 10:41 AM, "ad...@buskirkgraphics.com"
wrote:
>> -Original Message-
>> From: Gates, Jeff [mailto:gat...@si.edu]
>> Sent: Wednesday, August 03, 2011 10:23 AM
>> To: php-general@lists.php.net
>> Subject: [PHP] Syntax Question
>>
&g
> -Original Message-
> From: Gates, Jeff [mailto:gat...@si.edu]
> Sent: Wednesday, August 03, 2011 10:23 AM
> To: php-general@lists.php.net
> Subject: [PHP] Syntax Question
>
> I, too, am a super newbie. I have a beginning knowledge of being able
> to
> &q
I, too, am a super newbie. I have a beginning knowledge of being able to
"read" php and understand its syntax but I can¹t write it. This is a bit
complicated but here¹s my problem:
I want to create a variable in PHP that I can use to link to an image in our
museum's image website. We have done it
Escape it, use either htmlentities (with ENT_QUOTES) or addslashes.
--
itoctopus - http://www.itoctopus.com
""Richard Lynch"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Mon, March 26, 2007 9:59 am, Ross wrote:
> > Can I put post values directly into insert statements?
> >
> >
On Mon, March 26, 2007 9:59 am, Ross wrote:
> Can I put post values directly into insert statements?
>
> $query = "INSERT INTO categories (category_name) VALUES
> ('$_POST['cat_name'])";
Sure!
If you want your webserver to get hacked by the Bad Guys, just go
right ahead and do that.
[that was to
At 3:59 PM +0100 3/26/07, Ross wrote:
Can I put post values directly into insert statements?
$query = "INSERT INTO categories (category_name) VALUES
('$_POST['cat_name'])";
Open to sql injection.
tedd
--
---
http://sperling.com http://ancientstones.com http://earthstones.com
--
PHP Ge
Ross wrote:
Can I put post values directly into insert statements?
$query = "INSERT INTO categories (category_name) VALUES
('$_POST['cat_name'])";
Yes, although this is not recommended.
What is someone puts a single quote in there? Or some other bad
characters
otherwise... 2 optio
Ross wrote:
> Can I put post values directly into insert statements?
>
> $query = "INSERT INTO categories (category_name) VALUES
> ('$_POST['cat_name'])";
>
Yes you can, but it is not secure to do that!
use (insecure):
$query = "INSERT INTO categories (category_name) VALUES
('{$_POST['cat_na
Can I put post values directly into insert statements?
$query = "INSERT INTO categories (category_name) VALUES
('$_POST['cat_name'])";
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
It's fairly simple. The code you posted could also be written:
if(strpos($a,'-')){
$a = explode('-',$a,2);
}else{
$a = array($a);
}
It's called the ternary conditional operator. Unfortunatley, it's
buried in the PHP manual.
http://us2.php.net/manual/en/language.expressions.php
Jimmy wrote:
I'
I'm looking through some existing code for a project I'm working on, but
I keep running into this syntax that I really don't understand. Here's
an example:
$a=strpos($a,'-')?explode('-',$a,2):array($a);
What do the ? and the : do here? I'm seeing this sort of thing all over
and just have no idea
Many thanks Jason.
TR
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Anthony -
The column list is a comma seperated list, the last column cannot have a
comma after it or the SQL server will expect another column to be listed.
However in that code segment it is not trying to determine if there is
or is not a column, it is simply attempting to add the (length)
at
Hi,
Thursday, February 20, 2003, 3:34:31 AM, you wrote:
AR> This is what I was getting at.
AR> The following is correct mysql syntax in which a comma must be added after
AR> each field - except for the last field - in this case price:
AR> i.e.,
AR> .
AR> CREATE TABLE chairs(
AR>
This is what I was getting at.
The following is correct mysql syntax in which a comma must be added after
each field - except for the last field - in this case price:
i.e.,
.
CREATE TABLE chairs(
id int(5),
item varchar(50),
desc text,
price float
);
.
Ho
At 18:06 19.02.2003, Anthony Ritter spoke out and said:
[snip]
>The question:
>
>Is the reasoning that a comma *must* be added since this is _within_ a loop?
>
>As in:
>CREATE TABLE chairs (
>id INT(5),
>item VARCHAR(50),
>desc TEXT ,
>price FLOAT , // commo
Greetings...
The following is the _third_ part of a script found in Julie Meloni's book
"PHP Essentials" on page 118.
The script dynmically generates a form box of field names, field types and
field sizes for a mysql table depending on what the user chooses.
My question is about syntax or logic i
Hello
"Kelly Meeks" <[EMAIL PROTECTED]> wrote:
> I saw this used in a script, but after a couple of searches didn't come up
with anything on php.net.
I think you're looking for this:
http://www.php.net/manual/en/language.types.string.php#language.types.string
.syntax.heredoc
- E
...[snip]...
There are typically called a 'heredoc' or 'here document'. basically it
changes the double quotation mark(") to
'content' (in this case). To start, do this <<
and to end it just type content;
on a line by itself.
The example you showed does echo the stuff out. It sets all the internal
html to $
I saw this used in a script, but after a couple of searches didn't come up with
anything on php.net.
$phpvarhere
content;
echo $var;
?>
So, does this allow you to output mixed html/php without having to escape offending
characters with no echo or print?
Conceptually, would the syntax ab
let me be more specific...
if a field value is null how do I test for it in the result set, or the
array?
here's a real live example... I'm working with prepaid phone cards, and if
a card has not expired yet then the field zombie_date will be null.
so - when I do the mysql_fetch_assoc ($sql) w
> mysql_field_name() might help... but generally I know what fields I want
to
> grab, so I don't need this... I found this answer on
http://php.net/mysql.
> just as you could :)
I've been coding in other languages for about 6 years now, and I have looked
through a lot of the mysql stuff, and the
EMAIL PROTECTED]
Subject: Re: [PHP] syntax question
Justin French wrote:
>on 30/09/02 2:44 PM, Jeff Bluemel ([EMAIL PROTECTED]) wrote:
>
>
>>how to I test for a null value?
>>
>>
>empty()? isset()? if($var == "")? if($var == "NULL")?? h
Justin French wrote:
>on 30/09/02 2:44 PM, Jeff Bluemel ([EMAIL PROTECTED]) wrote:
>
>
>>how to I test for a null value?
>>
>>
>empty()? isset()? if($var == "")? if($var == "NULL")?? have a look in
>the php manual for string functions, and comparison operators
>
I think he maybe meant
on 30/09/02 2:44 PM, Jeff Bluemel ([EMAIL PROTECTED]) wrote:
>if there a command that will give me the name of the fields
> in the result set?
mysql_field_name() might help... but generally I know what fields I want to
grab, so I don't need this... I found this answer on http://php.net/mysql.
j
couple of questions... I'm am learning php & mysql without any books (will
also be using postgres, and informix, but assuming most of these are about
the same other then sql syntax), and through internet resources. there are
a lot of good step throughs on a lot of stuff, but there are some thing
I'm having difficulty understanding what the array does or refers to in the
eregi() function using php.
Listing below are returned strings with
[0]
[1]
[2]
..
(.*)
...
quick brown fox jumped over the lazy dog // output with $ma
The @ suppresses any warning/error messages that are produced - hence the
complaints when it's taken out :-)
Cheers
Jon
-Original Message-
From: Erols [mailto:[EMAIL PROTECTED]]
Sent: 31 August 2001 01:06
To: [EMAIL PROTECTED]
Subject: [PHP] PHP Syntax question.
Sorry for my igno
Sorry for my ignorance.
I just saw some PHP syntax that I am not aware of. Could someone please shed
some light on this.
What is the purpose of the @ in the following call to the PHP mail method?
@mail( /* some parameters */ );
If I remove the @, then php compiler complains.
Thank you in advanc
37 matches
Mail list logo