php-general Digest 26 Feb 2009 12:47:57 - Issue 5980
Topics (messages 288795 through 288813):
non-auto increment question
288795 by: PJ
288796 by: Gary W. Smith
288797 by: Ashley Sheridan
288801 by: Ashley Sheridan
288802 by: PJ
288803 by:
To: php-general@lists.php.net
Date: Wed, 25 Feb 2009 14:42:36 -0600
From: nos...@mckenzies.net
Subject: [PHP] Re: Spaces Not Detected from Regular Expression preg_match
Shawn McKenzie wrote:
Shawn McKenzie wrote:
Alice Wei wrote:
Hi,
I have a code as in the following:
?php
Hello everybody,
I have an xml-file where a euro sign is in. Now the sign shows up as
questionmark after importing into a mysql db.
On the utf_8_decode site I found that iconv will help here, but first of
all I do not even know if the xml file is utf8encoded (I doubt it),
and secondly I do
Merlin Morgenstern wrote:
Hello everybody,
I have an xml-file where a euro sign is in. Now the sign shows up as
questionmark after importing into a mysql db.
Check the character set of your mysql table.
On the utf_8_decode site I found that iconv will help here, but first
of all I do not
Hi,
I've been recently wondering (musing if you will) about timings, and
roughly how long, in a very real sense, it takes on a modern computer
for a single line of PHP, or Javascript (or interpreted code in
general) to execute. Nanoseconds? Quicker?
You could say I have too much time on my
On Thu, 2009-02-26 at 12:47 +, Richard Heyes wrote:
Hi,
I've been recently wondering (musing if you will) about timings, and
roughly how long, in a very real sense, it takes on a modern computer
for a single line of PHP, or Javascript (or interpreted code in
general) to execute.
Richard Heyes wrote:
Hi,
I've been recently wondering (musing if you will) about timings, and
roughly how long, in a very real sense, it takes on a modern computer
for a single line of PHP, or Javascript (or interpreted code in
general) to execute. Nanoseconds? Quicker?
Not taking
From: Ernie Kemp
It seems to me that there must to other places a freelance Web
Developer
fines work.
How do you find work in PHP Web programming?
Work a company, through this site and from God.
I wish to know more than handing out a business card.
1. Create a personal/business page
Ooops, I forgot one.
0. Invest some time studying the top 25 errors list from either SANS
http://www.sans.org/top25errors/ or CWE http://cwe.mitre.org/top25/.
Make sure you don't have _any_ of them in your code. (This list includes
and extends the OWASP guidelines
Your answer is neither relevant nor funny. :-|
--
Robert Cummings rob...@interjinn.com pí¹e v diskusním pøíspìvku
news:1235653678.13128.32.ca...@localhost...
On Thu, 2009-02-26 at 12:47 +, Richard Heyes wrote:
Hi,
I've been recently wondering (musing if you will) about timings, and
Your answer is neither relevant nor funny. :-|
Someone didn't get any last night...
--
Richard Heyes
HTML5 Canvas graphing for Firefox, Chrome, Opera and Safari:
http://www.rgraph.org (Updated February 14th)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
Not taking pipelining into account, a 3GHz processor will execute one
instruction in 333 picoseconds, so three instructions in a nanosecond.
How many instructions to a line of code? 10,000 ?
Ooh, less than that - round about 1000. I have some Javascript that
I'm curious about, and since it's
Sorry i've missed the first sentence, i thought the answer was only the very
last sentence. my fault.
--
S pozdravem
Ondrej Kulatý
-
Winternet s.r.o.
odd. vývoje aplikací
tel. 585 209 132
www.winternet.cz
Richard Heyes rich...@php.net píse v diskusním príspevku
On Thu, 2009-02-26 at 15:50 +0100, Ondrej Kulaty wrote:
Your answer is neither relevant nor funny. :-|
It was very relevant. You cannot easily ascertain the time at which a
particular line of script is processed. You especially cannot ascertain
the specific time taken to process a line of script
Hi,
I have two lines here as follows:
1 -0.123701962557954E+03 0.460967618024691E+02
-0.12354765900E+03 0.46259109000E+02
What I am trying to do here is to only have
1 -0.123701962557954E+03 0.460967618024691E+02 be the output so I
can do further
Alice Wei wrote:
Hi,
I have two lines here as follows:
1 -0.123701962557954E+03 0.460967618024691E+02
-0.12354765900E+03 0.46259109000E+02
What I am trying to do here is to only have
1 -0.123701962557954E+03 0.460967618024691E+02 be the output so
Hi,
I have two lines here as follows:
1 -0.123701962557954E+03 0.460967618024691E+02
-0.12354765900E+03 0.46259109000E+02
What I am trying to do here is to only have
1 -0.123701962557954E+03 0.460967618024691E+02 be the output so I
can do further
Something is rotten here. Twist it any way you like and it just does not
work.
I am trying to figure out the working of SELECT LAST_INSERT_ID() and
cannot get beyond the first $sql - But it works fine from command-line!
?
include (lib/db1.php);// Connect to database
$sql1 = INSERT INTO test
On Thu, 2009-02-26 at 10:09 -0500, Alice Wei wrote:
Hi,
I have two lines here as follows:
1 -0.123701962557954E+03 0.460967618024691E+02
-0.12354765900E+03 0.46259109000E+02
What I am trying to do here is to only have
1 -0.123701962557954E+03
On Thu, 2009-02-26 at 11:14 -0500, PJ wrote:
Something is rotten here. Twist it any way you like and it just does not
work.
I am trying to figure out the working of SELECT LAST_INSERT_ID() and
cannot get beyond the first $sql - But it works fine from command-line!
?
include (lib/db1.php);
On Thu, Feb 26, 2009 at 9:14 AM, PJ af.gour...@videotron.ca wrote:
Something is rotten here. Twist it any way you like and it just does not
work.
I am trying to figure out the working of SELECT LAST_INSERT_ID() and
cannot get beyond the first $sql - But it works fine from command-line!
?
Jerry Schwartz wrote:
Being rather new to all this, I understood from the MySql manual that
the auto_increment is to b e used immediately after an insertion not
intermittently. My application is for administrators (the site owner
designates) to update the database from and administration
On Thu, 2009-02-26 at 11:27 -0500, PJ wrote:
Jerry Schwartz wrote:
Being rather new to all this, I understood from the MySql manual that
the auto_increment is to b e used immediately after an insertion not
intermittently. My application is for administrators (the site owner
designates)
---
Use FreeOpenSourceSoftwares, Stop piracy, Let the developers live. Get
a Free CD of Ubuntu mailed to your door without any cost. Visit :
www.ubuntu.com
--
Richard Whitney wrote:
On Thu, Feb 26, 2009 at 9:14 AM, PJ af.gour...@videotron.ca
mailto:af.gour...@videotron.ca wrote:
Something is rotten here. Twist it any way you like and it just
does not
work.
I am trying to figure out the working of SELECT LAST_INSERT_ID() and
Ashley Sheridan wrote:
On Thu, 2009-02-26 at 11:14 -0500, PJ wrote:
Something is rotten here. Twist it any way you like and it just does not
work.
I am trying to figure out the working of SELECT LAST_INSERT_ID() and
cannot get beyond the first $sql - But it works fine from command-line!
9el wrote:
---
Use FreeOpenSourceSoftwares, Stop piracy, Let the developers live. Get
a Free CD of Ubuntu mailed to your door without any cost. Visit :
www.ubuntu.com http://www.ubuntu.com
On Thu, 2009-02-26 at 11:49 -0500, PJ wrote:
Ashley Sheridan wrote:
On Thu, 2009-02-26 at 11:14 -0500, PJ wrote:
Something is rotten here. Twist it any way you like and it just does not
work.
I am trying to figure out the working of SELECT LAST_INSERT_ID() and
cannot get beyond the
What is wrond with this file? same identical insert works from console
but not from this file :-(
html
head
titleUntitled/title
/head
body
?
//include (lib/db1.php);// Connect to database
mysql_connect('biggie', 'user', 'password', 'test');
$sql1 = INSERT INTO example (name, age) VALUES
On Thu, 2009-02-26 at 12:28 -0500, PJ wrote:
What is wrond with this file? same identical insert works from console
but not from this file :-(
html
head
titleUntitled/title
/head
body
?
//include (lib/db1.php);// Connect to database
mysql_connect('biggie', 'user', 'password',
Hi PJ,
Could it be that you have //include (lib/db1.php); commented
out? Try uncommenting that line and see what happens. The error
message will always print because the query is never executing
properly if you have the db connections file commented out.
On Thu, Feb 26, 2009 at 12:28 PM, PJ
It is commented out because I am using mysql_connect
I don't think it would be good to use both, since the db1 references
another db. But even when I use the db1.php and change the database and
table, I get the same error message.
But what I did miss is my typo in What is wrond with this
what's the error message?
On Thu, Feb 26, 2009 at 11:46 AM, PJ af.gour...@videotron.ca wrote:
It is commented out because I am using mysql_connect
I don't think it would be good to use both, since the db1 references
another db. But even when I use the db1.php and change the database and
ok, well if that's the case then do this
$db = mysql_connect('biggie', 'user', 'password', 'test');
That should fix the problem.
On Thu, Feb 26, 2009 at 12:46 PM, PJ af.gour...@videotron.ca wrote:
It is commented out because I am using mysql_connect
I don't think it would be good to use
Hi PJ,
On Thu, Feb 26, 2009 at 17:28, PJ af.gour...@videotron.ca wrote:
What is wrond with this file? same identical insert works from console
but not from this file :-(
[snip]
?
//include (lib/db1.php); // Connect to database
mysql_connect('biggie', 'user', 'password', 'test');
Ashley Sheridan wrote:
On Thu, 2009-02-26 at 12:28 -0500, PJ wrote:
What is wrond with this file? same identical insert works from console
but not from this file :-(
html
head
titleUntitled/title
/head
body
?
//include (lib/db1.php); // Connect to database
mysql_connect('biggie',
Jim Lyons wrote:
what's the error message?
it's in the script/// Error performing query: of Error performing 1st
query: - whatever I input.
But I had an error in the include location... that's fixed and it works,
but not the rest as corrected:
?
//include (../lib/db1.php);// Connect to
Ricardo Dias Marques wrote:
Hi PJ,
On Thu, Feb 26, 2009 at 17:28, PJ af.gour...@videotron.ca wrote:
What is wrond with this file? same identical insert works from console
but not from this file :-(
[snip]
?
//include (lib/db1.php);// Connect to database
mysql_connect('biggie',
Darryle Steplight wrote:
ok, well if that's the case then do this
$db = mysql_connect('biggie', 'user', 'password', 'test');
Ashley pointed out that the 4th parameter is not right - belongs in
mysql_select_db. Here it is corrected: (but it still does not work)
?
//include (../lib/db1.php);
On Thu, 2009-02-26 at 13:16 -0500, PJ wrote:
Ashley Sheridan wrote:
On Thu, 2009-02-26 at 12:28 -0500, PJ wrote:
What is wrond with this file? same identical insert works from console
but not from this file :-(
html
head
titleUntitled/title
/head
body
?
//include
What does this output?
?
//include (../lib/db1.php);// Connect to database
$db_host = 'biggie';
$db_user = 'root';
$db_pass = 'gu...@#$';
$db_name = 'biblane';
$db_connect = mysql_connect($db_host, $db_user, $db_pass);
if (!is_resource($db_connect)) {
echo 'p$db_connect is not a valid
Hi PJ,
$db_host = 'biggie';
$db_user = 'root';
$db_pass = 'gu...@#$';
$db_name = 'biblane';
Everyone here is trying to help you and that's cool, but EVERYONE on
this list may not be so nice. The above credentials is definitely the
type of information you want to keep private, unless you
-Original Message-
From: PJ [mailto:af.gour...@videotron.ca]
Sent: Thursday, February 26, 2009 11:27 AM
To: Jerry Schwartz
Cc: a...@ashleysheridan.co.uk; 'Gary W. Smith'; 'MySql'; php-
gene...@lists.php.net
Subject: Re: [PHP] RE: non-auto increment question
Jerry Schwartz wrote:
Being
On Thu, 2009-02-26 at 13:34 -0500, Darryle Steplight wrote:
Hi PJ,
$db_host = 'biggie';
$db_user = 'root';
$db_pass = 'gu...@#$';
$db_name = 'biblane';
Everyone here is trying to help you and that's cool, but EVERYONE on
this list may not be so nice. The above credentials is
-Original Message-
From: PJ [mailto:af.gour...@videotron.ca]
Sent: Thursday, February 26, 2009 12:28 PM
To: php-general@lists.php.net; MySql
Subject: catch the error
What is wrond with this file? same identical insert works from console
but not from this file :-(
html
head
Here's how I mostly do it (albeit simplified):
$query = INSERT INTO `sometable`(`title`,`content`)
VALUES('$title','$content');
$result = mysql_query($query);
$autoId = mysql_insert_id($result);
$query = INSERT INTO `another_table`(`link_id`,`value`)
VALUES($autoId,'$value');
$result =
Additionally regarding the error handling , add this to the op of your script.
ini_set(display_errors,true);
error_reporting(E_STRICT|E_ALL);
and post the output of your error message.
On Thu, Feb 26, 2009 at 1:40 PM, Ashley Sheridan
a...@ashleysheridan.co.uk wrote:
On Thu, 2009-02-26 at 13:34
On Thu, 2009-02-26 at 13:44 -0500, Jerry Schwartz wrote:
Here's how I mostly do it (albeit simplified):
$query = INSERT INTO `sometable`(`title`,`content`)
VALUES('$title','$content');
$result = mysql_query($query);
$autoId = mysql_insert_id($result);
$query = INSERT INTO
But the question is PJ, have you got it out of errors yet? :)
www.twitter.com/nine_L
www.lenin9l.wordpress.com
---
Use FreeOpenSourceSoftwares, Stop piracy, Let the developers live. Get
a Free CD of Ubuntu mailed to your door
Jerry Schwartz wrote:
-Original Message-
From: PJ [mailto:af.gour...@videotron.ca]
Sent: Thursday, February 26, 2009 12:28 PM
To: php-general@lists.php.net; MySql
Subject: catch the error
What is wrond with this file? same identical insert works from console
but not from this
Ashley Sheridan wrote:
On Thu, 2009-02-26 at 13:34 -0500, Darryle Steplight wrote:
Hi PJ,
$db_host = 'biggie';
$db_user = 'root';
$db_pass = 'gu...@#$';
$db_name = 'biblane';
Everyone here is trying to help you and that's cool, but EVERYONE on
this list may not be so nice. The
On Thu, 2009-02-26 at 13:56 -0500, PJ wrote:
Ashley Sheridan wrote:
On Thu, 2009-02-26 at 13:34 -0500, Darryle Steplight wrote:
Hi PJ,
$db_host = 'biggie';
$db_user = 'root';
$db_pass = 'gu...@#$';
$db_name = 'biblane';
Everyone here is trying to help you and that's
Here's the working code...
?
//include (../lib/db1.php);// Connect to database
$db_host = '';
$db_user = '';
$db_pass = '';
$db_name = '';
$db = mysql_connect($db_host, $db_user, $db_pass);
mysql_select_db($db_name,$db);
$sql1 = INSERT INTO test (name, age) VALUES
Ashley Sheridan wrote:
On Thu, 2009-02-26 at 13:44 -0500, Jerry Schwartz wrote:
Here's how I mostly do it (albeit simplified):
$query = INSERT INTO `sometable`(`title`,`content`)
VALUES('$title','$content');
$result = mysql_query($query);
$autoId = mysql_insert_id($result);
$query =
Ashley Sheridan wrote:
On Thu, 2009-02-26 at 13:56 -0500, PJ wrote:
Ashley Sheridan wrote:
On Thu, 2009-02-26 at 13:34 -0500, Darryle Steplight wrote:
Hi PJ,
$db_host = 'biggie';
$db_user = 'root';
$db_pass = 'gu...@#$';
$db_name = 'biblane';
Everyone here is
Sorry, I should know better.
-Original Message-
From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk]
Sent: Thursday, February 26, 2009 1:51 PM
To: Jerry Schwartz
Cc: 'PJ'; 'Gary W. Smith'; 'MySql'; php-general@lists.php.net
Subject: RE: [PHP] RE: non-auto increment question
On Thu,
Hello,
I am beginner with PHP and prior to PHP I have worked with java for some
time
and with perl for very short period. I can't help to notice some things
that
are little annoyance for me with PHP, but I am sure someone more
experienced
can help me :-)
Is there in PHP something like use
Newbie question:
I would like to get a list of column field names from a MS Access table and
hopefully get them returned in the ORIGINAL order (as they appear in access)
Is there a sql query I could do to get this result?
--
Thanks - RevDave
Cool @ hosting4days . com
[db-lists 09]
--
Yes you can use:
error_reporting(E_ALL);
Which will enable notices. You can even do:
error_reporting(E_ALL | E_STRICT);
To enable strict messages.
Lewis.
2009/2/26 Hans Schultz h.schult...@yahoo.com:
Hello,
I am beginner with PHP and prior to PHP I have worked with java for some
time
and
Thanks for everyone's input!
I will take your words to heart.
/Ernie
-Original Message-
From: Bob McConnell [mailto:r...@cbord.com]
Sent: February-26-09 9:15 AM
To: php-general@lists.php.net
Subject: RE: [PHP] Web Development work
Ooops, I forgot one.
0. Invest some time
---
Use FreeOpenSourceSoftwares, Stop piracy, Let the developers live. Get
a Free CD of Ubuntu mailed to your door without any cost. Visit :
www.ubuntu.com
--
Hans Schultz wrote:
Hello,
I am beginner with PHP and prior to PHP I have worked with java for
some time
and with perl for very short period. I can't help to notice some
things that
are little annoyance for me with PHP, but I am sure someone more
experienced
can help me :-)
Is there in PHP
I was thinking more of something to fail at compile time if possible
:-)regarding second, that solution with sprintf is vulnerable to SQL injection,
that is why I wanted something with parameters, instead of escaping everything
myself
Thanks for your help anyway
--- On Thu, 2/26/09, 9el
---
Use FreeOpenSourceSoftwares, Stop piracy, Let the developers live. Get
a Free CD of Ubuntu mailed to your door without any cost. Visit :
www.ubuntu.com
--
Oh, I didn't mentioned that I tried that, I was thinking something like
failing at compile time (like perl with use strict in programs)Thanks for
reply,
Hans
--- On Thu, 2/26/09, Lewis Wright lewiswri...@gmail.com wrote:
From: Lewis Wright lewiswri...@gmail.com
Subject: Re: [PHP] use strict or
I have no ideea why my response from half an hour ago was not sent, but here
it is again:
1. Error reporting set to show notices, warnings and errors. See
http://www.php.net/manual/en/function.error-reporting.php
2. For caching you can use memcache. See http://www.php.net/memcache
3. These are
On Thu, Feb 26, 2009 at 10:45 PM, Hans Schultz h.schult...@yahoo.comwrote:
Hello,
I am beginner with PHP and prior to PHP I have worked with java for some
time
and with perl for very short period. I can't help to notice some things
that
are little annoyance for me with PHP, but I am sure
Hans Schultz wrote:
Oh, I didn't mentioned that I tried that, I was thinking something like
failing at compile time (like perl with use strict in programs)Thanks for
reply,
Hans
--- On Thu, 2/26/09, Lewis Wright lewiswri...@gmail.com wrote:
From: Lewis Wright lewiswri...@gmail.com
Thanks a lot for your info, I will check that IDE too. But those warning levels
give me warning only when they encounter offending code? Are you telling me
that it can be setup to fail entire script prior to any execution if there are
errors in it? Can you please point me how to setup my PHP
Hans Schultz wrote:
Thanks a lot for your info, I will check that IDE too. But those
warning levels give me warning only when they encounter offending
code? Are you telling me that it can be setup to fail entire script
prior to any execution if there are errors in it? Can you please
point me
-Original Message-
From: PJ [mailto:af.gour...@videotron.ca]
Sent: Thursday, February 26, 2009 1:16 PM
To: a...@ashleysheridan.co.uk
Cc: Darryle Steplight; Ricardo Dias Marques;
php-general@lists.php.net;
MySql
Subject: Re: [PHP] Re: catch the error
Ashley Sheridan wrote:
On
On Thu, 2009-02-26 at 14:04 -0500, PJ wrote:
Ashley Sheridan wrote:
On Thu, 2009-02-26 at 13:44 -0500, Jerry Schwartz wrote:
Here's how I mostly do it (albeit simplified):
$query = INSERT INTO `sometable`(`title`,`content`)
VALUES('$title','$content');
$result =
On Thu, 2009-02-26 at 14:15 -0500, PJ wrote:
Ashley Sheridan wrote:
On Thu, 2009-02-26 at 13:56 -0500, PJ wrote:
Ashley Sheridan wrote:
On Thu, 2009-02-26 at 13:34 -0500, Darryle Steplight wrote:
Hi PJ,
$db_host = 'biggie';
$db_user = 'root';
$db_pass =
Boyd, Todd M. wrote:
Jesus Christ... everyone on this list must've had a long week, because
you guys are going blind. :D
In examples sent to you, people foolishly replaced your $db var with
$db_connect ONLY FOR PART OF THE SCRIPT. You've defined your database
connection as $db_connect in
In examples sent to you, people foolishly replaced your $db var with
$db_connect ONLY FOR PART OF THE SCRIPT. You've defined your database
connection as $db_connect in some versions of the source, but then you
reference $db (without _connect) in your mysql_select call in that same
source.
$db
-Original Message-
From: Chris [mailto:dmag...@gmail.com]
Sent: Thursday, February 26, 2009 4:16 PM
To: Boyd, Todd M.
Cc: PJ; PHP General list
Subject: Re: [PHP] Re: catch the error
In examples sent to you, people foolishly replaced your $db var with
$db_connect ONLY FOR PART
Is there a shorter way of determining if a field contains text?
This works but I wonder if I can K.I.S.S. it? I really only need to know
if there is or is not a field containing the text specified. I don't
need to see it.
?php
// Request the text
$text = Joe of Egypt;
$sql = SELECT title
Try
$text = Joe of Egypt;
$sql = SELECT title FROM book WHERE title LIKE '$text';
$result = mysql_query($sql);
If(mysql_num_rows($result) = '1')
{
while ( $row = mysql_fetch_array($sql) ) {
echo(P . $row[title] . /P);
}
}
My Ideas my not make some people happy with my design but I use it
On Thu, Feb 26, 2009 at 06:07:02PM -0500, PJ wrote:
Is there a shorter way of determining if a field contains text?
This works but I wonder if I can K.I.S.S. it? I really only need to know
if there is or is not a field containing the text specified. I don't
need to see it.
?php
//
PJ wrote:
Is there a shorter way of determining if a field contains text?
This works but I wonder if I can K.I.S.S. it? I really only need to know
if there is or is not a field containing the text specified. I don't
need to see it.
?php
// Request the text
$text = Joe of Egypt;
Shawn McKenzie wrote:
PJ wrote:
Is there a shorter way of determining if a field contains text?
This works but I wonder if I can K.I.S.S. it? I really only need to know
if there is or is not a field containing the text specified. I don't
need to see it.
?php
// Request the text
Shawn McKenzie wrote:
Boyd, Todd M. wrote:
Jesus Christ... everyone on this list must've had a long week, because
you guys are going blind. :D
In examples sent to you, people foolishly replaced your $db var with
$db_connect ONLY FOR PART OF THE SCRIPT. You've defined your database
Ashley Sheridan wrote:
On Thu, 2009-02-26 at 14:15 -0500, PJ wrote:
Ashley Sheridan wrote:
On Thu, 2009-02-26 at 13:56 -0500, PJ wrote:
Ashley Sheridan wrote:
On Thu, 2009-02-26 at 13:34 -0500, Darryle Steplight wrote:
Hi PJ,
Boyd, Todd M. wrote:
-Original Message-
From: Chris [mailto:dmag...@gmail.com]
Sent: Thursday, February 26, 2009 4:16 PM
To: Boyd, Todd M.
Cc: PJ; PHP General list
Subject: Re: [PHP] Re: catch the error
In examples sent to you, people foolishly replaced your $db var with
$db_connect
Being rather new to all this, I understood from the MySql manual that
the auto_increment is to b e used immediately after an insertion not
intermittently. My application is for administrators (the site owner
designates) to update the database from and administration directory,
accessed by
I have an array like this and I simply need to recurse over it and find
a matching menu item to remove:
array(3) {
[dart]=
array(10) {
[0]=
object(menuItem)#4 (9) {
[menu]=
string(7) My DART
[name]=
string(7) My DART
[title]=
string(39) Data
Daevid Vincent wrote:
I'm trying to remove [menu] == 'Login' from the array, but despite
finding the element, it never removes.
isn't that what the reference stuff is for?
Yes, but foreach can't modify an array unless you use a reference in the
foreach also. Try this:
foreach($menuItems as
Shawn McKenzie wrote:
Daevid Vincent wrote:
I'm trying to remove [menu] == 'Login' from the array, but despite
finding the element, it never removes.
isn't that what the reference stuff is for?
Yes, but foreach can't modify an array unless you use a reference in the
foreach also. Try
I tried that and it still doesn't work. I even tried this hardcore
test:
public static final function removeMenuItems($menuItems, $removeArray)
{
foreach($menuItems as $value)
{
unset($value);
}
}
-Original Message-
From: Shawn McKenzie nos...@mckenzies.net
To:
Daevid Vincent wrote:
I tried that and it still doesn't work. I even tried this hardcore
test:
public static final function removeMenuItems($menuItems, $removeArray)
{
foreach($menuItems as $value)
{
unset($value);
}
}
You don't unset the value, you unset the key.
?php
ad...@buskirkgraphics.com wrote:
Try
$text = Joe of Egypt;
$sql = SELECT title FROM book WHERE title LIKE '$text';
$result = mysql_query($sql);
If(mysql_num_rows($result) = '1')
{
while ( $row = mysql_fetch_array($sql) ) {
echo(P . $row[title] . /P);
}
}
My Ideas my not make some
PJ you should be getting Warning errors the way you had the code.
You definitely is a fun lover and enjoy moments. But while coding dont only
think of fastness of coding but also code with logic.
I was going to answer you about the $db but later I found lots response
already came so didn't
PJ wrote:
Is there a shorter way of determining if a field contains text?
This works but I wonder if I can K.I.S.S. it? I really only need to know
if there is or is not a field containing the text specified. I don't
need to see it.
?php
// Request the text
$text = Joe of Egypt;
As my web app is coming to completion, I added a means to search records
(different from site search).
This involves reading post input and is many cases converting it to an
integer.
Damn I feel dumb.
The search app wasn't working, so I did what I often do when
troubleshooting crap - I put
Hans Schultz wrote:
Is there some way for PHP to cache some data on the page? I like very
much PHP's speed but it would be even better to be able to cache some
frequently used data from database?
Databases such as MySQL are very good at caching.
--
Per Jessen, Zürich (3.6°C)
--
PHP
Use var_dump() to see contents of a variable. It will print something even
if variable is empty or undefined.
Michael A. Peters mpet...@mac.com píse v diskusním príspevku
news:49a79416.6060...@mac.com...
As my web app is coming to completion, I added a means to search records
(different from
Michael A. Peters wrote:
If variable is an integer, die($var) returns nothing and is suppose to
return nothing, it takes a string as an argument to echo on death -
die($var) is what I wanted.
I often use
?php
var_dump($myVar); exit(1);
?
to debug and print the value of the variable. xDebug
97 matches
Mail list logo