[PHP] syntax question

2013-07-10 Thread Jim Giner
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

Re: [PHP] syntax question

2013-07-10 Thread Přemysl Fiala
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 jim.gi...@albanyhandball.com wrote: Can someone tell me what this syntax is? I looked around but don't see any mention of it.

Re: [PHP] syntax question

2013-07-10 Thread Jim Giner
Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] syntax question

2012-02-07 Thread admin
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

Re: [PHP] syntax question

2012-02-07 Thread Louis Huppenbauer
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 ad...@buskirkgraphics.com I have been struggling with this issue for an hour and honestly I am not sure

RE: [PHP] syntax question

2012-02-07 Thread admin
-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't grouping by an id (which is normally

Re: [PHP] syntax question

2012-02-07 Thread ma...@behnke.biz
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. $query =

RE: [PHP] syntax question

2012-02-07 Thread admin
-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 am 7. Februar 2012 um 15:11 geschrieben

[PHP] Syntax Question

2011-08-03 Thread Gates, Jeff
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

RE: [PHP] Syntax Question

2011-08-03 Thread admin
-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 read php and understand its syntax but I can

Re: [PHP] Syntax Question

2011-08-03 Thread Gates, Jeff
On 8/3/11 10:41 AM, ad...@buskirkgraphics.com 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 I, too, am a super newbie. I have

[PHP] syntax question

2007-03-26 Thread Ross
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

Re: [PHP] syntax question

2007-03-26 Thread cajbecu
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

Re: [PHP] syntax question

2007-03-26 Thread Brad Bonkoski
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

Re: [PHP] syntax question

2007-03-26 Thread tedd
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

Re: [PHP] syntax question

2007-03-26 Thread Richard Lynch
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

Re: [PHP] syntax question

2007-03-26 Thread itoctopus
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? $query =

[PHP] syntax question

2003-03-06 Thread Jimmy
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

Re: [PHP] syntax question

2003-03-06 Thread Leif K-Brooks
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:

[PHP] syntax question

2003-02-19 Thread Anthony Ritter
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 in

Re: [PHP] syntax question

2003-02-19 Thread Ernest E Vogelsinger
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 , // common should

Re: [PHP] syntax question

2003-02-19 Thread Anthony Ritter
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 ); .

Re[2]: [PHP] syntax question

2003-02-19 Thread Tom Rogers
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 id

Re: [PHP] syntax question

2003-02-19 Thread Jason k Larson
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)

Re: [PHP] syntax question

2003-02-19 Thread Anthony Ritter
Many thanks Jason. TR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] syntax question...

2002-11-12 Thread Kelly Meeks
I saw this used in a script, but after a couple of searches didn't come up with anything on php.net. ? $var=content table tr td font color=red $phpvarhere /font /td /tr /table content; echo $var; ? So, does this allow you to output mixed html/php without having to escape offending characters

Re: [PHP] syntax question...

2002-11-12 Thread bahwi
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 content 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

Re: [PHP] syntax question...

2002-11-12 Thread @ Edwin
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]... --

[PHP] syntax question

2002-09-29 Thread Jeff Bluemel
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

Re: [PHP] syntax question

2002-09-29 Thread Justin French
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.

Re: [PHP] syntax question

2002-09-29 Thread Chris Shiflett
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 testing for

RE: [PHP] syntax question

2002-09-29 Thread Smith, Benjamin
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)?? have a look in the php manual for string functions, and comparison

Re: [PHP] syntax question

2002-09-29 Thread Jeff Bluemel
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

Re: [PHP] syntax question

2002-09-29 Thread Jeff Bluemel
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)

[PHP] syntax question - eregi()

2002-09-19 Thread Anthony Ritter
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] .. ? $fp =fopen(C:\\TextFiles\\Test.htm,r); $content = fread($fp,10); eregi(b(.*)hr

[PHP] PHP Syntax question.

2001-08-31 Thread Erols
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

RE: [PHP] PHP Syntax question.

2001-08-31 Thread Jon Haworth
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 ignorance