Re: [PHP-DB] PDO user question

2012-09-10 Thread Matt Pelmear
Brandon: RAM is cheap, but not always expendable depending on what you're doing. Using count() on results from PDOStatement::fetchAll() is fine on small result sets. Keep in mind that this will certainly blow up on very large result sets, especially depending on your memory_limit for php. Avoidi

[PHP-DB] Re: Adding entry to /dev

2012-09-10 Thread Jim Giner
On 9/10/2012 7:41 PM, Ethan Rosenberg, PhD wrote: Dear list - How do I add a new entry to /dev; eg, /dev/sdb? Thanks, Ethan Rosenberg Ethan, Sometimes google is great at answering this kind of stuff. Did you try a search on your question. I did and found an answer in the fifth result ret

Re: [PHP-DB] Re: Problems w/ insert

2012-09-10 Thread Jim Giner
On 9/11/2012 12:04 AM, Matt Pelmear wrote: Ethan, I am curious why you are using mysqli_stmt_bind_result() on a statement that is an INSERT query? I don't use mysqli, but as I read the documentation it seems to me that this method is intended to bind results from a SELECT query into variables so

[PHP-DB] Re: Problems w/ insert

2012-09-10 Thread Jim Giner
On 9/10/2012 8:06 PM, Ethan Rosenberg, PhD wrote: Dear list - Here is my code: $sql3 = "select max(Indx) from Visit3"; $result7 = mysqli_query($cxn, $sql3); $row7 = mysqli_fetch_array($result7, MYSQLI_BOTH); $Indx = $row7[0]; $sql2 = "INS

Re: [PHP-DB] Re: Problems w/ insert

2012-09-10 Thread Jim Giner
On 9/10/2012 8:29 PM, Karl DeSaulniers wrote: On Sep 10, 2012, at 7:06 PM, Ethan Rosenberg, PhD wrote: Dear list - Here is my code: $sql3 = "select max(Indx) from Visit3"; $result7 = mysqli_query($cxn, $sql3); $row7 = mysqli_fetch_array($result7, MYSQLI_BOTH);

Re: [PHP-DB] mysqli_connect ??

2012-09-10 Thread Matt Pelmear
Jim, You likely have to install the mysqli package for your distribution. Try a search for something like"ubuntu install php mysqli" or "centos install php mysqli" I can tell you for ubuntu you probably would need to do something like this: sudo apt-get install php5-mysql If you're in a h

Re: [PHP-DB] Re: Problems w/ insert

2012-09-10 Thread Matt Pelmear
Ethan, I am curious why you are using mysqli_stmt_bind_result() on a statement that is an INSERT query? I don't use mysqli, but as I read the documentation it seems to me that this method is intended to bind results from a SELECT query into variables so that you can simply call mysqli_stmt_fe

Re: [PHP-DB] Another PDO ?

2012-09-10 Thread Matt Pelmear
Jim, We have code that operates on tables that can be altered by users of the application (effectively storing different types of user data for each client). Some routines fetch results with PDO::FETCH_NUM as opposed to PDO::FETCH_ASSOC (or others), particularly when returning large amounts o

Re: [PHP-DB] Adding entry to /dev

