RE: [PHP] Syntax to call a class' methods in your own class

2006-05-24 Thread Brady Mitchell
This works: $rs= $this-conn-GetAll(SELECT title FROM content WHERE page_id= ?, $id); You can't iterate through an array like you are trying to do. Using the GetAll() function returns an array, you have to use the Execute() function to be able to iterate through $rs like you are trying to

Re: [PHP] Syntax to call a class' methods in your own class

2006-05-24 Thread Graham Anderson
thanks :) that helps g On May 24, 2006, at 3:19 PM, Brady Mitchell wrote: This works: $rs= $this-conn-GetAll(SELECT title FROM content WHERE page_id= ?, $id); You can't iterate through an array like you are trying to do. Using the GetAll() function returns an array, you have to use the

Re: [PHP] Syntax Oddity

2006-05-02 Thread Martin Alterisio
2006/5/2, Richard Lynch [EMAIL PROTECTED]: Does anybody have a rational explanation for what purpose in life the following syntax is considered acceptable? ?php $query = UPDATE whatever SET x = 1; $query; ? Note that the line with just $query; on it doesn't, like, do anything. I suppose

Re: [PHP] Syntax Oddity

2006-05-02 Thread Dave Goodchild
Hmmm. The only time I ever use anything remotely like that is in a loop or other code are where I don't want anything to happen ie for ($foo=0;$foo=10;$foo++) { On 02/05/06, Martin Alterisio [EMAIL PROTECTED] wrote: 2006/5/2, Richard Lynch [EMAIL PROTECTED]: Does anybody have a rational

Re: [PHP] syntax checking?

2005-11-23 Thread Bing Du
Bing Du wrote: Jay Blanchard wrote: [snip] How should PHP syntax be checked before execution? Anything similar to what option -c does in Perl? % perl -c test.pl [/snip] from the command line /usr/local/bin/php -i myScript.php [/snip] Ooops, sorry, should be an ell l /usr/local/bin/php

RE: [PHP] syntax checking?

2005-11-23 Thread Jay Blanchard
[snip] Even with error_reporting set to E_ALL in php.ini, I still get 'Errors parsing file.php' using the php command with the -l option. Anyway to see more than that? [/snip] Here are some command line options http://us2.php.net/features.commandline You could run it in a browser to get line

Re: [PHP] syntax checking?

2005-11-23 Thread Bing Du
Jay Blanchard wrote: [snip] Even with error_reporting set to E_ALL in php.ini, I still get 'Errors parsing file.php' using the php command with the -l option. Anyway to see more than that? [/snip] Here are some command line options http://us2.php.net/features.commandline You could run it

RE: [PHP] syntax checking?

2005-11-23 Thread Jay Blanchard
[snip] Just found out this web based PHP syntax checking tool http://www.meandeviation.com/tutorials/learnphp/php-syntax-check/, it helped me find the problem. Pretty nice. [/snip] Nice find. Tried it and it works pretty well. -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

Re: [PHP] syntax checking?

2005-11-23 Thread John Nichel
Jay Blanchard wrote: [snip] Just found out this web based PHP syntax checking tool http://www.meandeviation.com/tutorials/learnphp/php-syntax-check/, it helped me find the problem. Pretty nice. [/snip] Nice find. Tried it and it works pretty well. I get this when I try to check a php

RE: [PHP] syntax checking?

2005-11-22 Thread Jay Blanchard
[snip] How should PHP syntax be checked before execution? Anything similar to what option -c does in Perl? % perl -c test.pl [/snip] from the command line /usr/local/bin/php -i myScript.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] syntax checking?

2005-11-22 Thread Jay Blanchard
[snip] How should PHP syntax be checked before execution? Anything similar to what option -c does in Perl? % perl -c test.pl [/snip] from the command line /usr/local/bin/php -i myScript.php [/snip] Ooops, sorry, should be an ell l /usr/local/bin/php -l myScript.php -- PHP General Mailing

Re: [PHP] syntax checking?

