On Monday, April 1, 2002, at 02:13 PM, Jordan K. Martin wrote:
Makes sense. I didn't think much when writing that piece...but...what
is
the for? wouldn't it work the same without it?
function test ($var)
{
$var = addslashes($var)
}
$foo = He's dreaming;
test($foo);
Nope, that code makes no sense. $_POST is an array containing the POST
variables. You make a copy of that array an put it in $foo thereby
overwriting the passed in $foo. Then you return $$foo which actually ends
up returning a variable named $Array. It does not look like you have a
$Array
PROTECTED]
To: Gary [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Sunday, March 31, 2002 11:43 PM
Subject: Re: [PHP] return
Nope, that code makes no sense. $_POST is an array containing the POST
variables. You make a copy of that array an put it in $foo thereby
overwriting the passed in $foo
est($foo);
echo($foo);
// echo's, Yes I\'am Very Awsome
Understand?
- Original Message -
From: Rasmus Lerdorf [EMAIL PROTECTED]
To: Gary [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Sunday, March 31, 2002 11:43 PM
Subject: Re: [PHP] return
Nope, that code makes no sense.
March 31, 2002 11:43 PM
Subject: Re: [PHP] return
Nope, that code makes no sense. $_POST is an array containing the POST
variables. You make a copy of that array an put it in $foo thereby
overwriting the passed in $foo. Then you return $$foo which actually
ends
up returning a variab
On Mon, 1 Apr 2002, Jordan wrote:
Isnt there really no need for the 'return' though?
Try this program and see what happens:
?
function triple1($x) { $x = $x * 3; return $x; }
function triple2($x) { $x = $x * 3; }
function triple3($x) { global $x; $x = $x * 3; }
$x = 5; $x =
On Sun, 31 Mar 2002, Miguel Cruz wrote:
On Mon, 1 Apr 2002, Jordan wrote:
Isnt there really no need for the 'return' though?
Try this program and see what happens:
Ah, Rasmus brings up a good point. Try this one instead.
?
function triple1($x) { $x = $x * 3; return $x; }
function
Gary,
To add to the conversation ...
You created a function to pass something through it, to process something and
now you want to get something back, right? That's what return does. It gets
something back for your effort.
You could simply:
echo addslashes($var);
But let's say you do it a
I believe it is:
describe tablename;
- Original Message -
From: Kevin Stone [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, March 19, 2002 4:43 PM
Subject: [PHP] Return the column names of MySQL table?
Forgive me for the off topic question. This is a MySQL question.. has
On Tuesday, March 19, 2002, at 05:43 PM, Kevin Stone wrote:
I simply need to return a list of column names of a MySQL table. What's
the syntax to do that?
SHOW COLUMNS FROM tablename;
Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]
--
PHP General Mailing
Hi,
Try the following,
?
mysql_connect(DBServer,DBUser,DBPassword);
$queryColumn = mysql(DBName,desc tableName);
$columnCount = //Find out the number of column in the table.
$index=0;
while($index $columnCount)
{
$columnName =
On Wednesday 06 March 2002 18:23, Sven Jacobs wrote:
Hey
I want to run a shell script, all the values that are returned normal by
that script I want to put as var.
For example
tracert X.X.X.X
1 10 ms 10 ms 10 ms blablabla.bla.com [X.X.X.X]
2 10 ms10 ms10 ms
Hey, there...
I ran into this yesterday along with learning a heap more PHP. Adding a
Reply-To: [EMAIL PROTECTED] header seemed to work fine.
Hope this helps,
Bill
-Original Message-
From: Jean-Arthur Silve [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 09, 2001 5:23 AM
To: [EMAIL
://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message -
From: [EMAIL PROTECTED]
Newsgroups: php.general
To: [EMAIL PROTECTED]
Sent: Thursday, August 09, 2001 11:27 AM
Subject: RE: [PHP] Return Adress
Hey, there...
I ran into this yesterday
maybe it is just me and my preferred syntax/style...
if ($i 4) {
abc_recurse();
}
return 'xyz'; # NOTICE REMOVED ()'s
Did not look to closely at your shortcut symantics to verify legitimacy
Also, unless I am mistaken, people generally advise against
Here's my code:
?
function expDate($date) {
$month = substr($date, 0, 2);
$len = strlen($date);
$year = substr($date, $len-2, $len);
return $month;
return $year;
}
expDate(11/2002);
print $month $year;
?
I know this isn't the correct usage of
On 16-Jul-01 Tyler Longren wrote:
Here's my code:
?
function expDate($date) {
$month = substr($date, 0, 2);
$len = strlen($date);
$year = substr($date, $len-2, $len);
return $month;
return $year;
}
expDate(11/2002);
print $month $year;
?
I
So sprach »Tyler Longren« am 2001-07-16 um 15:25:08 -0500 :
function? Currently, nothing is printed to the browser.
No wonder, because you don't assign the returned value of expDate to
anything..
well, if you want to return two values, I'd suggest to use an array,
like so:
function
So sprach »Alexander 'Digital Projects' Skwar« am 2001-07-16 um 22:38:44 +0200 :
anything..
correction: Whoops - there's a . missing
anything...
Alexander Skwar
--
How to quote: http://learn.to/quote (german) http://quote.6x.to (english)
Homepage: http://www.digitalprojects.com |
At 03:56 AM 4/13/2001, Peter Harkins wrote:
This generates a parse error:
mysql_connect("localhost", "root", "rootpw") or
return("bar");
But all the following work fine:
mysql_connect("localhost", "root", "rootpw") or die("bar");
Small additional info about "expression" and "language construct".
Expression is anything that have value.
Therefore, if language construct returns value = valid expression.
Following code works:
($val) ? include('abc.php') : include('def.php');
Following code does NOT work:
($val) ?
I'm not 100% sure this works, but maybe try something like this:
img src="? include 'myphpcode.php'; ?>">
If that doesn't work, you can always have the php generate the entire
tag
?
$image = "myimagefile.gif"; // What ever you need
print "img src=\"$image\">";
?>
Hope this helps :-)
"Karl J.
You can use mysql_fetch_array() for each row returned in the cursor.
Sorin Ifrim
- Original Message -
From: Karl J. Stubsjoen [EMAIL PROTECTED]
To: PHP Mailing List [EMAIL PROTECTED]
Sent: Tuesday, February 13, 2001 7:32 PM
Subject: [PHP] Return ODBC Results to an array
Is there a
For ODBC, the function is odbc_fetch_into().
Sorin Ifrim
- Original Message -
From: Karl J. Stubsjoen [EMAIL PROTECTED]
To: PHP Mailing List [EMAIL PROTECTED]
Sent: Tuesday, February 13, 2001 7:32 PM
Subject: [PHP] Return ODBC Results to an array
Is there a way to return the results
Karl,
http://www.php.net/manual/en/function.odbc-fetch-into.php
Best regards,
Andrew
--
Andrew Hill - OpenLink Software
Director Technology Evangelism
eBusiness Infrastructure Technology
http://www.openlinksw.com
-Original Message-
From: Karl J.
101 - 125 of 125 matches
Mail list logo