2012-09-10 Thread Matt Pelmear
Ethan, I think you should be a little more specific about what your end goal is. -Matt On 09/10/2012 07:41 PM, Ethan Rosenberg, PhD wrote: Dear list - How do I add a new entry to /dev; eg, /dev/sdb? Thanks, Ethan Rosenberg -- PHP Database Mailing List (http://www.php.net/) To unsubscri

Re: [PHP-DB] Re: Problems w/ insert

2012-09-10 Thread Karl DeSaulniers
On Sep 10, 2012, at 7:06 PM, Ethan Rosenberg, PhD wrote: Dear list - Here is my code: $sql3 = "select max(Indx) from Visit3"; $result7 = mysqli_query($cxn, $sql3); $row7 = mysqli_fetch_array($result7, MYSQLI_BOTH); $Indx = $row7[0]; $sql2 = "INSE

[PHP-DB] Re: Problems w/ insert

2012-09-10 Thread Ethan Rosenberg, PhD
Dear list - Here is my code: $sql3 = "select max(Indx) from Visit3"; $result7 = mysqli_query($cxn, $sql3); $row7 = mysqli_fetch_array($result7, MYSQLI_BOTH); $Indx = $row7[0]; $sql2 = "INSERT INTO Visit3(Indx, Site, MedRec, Notes, Weight, BMI,

[PHP-DB] Adding entry to /dev

2012-09-10 Thread Ethan Rosenberg, PhD
Dear list - How do I add a new entry to /dev; eg, /dev/sdb? Thanks, Ethan Rosenberg -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Another PDO ?

2012-09-10 Thread Toby Hart Dyke
On 9/10/2012 4:54 PM, Jim Giner wrote: On 9/10/2012 11:10 AM, Lester Caine wrote: Jim Giner wrote: On 9/10/2012 10:49 AM, Bastien Koert wrote: On Mon, Sep 10, 2012 at 9:48 AM, Jim Giner wrote: Reading up on the pdostatement class. Wondering what the intent of the columnCount function is.

Re: [PHP-DB] Another PDO ?

2012-09-10 Thread Jim Giner
On 9/10/2012 11:10 AM, Lester Caine wrote: Jim Giner wrote: On 9/10/2012 10:49 AM, Bastien Koert wrote: On Mon, Sep 10, 2012 at 9:48 AM, Jim Giner wrote: Reading up on the pdostatement class. Wondering what the intent of the columnCount function is. I mean, aren't the number of columns in a

Re: [PHP-DB] Another PDO ?

2012-09-10 Thread Lester Caine
Jim Giner wrote: On 9/10/2012 10:49 AM, Bastien Koert wrote: On Mon, Sep 10, 2012 at 9:48 AM, Jim Giner wrote: Reading up on the pdostatement class. Wondering what the intent of the columnCount function is. I mean, aren't the number of columns in a result known when you write the query? Gra

Re: [PHP-DB] Another PDO ?

2012-09-10 Thread Bruno Sandivilli
Imagine if you are building a generic database framework, so you (dont have, but) can generalize your queries functions and abstract some tables info. 2012/9/10 Graham H. > I think it's so that you could write functions as generically as possible. > So you don't have to pass in the number of co

Re: [PHP-DB] Another PDO ?

2012-09-10 Thread Jim Giner
On 9/10/2012 10:53 AM, Graham H. wrote: I think it's so that you could write functions as generically as possible. So you don't have to pass in the number of columns or hard code in values for number of columns, you can dynamically check the column count for each result set that gets passed in. T

Re: [PHP-DB] Another PDO ?

2012-09-10 Thread Graham H.
I think it's so that you could write functions as generically as possible. So you don't have to pass in the number of columns or hard code in values for number of columns, you can dynamically check the column count for each result set that gets passed in. That's my guess. On Mon, Sep 10, 2012 at 8

Re: [PHP-DB] Another PDO ?

2012-09-10 Thread Jim Giner
On 9/10/2012 10:49 AM, Bastien Koert wrote: On Mon, Sep 10, 2012 at 9:48 AM, Jim Giner wrote: Reading up on the pdostatement class. Wondering what the intent of the columnCount function is. I mean, aren't the number of columns in a result known when you write the query? Granted, you might ha

Re: [PHP-DB] Another PDO ?

2012-09-10 Thread Bastien Koert
On Mon, Sep 10, 2012 at 9:48 AM, Jim Giner wrote: > Reading up on the pdostatement class. Wondering what the intent of the > columnCount function is. I mean, aren't the number of columns in a result > known when you write the query? Granted, you might have some very complex > query that you may

[PHP-DB] Re: PDO user question

2012-09-10 Thread Jim Giner
On 9/8/2012 2:02 PM, Jim Giner wrote: I finally delved into learning how I was going to replace my MYSQL calls with a different interface. Had to go with PDO since my hoster doesn't support MYSQLI for my plan. I've had some success with querying using pdo and prepared statements as well. One t

[PHP-DB] Another PDO ?

2012-09-10 Thread Jim Giner
Reading up on the pdostatement class. Wondering what the intent of the columnCount function is. I mean, aren't the number of columns in a result known when you write the query? Granted, you might have some very complex query that you may not know the number, but for most queries you will kno