2005-11-22 Thread Bing Du
Jay Blanchard wrote: [snip] How should PHP syntax be checked before execution? Anything similar to what option -c does in Perl? % perl -c test.pl [/snip] from the command line /usr/local/bin/php -i myScript.php [/snip] Ooops, sorry, should be an ell l /usr/local/bin/php -l myScript.php

Re: [PHP] syntax for multiple boolean

2005-08-27 Thread sub
You could write what your code does now like this. if (empty ($fname) || empty ($sname) || empty ($address)) { // do something } If you want your first condition to be met and one of your second two conditions to be met you can do it like this: if (empty ($fname) (empty ($sname) || empty

Re: [PHP] syntax for two comparison operators

2005-08-25 Thread Richard Lynch
On Wed, August 24, 2005 6:10 pm, Jordan Miller wrote: Is there a technical reason why PHP does not allow comparison operator expressions like the following: if (2 $x = 4) {} 2 $x = 4 is a valid expression already. 2 $x is evaluated first, and returns true/false true/false is compared

Re: [PHP] syntax for two comparison operators

2005-08-25 Thread Jordan Miller
Good to know about expression evaluation. Writing the expression(s) like that (left-to-right and right-to-left) solves my dilemma... thanks! Jordan On Aug 25, 2005, at 2:44 AM, Richard Lynch wrote: I personally would use: ((2 $x) ($x = 4)) -- PHP General Mailing List

Re: [PHP] syntax for two comparison operators

2005-08-24 Thread Philip Hallstrom
Is there a technical reason why PHP does not allow comparison operator expressions like the following: if (2 $x = 4) {} I prefer this concise way as it is common for mathematics expressions, and much easier to grasp physically on first glance. From what I can tell, this expression can

RE: [PHP] syntax highlighting your php code on a web page

2005-08-03 Thread Jay Blanchard
[snip] Is there a class or some code out there which enables you to print your PHP code to a web page and make it appear with syntax highlighting? As an example of what I am after, have a look here; http://www.phpfreaks.com/phpmanual/page/function.ldap-add.html Please note this is just an

Re: [PHP] syntax error, unexpected T_STRING

2005-07-18 Thread Matthew Weier O'Phinney
* George B [EMAIL PROTECTED] : Jim Moseby wrote: I am trying to connect to a datbase: mysql_select_db ('database') or die (couldnt connect to databse) What is wrong here? This is the error: Parse error: syntax error, unexpected T_STRING in file name on line 12

RE: [PHP] syntax error, unexpected T_STRING

2005-07-18 Thread Jim Moseby
Thanks JM! It was another one of my usual mistakes :P Forgot the semicolon. I don't underestand why you have to put in so many semicolons... Hmm.. Is it a thing from C or something? When I see that T_STRING error, missing semicolon is the first thing I look for. I don't know the history

RE: [PHP] syntax error, unexpected T_STRING

2005-07-18 Thread Jim Moseby
I am trying to connect to a datbase: mysql_select_db ('database') or die (couldnt connect to databse) What is wrong here? This is the error: Parse error: syntax error, unexpected T_STRING in file name on line 12 -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] syntax error, unexpected T_STRING

2005-07-18 Thread John Nichel
George B wrote: I am trying to connect to a datbase: mysql_select_db ('database') or die (couldnt connect to databse) What is wrong here? This is the error: Parse error: syntax error, unexpected T_STRING in file name on line 12 Are either one of those lines, line 12? -- John C.

Re: [PHP] syntax error, unexpected T_STRING

2005-07-18 Thread George B
Jim Moseby wrote: I am trying to connect to a datbase: mysql_select_db ('database') or die (couldnt connect to databse) What is wrong here? This is the error: Parse error: syntax error, unexpected T_STRING in file name on line 12 -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] Syntax Coloring

2005-05-17 Thread Burhan Khalid
hima wrote: Hi all, I am trying to apply syntax coloring to my source code as I type it in unix shell. I work on a mac machine. How do I achieve this. In the php.ini file I see these following lines commented out. ; Colors for Syntax Highlighting mode. Anything that's acceptable in ; font

