Re: [PHP] mysql_num_rows()

2011-02-22 Thread Daniel Molina Wegener
On Tuesday 22 February 2011, Gary gp...@paulgdesigns.com wrote: Can someone tell me why this is not working? I do not get an error message, the results are called and echo'd to screen, the count does not work, I get a 0 for a result... Are you sure that the table is called `counties` and

RE: [PHP] How to write code: how wrong am I?

2011-02-22 Thread Jay Blanchard
[snip] The point that I stress on the page is that first you close an element, then you fill it's contents. The page has examples in HTML and PHP. I would like to know what the experienced programmers here think about this. Am I going about it wrong? [/snip] It is an interesting concept Dotan,

Re: [PHP] How to write code: how wrong am I?

2011-02-22 Thread Marc Guay
It's an interesting idea (a different take on coding best practices) but I find the PHP example to be laborious and time consuming with little benefit. If I'm typing an IF statement, I hope to god I know what the condition is before I start typing it. Creating the if/else structure first and

Re: [PHP] mysql_num_rows()

2011-02-22 Thread Andre Polykanine
Hello Gary, Please wrap $i in braces in your variable variable: if ( isset($_POST[county{$i}] ) ) { echo You have chosen . $_POST[county{$i}]. br/; -- With best regards from Ukraine, Andre Skype: Francophile My blog: http://oire.org/menelion (mostly in Russian) Twitter:

[PHP] Re: mysql_num_rows()

2011-02-22 Thread Pete Ford
On 22/02/11 05:40, Gary wrote: Can someone tell me why this is not working? I do not get an error message, the results are called and echo'd to screen, the count does not work, I get a 0 for a result... $result = mysql_query(SELECT * FROM `counties` WHERE name = 'checked') or

Re: [PHP] How to write code: how wrong am I?

2011-02-22 Thread Robert Cummings
On 11-02-22 06:29 AM, Dotan Cohen wrote: I wrote a short page on how to actually type of code that one writes, it can be found here: http://dotancohen.com/howto/write_code.html The point that I stress on the page is that first you close an element, then you fill it's contents. The page has

Re: [PHP] How to write code: how wrong am I?

2011-02-22 Thread Andy McKenzie
On Tue, Feb 22, 2011 at 6:29 AM, Dotan Cohen dotanco...@gmail.com wrote: I wrote a short page on how to actually type of code that one writes, it can be found here: http://dotancohen.com/howto/write_code.html The point that I stress on the page is that first you close an element, then you

Re: [PHP] mysql_num_rows()

2011-02-22 Thread Gary
5895 (20110222) __ The message was checked by ESET Smart Security. http://www.eset.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] mysql_num_rows()

2011-02-22 Thread Gary
__ Information from ESET Smart Security, version of virus signature database 5895 (20110222) __ The message was checked by ESET Smart Security. http://www.eset.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] How to write code: how wrong am I?

2011-02-22 Thread Dotan Cohen
On Tue, Feb 22, 2011 at 14:11, Jay Blanchard jblanch...@pocket.com wrote: It is an interesting concept Dotan, what is the goal? Who is the page targeted to? The goal is to have every open and close bracket matched, and not have to worry about what is still open. The page was specifically

[PHP] Re: mysql_num_rows()

2011-02-22 Thread Gary
for your reply. Gary __ Information from ESET Smart Security, version of virus signature database 5895 (20110222) __ The message was checked by ESET Smart Security. http://www.eset.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net

Re: [PHP] How to write code: how wrong am I?

2011-02-22 Thread Dotan Cohen
On Tue, Feb 22, 2011 at 15:00, Andy McKenzie amckenz...@gmail.com wrote: I'll be the first to tell you that I'm not a great programmer, so my take may not be worth a lot.  However, this is pretty close to how I write.  Not exactly, but close.  I also always label open and closing brackets on

[PHP] Re: mysql_num_rows()

2011-02-22 Thread Pete Ford
__ Information from ESET Smart Security, version of virus signature database 5895 (20110222) __ The message was checked by ESET Smart Security. http://www.eset.com Well, Lets go back to your original code and cut out the decoration: $result = mysql_query(SELECT * FROM

Re: [PHP] How to write code: how wrong am I?

2011-02-22 Thread Robert Cummings
On 11-02-22 08:58 AM, Dotan Cohen wrote: On Tue, Feb 22, 2011 at 14:11, Jay Blanchardjblanch...@pocket.com wrote: It is an interesting concept Dotan, what is the goal? Who is the page targeted to? The goal is to have every open and close bracket matched, and not have to worry about what is

Re: [PHP] How to write code: how wrong am I?

2011-02-22 Thread Robert Cummings
On 11-02-22 09:06 AM, Dotan Cohen wrote: On Tue, Feb 22, 2011 at 14:58, Robert Cummingsrob...@interjinn.com wrote: I'm more likely to do this stuff for HTML than PHP. However, I do sometimes lay out the structure of some conditionals/functions before fleshing them out so that I can do some

Re: [PHP] How to write code: how wrong am I?

2011-02-22 Thread Dotan Cohen
On Tue, Feb 22, 2011 at 14:15, Marc Guay marc.g...@gmail.com wrote: It's an interesting idea (a different take on coding best practices) but I find the PHP example to be laborious and time consuming with little benefit.  If I'm typing an IF statement, I hope to god I know what the condition is

Re: [PHP] How to write code: how wrong am I?

2011-02-22 Thread Dotan Cohen
On Tue, Feb 22, 2011 at 14:58, Robert Cummings rob...@interjinn.com wrote: I'm more likely to do this stuff for HTML than PHP. However, I do sometimes lay out the structure of some conditionals/functions before fleshing them out so that I can do some early testing... but I always fill the

[PHP] Re: mysql_num_rows()

2011-02-22 Thread Gary
as mysql_num_rows() but am getting the same result. Could you explain what you mean by count them as I go? Again, Thank you for your reply. Gary __ Information from ESET Smart Security, version of virus signature database 5895 (20110222) __ The message was checked by ESET

Re: [PHP] Regex pattern for preg_match_all

2011-02-22 Thread Yann Milin
Le 19/02/2011 0:23, Tommy Pham a écrit : @Simon, Thanks for explaining about the [^href]. I need to read up more about greediness. I thought I understood it but guess not. @Peter, I tried your pattern but it didn't capture all of my new test cases. Also, it captures the single/double quotes

Re: [PHP] How to write code: how wrong am I?

2011-02-22 Thread la...@garfieldtech.com
On 2/22/11 12:04 PM, Alexis wrote: On 22/02/11 09:40, Dotan Cohen wrote: On Tue, Feb 22, 2011 at 16:15, Robert Cummingsrob...@interjinn.com wrote: If you switch to vertically aligned braces you will have an easier time matching up open and close braces... if (something) { // Code here }

[PHP] Large binary objects in MySQL - problem

2011-02-22 Thread Florin Jurcovici
Hi. I use PDO and have written myself a class to abstract the database a bit. It has a method for querying the database specifically for large objects, like this: $connection = $this-getConnection(); // what's returned is a PDOStatement, and a transaction is already started

[PHP] Problems with PDO and LOB columns in mysql

2011-02-22 Thread Florin Jurcovici
Hi. The code I use to extract the data from a query which was just performed looks like this: $data = array(); $receiverRow = array(); $i = 0; foreach ($columns as $column = $type) $statement-bindColumn($i++,

[PHP] Dynamically Created Checkboxes

2011-02-22 Thread Gary
5897 (20110222) __ The message was checked by ESET Smart Security. http://www.eset.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Large binary objects in MySQL - problem

2011-02-22 Thread Tommy Pham
On Tue, Feb 22, 2011 at 1:07 PM, Florin Jurcovici florin.jurcov...@gmail.com wrote: Hi. I use PDO and have written myself a class to abstract the database a bit. It has a method for querying the database specifically for large objects, like this:                $connection =