php-general Digest 26 Feb 2009 12:47:57 -0000 Issue 5980

2009-02-26 Thread php-general-digest-help
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:

RE: [PHP] Re: Spaces Not Detected from Regular Expression preg_match

2009-02-26 Thread Alice Wei
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

[PHP] Converting Euro sign

2009-02-26 Thread Merlin Morgenstern
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

Re: [PHP] Converting Euro sign

2009-02-26 Thread Per Jessen
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

[PHP] A puzzler (well, for me at least)

2009-02-26 Thread Richard Heyes
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

Re: [PHP] A puzzler (well, for me at least)

2009-02-26 Thread Robert Cummings
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.

Re: [PHP] A puzzler (well, for me at least)

2009-02-26 Thread Per Jessen
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

RE: [PHP] Web Development work

2009-02-26 Thread Bob McConnell
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

RE: [PHP] Web Development work

2009-02-26 Thread Bob McConnell
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

Re: [PHP] A puzzler (well, for me at least)

2009-02-26 Thread Ondrej Kulaty
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

Re: [PHP] A puzzler (well, for me at least)

2009-02-26 Thread Richard Heyes
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:

Re: [PHP] A puzzler (well, for me at least)

2009-02-26 Thread Richard Heyes
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

Re: [PHP] A puzzler (well, for me at least)

2009-02-26 Thread Ondrej Kulaty
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

Re: [PHP] A puzzler (well, for me at least)

2009-02-26 Thread Robert Cummings
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

[PHP] Regular Expression Problem

2009-02-26 Thread Alice Wei
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

Re: [PHP] Regular Expression Problem

2009-02-26 Thread 惠新宸
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

RE: [PHP] Regular Expression Problem

2009-02-26 Thread Alice Wei
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

[PHP] What in Hades?

2009-02-26 Thread PJ
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

Re: [PHP] Regular Expression Problem

2009-02-26 Thread Ashley Sheridan
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

Re: [PHP] What in Hades?

2009-02-26 Thread Ashley Sheridan
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);

Re: [PHP] What in Hades?

2009-02-26 Thread Richard Whitney
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! ?

Re: [PHP] RE: non-auto increment question

2009-02-26 Thread PJ
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

Re: [PHP] RE: non-auto increment question

2009-02-26 Thread Ashley Sheridan
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)

Re: [PHP] What in Hades?

2009-02-26 Thread 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 --

Re: [PHP] What in Hades?

2009-02-26 Thread PJ
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

Re: [PHP] What in Hades?

2009-02-26 Thread PJ
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!

Re: [PHP] What in Hades?

2009-02-26 Thread PJ
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

Re: [PHP] What in Hades?

2009-02-26 Thread Ashley Sheridan
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

[PHP] catch the error

2009-02-26 Thread PJ
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

Re: [PHP] catch the error

2009-02-26 Thread Ashley Sheridan
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',

[PHP] Re: catch the error

2009-02-26 Thread Darryle Steplight
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

[PHP] Re: catch the error

2009-02-26 Thread 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

[PHP] Re: catch the error

2009-02-26 Thread Jim Lyons
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

[PHP] Re: catch the error

2009-02-26 Thread Darryle Steplight
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

[PHP] Re: catch the error

2009-02-26 Thread Ricardo Dias Marques
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');

Re: [PHP] catch the error

2009-02-26 Thread PJ
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',

[PHP] Re: catch the error

2009-02-26 Thread PJ
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

[PHP] Re: catch the error

2009-02-26 Thread PJ
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',

[PHP] Re: catch the error

2009-02-26 Thread PJ
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);

Re: [PHP] catch the error

2009-02-26 Thread Ashley Sheridan
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

Re: [PHP] Re: catch the error

2009-02-26 Thread Andrew Ballard
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

[PHP] Re: catch the error

2009-02-26 Thread Darryle Steplight
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

RE: [PHP] RE: non-auto increment question

2009-02-26 Thread Jerry Schwartz
-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

Re: [PHP] Re: catch the error

2009-02-26 Thread Ashley Sheridan
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

[PHP] RE: catch the error

2009-02-26 Thread Jerry Schwartz
-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

RE: [PHP] RE: non-auto increment question

2009-02-26 Thread Jerry Schwartz
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 =

Re: [PHP] Re: catch the error

2009-02-26 Thread Darryle Steplight
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

RE: [PHP] RE: non-auto increment question

2009-02-26 Thread Ashley Sheridan
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

Re: [PHP] Re: catch the error

2009-02-26 Thread 9el
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

[PHP] Re: catch the error