Re: [PHP] Syntax Highlighting variables not appearing

2005-02-28 Thread Richard Lynch
Tom Whitbread wrote: Can anyone explain why this is happening. I am using the following code For giving code examples on my website with syntax highlighting $text = 'lt;?php \$my_code = echo 'text text text text'; \$foo = 'bar';; example_function(\$my_code); ?gt'; This is not a valid PHP

Re: [PHP] Syntax highlighting of odd language

2004-11-08 Thread Aaron Gould
M. Sokolewicz wrote: Now, the problem with such a solution is the following. Imagine you have the following keywords: include require in of typof now, when you replace include with span class=highlightedinclude/span, it'll go on, and also replace all instances of in, so you'll end up with

Re: [PHP] Syntax Limitation - dynamic static member access

2004-11-08 Thread Jake Press
Hi all, Just to let everyone know - I've reported this as a bug. http://bugs.php.net/bug.php?id=30716 Fingers crossed :) Yours Sincerely Jake Press -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Syntax problem - dynamic static member access

2004-11-07 Thread Curt Zirzow
You've just hijacked this thread. Please start a new message instead of replying to a message and changing the subject to talk about something else. Curt -- Quoth the Raven, Nevermore. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Syntax Limitation - dynamic static member access

2004-11-07 Thread Curt Zirzow
* Thus wrote Jake Press: Oops, sorry :( I accidentally hi-jacked another thread. Thanks for taking notice :) Here are the relevant posts for anyone thats reading: - http://news.php.net/php.general/201395 - http://news.php.net/php.general/201403 - http://news.php.net/php.general/201405

Re: [PHP] Syntax highlighting of odd language

2004-11-05 Thread Bruno B B Magalhães
Aaron, why don't you use a very simle sintax like this one: $code = 'function what() { do oddname; %oddsyntax }'; function highlight_code($code) { $oddsyntax = array('oddsyntax','oddsyntax2','oddsyntax3'); for($i = 0; $i = count($oddsyntax)-1; $i++) { $highlighted_code =

Re: [PHP] Syntax highlighting of odd language

