Check out Geshi
http://qbnz.com/highlighter/
> -Original Message-
> From: Chris [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 25, 2006 5:54 PM
> To: Michelle Konzack
> Cc: PHP - General
> Subject: Re: [PHP] syntax highlighting for Shell scripts and C?
>
>
Michelle Konzack wrote:
Hello,
since I include source sniplets into some of my webpages I like
this syntax highlighting for php scripts... because it make
scripts more readable.
My question is: Does such thing exist for Shell scripts and C?
pastebin.com has it and the code is GPL'ed so you
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
> 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 tryi
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 ratio
2006/5/2, Richard Lynch <[EMAIL PROTECTED]>:
Does anybody have a rational explanation for what purpose in life the
following syntax is considered acceptable?
Note that the line with just $query; on it doesn't, like, "do" anything.
I suppose in a Zen-like sort of way, it "exists" and all, but
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 scri
[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,
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 i
[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 n
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/ph
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
[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
[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
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 ($ad
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 (http://www.
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 comp
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 cur
[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 exampl
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/)
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. Ni
>
> 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.ph
> 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 histo
* 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
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
; would work
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 = ' 'bar';"; example_function(\$my_code); ?>';
This is not a valid
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
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 include, it'll go on, and also replace all
instances of in, so you'll end up with things like include
(very ugly)
* 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/201
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
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 = eregi_replace($o
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],''.$o
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 = eregi_replace($odds
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 co
> $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: http://www
[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 usin
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 eve
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
> 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."
http://www.php.
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 >>
> >
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, dayph
* 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, evepho
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> $test=array('test1'=>'a','test2
PETCOL wrote:
This line is whats causing me all the greif:
echo "\n"$_POST["Country"];"\n";
Parse error: parse error, expecting `','' or `';''
Suggestions or tutorials please ;-)
Col
You're wrapping the whole string in double quotes ("), not escaping the
double quotes in your form e
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,$nu
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
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 :) ?
> ("/home/users/q/qx04t9mu/www/glq2-test/calendars/"+strtolower(date(F))+"200
>3.htm"); ?>
replace the + symbols with
* 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 wit
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
HTT
Jason Wong wrote:
>On Saturday 17 January 2004 01:50, Dagfinn Reiersøl 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 inclu
: 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, thats exactly the problem. I didnt even realize he was
>doing that.
>
>By including the PHP fil
On Saturday 17 January 2004 01:50, Dagfinn Reiersøl 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 de
m: 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:
if a script calls antohter like 'include('http://site.com/index.php');
Why would I get a syntax error on line
o" 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:
>if a script cal
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:
What's the deal there?
Many thanks for any insight ;-)
I've never tried to do an include via HTTP, so maybe I'm clueless, b
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 it
* 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> NW
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> // line one above this one
NW> What's the deal there?
Say you
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
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? (SID)?>" )
header( "Location: page2.php?". strip_tags( SID ) );
the problem you are having is
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?" )
You are making a row of mistakes that suggest it is a good idea to read a
bit on PHP syntax and how variables are passed o
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?" )
but it isnt working for me and all the docs i can find
just deal with tagging it to the end of a hyperlink.
header("Location: page2.ph
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 wit
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 #6
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'
Thanks Keven. Didn't see that.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
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
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
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
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 Ols
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:
check_banlist($vari
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
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 ques
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
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
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 n
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 $
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
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
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
Message-
> 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
[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'
> 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 anoth
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, bu
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 trans
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
> 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 si
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
> o
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
ni
diff("2002-04-03","2002-04-02") as difference from realtable
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
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 expressions
On Wed, 27 Mar 2002, John Fishworld wrote:
use this:
${"ned_".$i."_city"} = $ned_city;
after that you can use your new var as $ned_1_city, if $i was 1
ofcourse...
But in this case you might be better off using arrays, as some have
suggested.
> Can someone please remind me what the correct synt
P 4L4
(403) 781-4948
-Original Message-
From: John Fishworld [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 27, 2002 11:09 AM
To: Darren Gamble; Php-General-List (E-mail)
Subject: Re: [PHP] syntax
Sorry I think I've badly explained this !
I'm getting results from mysql in a
101 - 200 of 233 matches
Mail list logo