Re: [PHP-DB] Prepared Statements Rows Selected

2011-05-23 Thread Giff Hammar
$stmt->rows() should give you the number of rows returned. Giff On Mon, 2011-05-23 at 18:53 -0400, Ron Piggott wrote: > What command will tell me the # of rows the SELECT query retrieved using > Prepared Statements. > > > $dsh = 'mysql:host=localhost;dbname='.$database; > $dbh = new PDO($dsh,

Re: [PHP-DB] RE: Help for a beginner

2009-12-23 Thread Giff Hammar
It looks like you are not connecting because of a user name/password combination. Typically, Windows does not use root as a valid login as do most other operating systems. Try using your login information to see if you can connect to mySQL using the GUI. I suspect you'll succeed. The other option w

Re: [PHP-DB] DB interface problem

2009-10-28 Thread Giff Hammar
Thanks for the suggestion. I'll need to look into it. Giff On Wed, 2009-10-28 at 11:23 +0100, Samuel ROZE wrote: > Why not using PDO ? It is a global and standardized method to access > to data. :-) > > 2009/10/27 Giff Hammar : > > I started having trouble with a DBI int

Re: [PHP-DB] DB interface problem

2009-10-27 Thread Giff Hammar
t;$this->res" is. > > And lastly, you could get a back-trace of the rows() method call to > see if it's being called before $this->res has been assigned - just > add the line "var_dump(debug_backtrace());" between lines 201 and 202. > > Hope this giv

Re: [PHP-DB] DB interface problem

2009-10-27 Thread Giff Hammar
should be able to see > it better! > > Andy > > On 27 October2009, at 12:48, Giff Hammar wrote: > > > I started having trouble with a DBI interface to my PostgreSQL > > database > > after I built a new Ubuntu machine. The Postgres version is 8.3 and > &

[PHP-DB] DB interface problem

2009-10-27 Thread Giff Hammar
I started having trouble with a DBI interface to my PostgreSQL database after I built a new Ubuntu machine. The Postgres version is 8.3 and the DBI was written several years ago (by someone else). I'm using PHP version 5.2.6-3ubuntu4.2 with apache2. The problem is that I get the error: Warning: pg

RE: [PHP-DB] Php in the twilight zone!

2006-04-21 Thread Giff Hammar
If you're doing lots of database queries, also make sure that every column in your WHERE clause in each query is indexed. That will significantly decrease the time it takes for the database engine to access the data. Giff -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTE

RE: [PHP-DB] MD5, MySQL, and salts

2006-04-17 Thread Giff Hammar
For an example, look at how UNIX/Linux stores regular login passwords. In short, the salt is the first two characters in the password. When comparing passwords, you take the salt and the user supplied password, encrypt, then compare the two encrypted strings. If they match, the recently supplied pa

RE: [PHP-DB] Web forms

2006-04-14 Thread Giff Hammar
Ron, One option is to build a list of privs and iterate over that for the form and processing To do that, you would iterate over the list and use variables to name the fields. When you process the form, you would iterate over the same list and extract the values. Form building: $foo = array ('p

RE: [PHP-DB] help with file downloads from MySQL

2006-03-21 Thread Giff Hammar
Can you use something like this (I haven't tried it)? $search = '/^0a/'; // Looks at the beginning of the stream for 0a $replace = ""; // Replace with this $limit = 1; // How many you want to do $new_file = preg_replace($search, $replace, $old_file, $limit); Giff -Original Message- Fro

RE: [PHP-DB] Remove newlines from field

2006-03-21 Thread Giff Hammar
tabase. It fails with an "unrecognized command" >because the end of field delimiter is on a different line. We're >running on PHP 4.2.7 and I have tried using various combinations of >str_replace to eliminate the newline characters, but I have been >unsuccessful. Any suggesti

RE: [PHP-DB] Remove newlines from field

2006-03-21 Thread Giff Hammar
-Original Message- From: Ludvig Ericson [mailto:[EMAIL PROTECTED] Sent: Monday, March 20, 2006 5:54 PM To: Giff Hammar Cc: php-db@lists.php.net Subject: Re: [PHP-DB] Remove newlines from field Mind you Pearl programmers, what would that do? [snip] It changes the end of line

RE: [PHP-DB] Remove newlines from field

2006-03-20 Thread Giff Hammar
emy Peterson [mailto:[EMAIL PROTECTED] Sent: Monday, March 20, 2006 5:14 PM To: Giff Hammar Subject: Re: [PHP-DB] Remove newlines from field Try nl2br. http://php.net/nl2br At 04:00 PM 3/20/2006, you wrote: I am using a PHP script to pull information from a FoxPro database via ODBC. One of

[PHP-DB] Remove newlines from field

2006-03-20 Thread Giff Hammar
successful. Any suggestions? Giff Giff Hammar IT Director Certified Parts Warehouse http://www.certifiedparts.com <http://www.certifiedparts.com/> mailto: [EMAIL PROTECTED] V: 603.516.1707 F: 603.516.1702 M: 603.490.7163