2004-11-05 Thread Aaron Gould
Bruno B B Magalhães wrote: $code = 'function what() { do oddname; %oddsyntax }'; function highlight_code($code) { $oddsyntax = array('oddsyntax','oddsyntax2','oddsyntax3'); for($i = 0; $i = count($oddsyntax)-1; $i++) { $highlighted_code = eregi_replace($oddsyntax[$i],'spam

Re: [PHP] Syntax highlighting of odd language

2004-11-05 Thread M. Sokolewicz
Aaron Gould wrote: Bruno B B Magalhães wrote: $code = 'function what() { do oddname; %oddsyntax }'; function highlight_code($code) { $oddsyntax = array('oddsyntax','oddsyntax2','oddsyntax3'); for($i = 0; $i = count($oddsyntax)-1; $i++) { $highlighted_code =

RE: [PHP] syntax questoin

2004-09-16 Thread Jay Blanchard
[snip] $Msg .= Test is complete I'm thinking it means concatenate $Msg with Test is complete and then store the new string into $Msg Am I right? [/snip] Yes. You might see $Msg = (no concatenator) somewhere above it in the code...we code long SQL statements and things like e-mail bodies using

Re: [PHP] syntax questoin

2004-09-16 Thread Matt M.
$Msg .= Test is complete I'm thinking it means concatenate $Msg with Test is complete and then store the new string into $Msg Am I right? you are correct, same as: $Msg = $Msg.Test is complete -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] syntax questoin

2004-09-16 Thread John Nichel
Victor C. wrote: Hi, I just started with PHP. (I used to work on ASP a lot) What does the syntax .= do? i see a line of code that says $Msg .= Test is complete I'm thinking it means concatenate $Msg with Test is complete and then store the new string into $Msg Am I right? Thanks. It does

RE: [PHP] Syntax Help, Please

2004-06-15 Thread Rick Fletcher
I've forgotten how to assign something like this... $someStr = EOF bunch of raw non-echo'd html EOF; But can't seem to get the right syntax. Tried looking in the manual, but don't even know what I'm looking for! You're looking for a heredoc.

Re: [PHP] Syntax Help, Please

2004-06-15 Thread janet
In a message dated 6/15/2004 10:20:59 AM Pacific Daylight Time, [EMAIL PROTECTED] writes: I've forgotten how to assign something like this... $someStr = EOF bunch of raw non-echo'd html EOF; But can't seem to get the right syntax. Tried looking in the manual, but don't even know what

Re: [PHP] Syntax Help, Please

2004-06-15 Thread Robin Vickery
On Tue, 15 Jun 2004 13:20:24 -0400, Steve Douville [EMAIL PROTECTED] wrote: I've forgotten how to assign something like this... $someStr = EOF bunch of raw non-echo'd html EOF; But can't seem to get the right syntax. Tried looking in the manual, but don't even know what I'm

Re: [PHP] Syntax error (missing operator) in query expression

2004-04-15 Thread Curt Zirzow
* Thus wrote AgfTech Lists ([EMAIL PROTECTED]): Hi All Following is the INSERT statement I am executing, snip INSERT INTO customer (email, password, handle, fname, lname, company, tax_id, addr1, addr2, city, state, zipcode, country, dayphone, evephone, fax, paymethod, cardname,

Re: [PHP] Syntax error (missing operator) in query expression

2004-04-15 Thread Marek Kilimajer
This answers it all: http://sk.php.net/addslashes#28429 AgfTech Lists wrote: Hi All Following is the INSERT statement I am executing, snip INSERT INTO customer (email, password, handle, fname, lname, company, tax_id, addr1, addr2, city, state, zipcode, country, dayphone, evephone, fax,

Re: [PHP] Syntax error (missing operator) in query expression

2004-04-15 Thread AgfTech Lists
Got it from there! Thanks! Regards Aman On Thu, 2004-04-15 at 18:27, Marek Kilimajer wrote: This answers it all: http://sk.php.net/addslashes#28429 AgfTech Lists wrote: Hi All Following is the INSERT statement I am executing, snip INSERT INTO customer (email, password,

Re: [PHP] syntax for printing multi-dimensional arrays

2004-03-23 Thread Tom Rogers
Hi, Tuesday, March 23, 2004, 8:03:05 PM, you wrote: BP Hi all BP I am having problems printing members of an array that has two BP dimensions and am wondering if someone can help me with the syntax BP required to do this. BP If i have the follwing code: BP ?php BP

Re: [PHP] syntax help

2004-02-13 Thread Richard Davey
Hello bob, Friday, February 13, 2004, 12:10:06 PM, you wrote: bp $array=array(Flyer,Email,Phone); bp $array_len=count($array); bp for($i=0;$i$array_len;$i++){ bp $query=select count(score) from test_table bp where source = '$array[$i]'; bp $result=mssql_query($query,$numero); bp

Re: [PHP] Syntax

2004-02-13 Thread John Nichel
PETCOL wrote: snip This line is whats causing me all the greif: echo option value=$_POST[Country];selected\n$_POST[Country];/option\n; Parse error: parse error, expecting `','' or `';'' Suggestions or tutorials please ;-) Col You're wrapping the whole string in double quotes (), not

Re: [PHP] syntax error

2004-01-26 Thread Phil Driscoll
On Monday 26 January 2004 07:37, John Taylor-Johnston wrote: Obviously, I'm screwing up my syntax trying to add 2003.php to the end. How should I express this line please :) ? ?php include (/home/users/q/qx04t9mu/www/glq2-test/calendars/+strtolower(date(F))+200 3.htm); ? replace the + symbols

Re: [PHP] syntax error

2004-01-26 Thread John Taylor-Johnston
Thanks. Duh :) replace the + symbols with . and also date(F) should be date('F'). Sleepy time. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Syntax Error - This is WEIRD!

2004-01-20 Thread Nick Wilson
* and then Dagfinn Reiersøl declared Yes your right, that?s exactly the problem. I didn?t even realize he was doing that. By including the PHP file via HTTP, you are including the OUTPUT of the PHP file, not the actual PHP file itself. e.g. by including a file with the following

Re: [PHP] Syntax Error - This is WEIRD!

2004-01-16 Thread Richard Davey
Hello Nick, Friday, January 16, 2004, 2:16:43 PM, you wrote: NW if a script calls antohter like NW 'include('http://site.com/index.php'); NW Why would I get a syntax error on line 1 of index.php when it looks like NW this: NW ?php NW // line one above this one NW What's the deal there? Say

Re: [PHP] Syntax Error - This is WEIRD!

2004-01-16 Thread Nick Wilson
* and then Richard Davey declared Hello Nick, Friday, January 16, 2004, 2:16:43 PM, you wrote: NW if a script calls antohter like NW 'include('http://site.com/index.php'); NW Why would I get a syntax error on line 1 of index.php when it looks like NW this: NW ?php NW // line

RE: [PHP] Syntax Error - This is WEIRD!

2004-01-16 Thread Jeremy
Did the script accidently get saved in MS-DOS text format? -Original Message- From: Donald Tyler [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 8:53 AM To: [EMAIL PROTECTED] Subject: [PHP] Syntax Error - This is WEIRD! There could be something you're not seeing and assuming

Re: [PHP] Syntax Error - This is WEIRD!

2004-01-16 Thread Dagfinn Reiersøl
Nick Wilson wrote: if a script calls antohter like 'include('http://site.com/index.php'); Why would I get a syntax error on line 1 of index.php when it looks like this: ?php // line one above this one What's the deal there? Many thanks for any insight ;-) I've never tried to do an include

RE: [PHP] Syntax Error - This is WEIRD!

2004-01-16 Thread Donald Tyler
be including the word Hello as PHP code, which is obviously going to cause a syntax error. -Original Message- From: Dagfinn Reiersøl [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 10:18 AM To: PHP General Subject: Re: [PHP] Syntax Error - This is WEIRD! Nick Wilson wrote

Re: [PHP] Syntax Error - This is WEIRD!

2004-01-16 Thread Dagfinn Reiersl
:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 10:18 AM To: PHP General Subject: Re: [PHP] Syntax Error - This is WEIRD! Nick Wilson wrote: if a script calls antohter like 'include('http://site.com/index.php'); Why would I get a syntax error on line 1 of index.php when it looks like

Re: [PHP] Syntax Error - This is WEIRD!

2004-01-16 Thread Jason Wong
On Saturday 17 January 2004 01:50, Dagfinn Reiersl wrote: Yes. I read the manual which provides no clear explanation (I suspect that whoever wrote it didn't actually know how it works). So I decided to test it. It does exactly what you say it does. I made an include file like this: In

RE: [PHP] Syntax Error - This is WEIRD!

2004-01-16 Thread Donald Tyler
: Dagfinn Reiersøl [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 11:50 AM To: PHP General Subject: Re: [PHP] Syntax Error - This is WEIRD! Donald Tyler wrote: Yes your right, that’s exactly the problem. I didn’t even realize he was doing that. By including the PHP file via HTTP, you

Re: [PHP] Syntax Error - This is WEIRD!

2004-01-16 Thread Dagfinn Reiers?l
Jason Wong wrote: On Saturday 17 January 2004 01:50, Dagfinn Reiersl wrote: Yes. I read the manual which provides no clear explanation (I suspect that whoever wrote it didn't actually know how it works). So I decided to test it. It does exactly what you say it does. I made an include file

Re: [PHP] Syntax Error - This is WEIRD!

2004-01-16 Thread Dagfinn Reiersøl
Donald Tyler wrote: Yes that is true. But I would strongly recommend against doing that. You should never include anything over HTTP. Its extremely messy, 100% insecure and just a very very bad idea. My spontaneous reaction is to agree with you. On the other hand, are SOAP or XML-RPC over

Re: [PHP] syntax problem, constants in quoted strings

2003-11-18 Thread Marek Kilimajer
Adam i Agnieszka Gasiorowski FNORD wrote: How do you insert a constant into a quoted string, do I need to use concatenation operator like this quoted string . CONSTANT . quoted string, Yes or there is some way to insert it inline, like normal variables? No -- PHP

Re: [PHP] syntax error using header and SID

2003-09-04 Thread John W. Holmes
bob pilly wrote: Hi all Can someone tell me what the correct syntax is to pass a Session ID via the header redirect is? Im trying: header( Location: page2.php??echo strip_tags (SID)? ) but it isnt working for me and all the docs i can find just deal with tagging it to the end of a hyperlink.

Re: [PHP] syntax error using header and SID

2003-09-04 Thread Chris Hayes
At 18:33 4-9-03, you wrote: Hi all Can someone tell me what the correct syntax is to pass a Session ID via the header redirect is? Im trying: header( Location: page2.php??echo strip_tags (SID)? ) You are making a row of mistakes that suggest it is a good idea to read a bit on PHP syntax and how

Re: [PHP] syntax error using header and SID

2003-09-04 Thread Tyler Lane
On Thu, 2003-09-04 at 09:33, bob pilly wrote: Hi all Can someone tell me what the correct syntax is to pass a Session ID via the header redirect is? Im trying: header( Location: page2.php??echo strip_tags (SID)? ) header( Location: page2.php?. strip_tags( SID ) ); the problem you are

Re: [PHP] Syntax query

2003-03-09 Thread Ernest E Vogelsinger
At 13:38 09.03.2003, Nik Makepeace said: [snip] Can anyone tell me why this doesn't work: $db_object = pg_fetch_object($this-getLastResult()); In imaginary interactive mode, it works like this: ME echo $this-getLastResult(); PHP Resource id #67 ME echo

Re: [PHP] Syntax query

2003-03-09 Thread Nik Makepeace
On Mon, 2003-03-10 at 03:01, Ernest E Vogelsinger wrote: At 13:38 09.03.2003, Nik Makepeace said: [snip] Can anyone tell me why this doesn't work: $db_object = pg_fetch_object($this-getLastResult()); pg_fetch_object() returns an object with

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:

Re: [PHP] syntax error

2003-03-04 Thread Kevin Stone
Where is $line coming from? The function won't output what you don't input. Other than that I don't see anything wrong. - Kevin - Original Message - From: John Taylor-Johnston [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 4:33 PM Subject: [PHP] syntax error

Re: [PHP] syntax error

2003-03-04 Thread John Taylor-Johnston
Thanks Keven. Didn't see that. ?php $line = AU: Tomlinson,-Brian; $AU = filter_strings(AU: ,$line); function filter_strings($tofilter,$line){ if(eregi('^'.$tofilter.' (.*)$',$line,$m)) { $filtered=$m[1]; return $filtered; } } ? -- PHP General Mailing List

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: [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

Re: [PHP] syntax to reference $_POST within function

2002-12-20 Thread Jamie
Thanks for the vote of confidence. I ended up getting it working with this: import_request_variables('p', 'p_'); function check_banlist($banlist, $p_email) { This is what I had been trying to accomplish but was writing it this way: function check_banlist($banlist, $_POST['email']) { Maybe you

Re: [PHP] syntax to reference $_POST within function

2002-12-20 Thread Leif K-Brooks
You don't need to import the request variables for that to work. The variable names in the function definition have no relationship to variables outside of it. Most likely, you're calling with something like: check_banlist($banlist,$p_email); but you could also call it with:

Re: [PHP] syntax to reference $_POST within function

2002-12-20 Thread Philip Olson
This is a very important point to understand, I tried (and failed) to explain it. I think Leif made it pretty clear though, here's another :) // $a can be anything when you call the function function bar ($a) { print $a; } bar ('Hello World'); bar ($_POST['something']); Regards, Philip

Re: [PHP] syntax to reference $_POST within function

2002-12-19 Thread Philip Olson
First, read this: http://www.php.net/variables.external Second, assuming you have a PHP version equal to or greater than 4.1.0 and the method of the form is POST, you'd do something like this: $banlist = array('[EMAIL PROTECTED]'); echo check_banlist($banlist, $_POST['email']); Your

Re: [PHP] Syntax Help

2002-11-14 Thread Jason Wong
On Thursday 14 November 2002 17:22, conbud wrote: Whats wrong here ?? The variables are getting the correct information from the form but for some reason as soon as I put the variables into the $sql they dont post the proper data to the database, its connecting to the database ok but just not

Re: [PHP] Syntax Help

2002-11-14 Thread Petre Agenbag
What do you mean by dont post proper data? Have you added slashes to the variables? (use addslashes() and then stripslashes() when reading the contents from the db) On Thu, 2002-11-14 at 11:22, conbud wrote: Whats wrong here ?? The variables are getting the correct information from the form but

Re: [PHP] Syntax Help

2002-11-14 Thread conbud
Jason thanks, I completely forgot about trying echo $sql by using that I found where it was messing up. Thanks again. Lee Jason Wong [EMAIL PROTECTED] wrote in message news:200211141725.47510.php-general;gremlins.biz... On Thursday 14 November 2002 17:22, conbud wrote: Whats wrong here ?? The

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]... --

RE: [PHP] syntax error on mysql select statement

2002-10-13 Thread John W. Holmes
ORDER BY and LIMIT go at the end...after WHERE. ---John Holmes... -Original Message- From: Pablo Oliva [mailto:[EMAIL PROTECTED]] Sent: Sunday, October 13, 2002 12:13 AM To: [EMAIL PROTECTED] Subject: [PHP] syntax error on mysql select statement Can anyone see any problems with

Re: [PHP] syntax error on mysql select statement

2002-10-13 Thread Marco Tabini
Yes, the LIMIT clause must be at the end of the line. Take a look at the documentation: http://www.mysql.com/doc/en/SELECT.html On Sun, 2002-10-13 at 00:12, Pablo Oliva wrote: Can anyone see any problems with the following: SELECT * FROM ad AS t1, ad_location AS t2 ORDER BY t1.ad_ts_update

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)

RE: [PHP] syntax for date math expressions

2002-04-03 Thread Rick Emery
Convert to date/time variable and perform arithmetic. Otherwise, if these dates are from mysql, let mysql do it -Original Message- From: ROBERT MCPEAK [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 03, 2002 11:12 AM To: [EMAIL PROTECTED] Subject: [PHP] syntax for date math

RE: [PHP] syntax for date math expressions

2002-04-03 Thread Vail, Warren
Warren Vail Tools, Metrics Quality Processes (415) 667-7814 Pager (877) 774-9891 215 Fremont 02-658 -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 03, 2002 11:02 AM To: 'ROBERT MCPEAK'; [EMAIL PROTECTED] Subject: RE: [PHP] syntax for date math

RE: [PHP] syntax for date math expressions

2002-04-03 Thread Miguel Cruz
On Wed, 3 Apr 2002, Rick Emery wrote: Convert to date/time variable and perform arithmetic. Otherwise, if these dates are from mysql, let mysql do it Even if you don't happen to be getting the date out of MySQL, it can occasionally be easier to let MySQL do your date math since it has some

Re: [PHP] syntax for date math expressions

2002-04-03 Thread Erik Price
On Wednesday, April 3, 2002, at 03:58 PM, Miguel Cruz wrote: On Wed, 3 Apr 2002, Rick Emery wrote: Convert to date/time variable and perform arithmetic. Otherwise, if these dates are from mysql, let mysql do it Even if you don't happen to be getting the date out of MySQL, it can

Re: [PHP] syntax for date math expressions

2002-04-03 Thread Rasmus Lerdorf
I'd actually like to use MySQL's builtin date formats, but I like the timestamp that PHP uses (and I like what I can do with a timestamp in the date() function) so I have been using VARCHAR(20) to hold the date as a string. MySQL's TIMESTAMP is not the same thing as PHP's. But you can

Re: [PHP] syntax for date math expressions

2002-04-03 Thread Miguel Cruz
On Wed, 3 Apr 2002, Erik Price wrote: On Wednesday, April 3, 2002, at 03:58 PM, Miguel Cruz wrote: Even if you don't happen to be getting the date out of MySQL, it can occasionally be easier to let MySQL do your date math since it has some nice functions for it (DATE_ADD, DATE_SUB, etc.).

Re: [PHP] syntax for date math expressions

2002-04-03 Thread Erik Price
On Wednesday, April 3, 2002, at 04:14 PM, Rasmus Lerdorf wrote: But you can simply call MySQL's UNIX_TIMESTAMP() function on the mysql field when you select it if you want it into unix timestamp format. For SELECTs, this is fine, but what happens when I want to insert a new date? I

Re: [PHP] syntax for date math expressions

2002-04-03 Thread Rasmus Lerdorf
date() On Wed, 3 Apr 2002, Erik Price wrote: On Wednesday, April 3, 2002, at 04:14 PM, Rasmus Lerdorf wrote: But you can simply call MySQL's UNIX_TIMESTAMP() function on the mysql field when you select it if you want it into unix timestamp format. For SELECTs, this is fine, but what

RE: [PHP] syntax for date math expressions

2002-04-03 Thread Maxim Maletsky
as a string. MySQL's TIMESTAMP is not the same thing as PHP's. Let me be the devil's layer here, Erik. In order to achieve the best portability and to gain the best performance you'd better use mySQL date field types to store the dates. If you need the PHP timestamps you can simply use

RE: [PHP] syntax for date math expressions

2002-04-03 Thread Maxim Maletsky
PROTECTED]] Sent: Wednesday, April 03, 2002 11:27 PM To: Rasmus Lerdorf Cc: [EMAIL PROTECTED] Subject: Re: [PHP] syntax for date math expressions On Wednesday, April 3, 2002, at 04:14 PM, Rasmus Lerdorf wrote: But you can simply call MySQL's UNIX_TIMESTAMP() function on the mysql field

RE: [PHP] syntax for date math expressions

2002-04-03 Thread Maxim Maletsky
- From: Erik Price [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 03, 2002 11:27 PM To: Rasmus Lerdorf Cc: [EMAIL PROTECTED] Subject: Re: [PHP] syntax for date math expressions On Wednesday, April 3, 2002, at 04:14 PM, Rasmus Lerdorf wrote: But you can simply call MySQL's

RE: [PHP] syntax

2002-03-27 Thread Darren Gamble
Good day. I believe that one would have to use the eval() statement to construct that syntax. You probably would be much better off using an array to store this information. If you are trying to read form data, then construct your form names so that the results will be put into an array by

Re: [PHP] syntax

2002-03-27 Thread John Fishworld
Sorry I think I've badly explained this ! I'm getting results from mysql in a while loop but I need the results outside of the loops and so what I want to do is take the first variable from the db and rename it as variable 1 and then before the end of the while loop have a $i++; so i want

Re: [PHP] syntax

2002-03-27 Thread Miguel Cruz
On Wed, 27 Mar 2002, John Fishworld wrote: so i want $newvar_$i = result 1 $newvar_$i = result 2 so I can use them outside the loops as $newvar_1 and $newvar_2 Why don't you use an array? That's what they're for. Nevertheless, $i = 1; $varname = newvar$i; $$varname = result 1;

Re: [PHP] syntax

2002-03-27 Thread Julio Nobrega Trabalhando
Make it this way: Looping first. I will loop with while: $i = 0; $array = Array(); while (list($value) = mysql_fetch_array($result)) { $array[$i] = $value; $i++; } Arrays are easier :-) Each $i will be a key. -- Julio Nobrega. Um dia eu chego lá:

<    1   2   3   >