2009-02-26 Thread PJ
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

Re: [PHP] Re: catch the error

2009-02-26 Thread PJ
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

Re: [PHP] Re: catch the error

2009-02-26 Thread Ashley Sheridan
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

Re: [PHP] Re: catch the error

2009-02-26 Thread PJ
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

Re: [PHP] RE: non-auto increment question

2009-02-26 Thread PJ
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 =

Re: [PHP] Re: catch the error

2009-02-26 Thread PJ
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

RE: [PHP] RE: non-auto increment question

2009-02-26 Thread Jerry Schwartz
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,

[PHP] use strict or similar in PHP?

2009-02-26 Thread Hans Schultz
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

[PHP] Get a list of column field names from a MS Access table

2009-02-26 Thread revDAVE
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] --

Re: [PHP] use strict or similar in PHP?

2009-02-26 Thread Lewis Wright
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

RE: [PHP] Web Development work

2009-02-26 Thread Ernie Kemp
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

Re: [PHP] use strict or similar in PHP?

2009-02-26 Thread 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 --

Re: [PHP] use strict or similar in PHP?

2009-02-26 Thread Ovidiu Rosoiu
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

Re: [PHP] use strict or similar in PHP?

2009-02-26 Thread Hans Schultz
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

Re: [PHP] use strict or similar in PHP?

2009-02-26 Thread 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 --

Re: [PHP] use strict or similar in PHP?

2009-02-26 Thread Hans Schultz
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

Re: [PHP] use strict or similar in PHP?

2009-02-26 Thread Spam Recipient
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

Re: [PHP] use strict or similar in PHP?

2009-02-26 Thread Ovidiu Rosoiu
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

Re: [PHP] use strict or similar in PHP?

2009-02-26 Thread Shawn McKenzie
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

Re: [PHP] use strict or similar in PHP?

2009-02-26 Thread Hans Schultz
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

Re: [PHP] use strict or similar in PHP?

2009-02-26 Thread Shawn McKenzie
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

RE: [PHP] Re: catch the error

2009-02-26 Thread Boyd, Todd M.
-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

Re: [PHP] RE: non-auto increment question

2009-02-26 Thread Ashley Sheridan
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 =

Re: [PHP] Re: catch the error

2009-02-26 Thread Ashley Sheridan
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 =

Re: [PHP] Re: catch the error

2009-02-26 Thread Shawn McKenzie
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

Re: [PHP] Re: catch the error

2009-02-26 Thread Chris
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

RE: [PHP] Re: catch the error

2009-02-26 Thread Boyd, Todd M.
-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

[PHP] verify text in field

2009-02-26 Thread PJ
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

RE: [PHP] verify text in field

2009-02-26 Thread admin
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

Re: [PHP] verify text in field

2009-02-26 Thread Paul M Foster
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 //

[PHP] Re: verify text in field

2009-02-26 Thread Shawn McKenzie
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;

[PHP] Re: verify text in field

2009-02-26 Thread Shawn McKenzie
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

Re: [PHP] Re: catch the error

2009-02-26 Thread PJ
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

Re: [PHP] Re: catch the error

2009-02-26 Thread PJ
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,

Re: [PHP] Re: catch the error

2009-02-26 Thread Chris
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

RE: [PHP] RE: non-auto increment question

2009-02-26 Thread Gary W. Smith
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

[PHP] How do I remove an array element from within a recursive function?

2009-02-26 Thread Daevid Vincent
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

[PHP] Re: How do I remove an array element from within a recursive function?

2009-02-26 Thread Shawn McKenzie
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

[PHP] Re: How do I remove an array element from within a recursive function?

2009-02-26 Thread Shawn McKenzie
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

Re: [PHP] Re: How do I remove an array element from within a recursive function?

2009-02-26 Thread Daevid Vincent
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:

Re: [PHP] Re: How do I remove an array element from within a recursive function?

2009-02-26 Thread Chris
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

Re: [PHP] verify text in field

2009-02-26 Thread PJ
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

Re: [PHP] Re: catch the error

2009-02-26 Thread 9el
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

[PHP] Re: verify text in field

2009-02-26 Thread David Robley
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;

[PHP] Stupid is as Stupid does

2009-02-26 Thread Michael A. Peters
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

Re: [PHP] use strict or similar in PHP?

2009-02-26 Thread Per Jessen
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

[PHP] Re: Stupid is as Stupid does

2009-02-26 Thread Ondrej Kulaty
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

Re: [PHP] Stupid is as Stupid does

2009-02-26 Thread Sudheer
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