Re: [PHP] MYSQL 5 auto increment not working

2009-05-21 Thread Bruno Fajardo
2009/5/21 Leidago !Noabeb leid...@googlemail.com Hi All I know this is not strictly a PHP question, but i have a problem whenever i insert a record using PHP. Basically the auto increment field does not work at all. Here's the structure of the table that i'm using: CREATE TABLE `children`

Re: [PHP] MYSQL 5 auto increment not working

2009-05-21 Thread Per Jessen
Leidago !Noabeb wrote: Hi All I know this is not strictly a PHP question, but i have a problem whenever i insert a record using PHP. Basically the auto increment field does not work at all. Here's the structure of the table that i'm using: CREATE TABLE `children` ( `cid` int(4) NOT

Re: [PHP] MySQL -- finding whether there's a transaction started

2009-04-26 Thread Chris
Bogdan Stancescu wrote: On 24-Apr-09 03:45, Chris wrote: I don't think mysql has any way of finding that out. If you're using an abstraction layer, it's easy enough in code - though rollback's are a little harder - should they do a complete rollback or just to a savepoint? Thank you for

Re: [PHP] MySQL -- finding whether there's a transaction started

2009-04-26 Thread Lester Caine
Bogdan Stancescu wrote: Hello list, I'm developing a library and would need to know if the code calling my library has already started a MySQL transaction or not. I want to know whether I should start one or use savepoints instead -- starting a transaction if one is already in progress commits

Re: [PHP] MySQL, MD5 and SHA1

2009-04-24 Thread Per Jessen
Jan G.B. wrote: 2009/4/21 Per Jessen p...@computer.org: Jan G.B. wrote: A web application that uses an external db server would be quite ... uhm... slow! Anyone did this, yet? ;) Certainly, and it's not slow.  It depends entirely on your connection to the public internet. As we're

Re: [PHP] MySQL -- finding whether there's a transaction started

2009-04-24 Thread Bogdan Stancescu
On 24-Apr-09 03:45, Chris wrote: I don't think mysql has any way of finding that out. If you're using an abstraction layer, it's easy enough in code - though rollback's are a little harder - should they do a complete rollback or just to a savepoint? Thank you for taking the time to sketch that

Re: [PHP] MySQL, MD5 and SHA1

2009-04-24 Thread Andrew Ballard
On Wed, Apr 22, 2009 at 10:25 AM, Jan G.B. ro0ot.w...@googlemail.com wrote: 2009/4/21 Per Jessen p...@computer.org: Jan G.B. wrote: A web application that uses an external db server would be quite ... uhm... slow! Anyone did this, yet? ;) Certainly, and it's not slow.  It depends entirely

[PHP] MySQL -- finding whether there's a transaction started

2009-04-23 Thread Bogdan Stancescu
Hello list, I'm developing a library and would need to know if the code calling my library has already started a MySQL transaction or not. I want to know whether I should start one or use savepoints instead -- starting a transaction if one is already in progress commits the existing transaction,

Re: [PHP] MySQL -- finding whether there's a transaction started

2009-04-23 Thread Chris
Bogdan Stancescu wrote: Hello list, I'm developing a library and would need to know if the code calling my library has already started a MySQL transaction or not. I want to know whether I should start one or use savepoints instead -- starting a transaction if one is already in progress commits

Re: [PHP] MySQL, MD5 and SHA1

2009-04-22 Thread Jan G.B.
2009/4/21 Per Jessen p...@computer.org: Jan G.B. wrote: A web application that uses an external db server would be quite ... uhm... slow! Anyone did this, yet? ;) Certainly, and it's not slow.  It depends entirely on your connection to the public internet. As we're speaking of the

[PHP] MySQL, MD5 and SHA1

2009-04-21 Thread Grega Leskovsek
provided I want to store hash of a password in MySQL ... Using MySQL, the whole check can be achieved with a SQL query, since the MD5 function is provided as part of the database query language ... Can I use also SHA1 or must I use MD5? Thanks in advance, -- When the sun rises I receive and

Re: [PHP] MySQL, MD5 and SHA1

2009-04-21 Thread Per Jessen
Grega Leskovsek wrote: provided I want to store hash of a password in MySQL ... Using MySQL, the whole check can be achieved with a SQL query, since the MD5 function is provided as part of the database query language ... Can I use also SHA1 or must I use MD5? You could have just checked

Re: [PHP] MySQL, MD5 and SHA1

2009-04-21 Thread Andrew Ballard
On Tue, Apr 21, 2009 at 8:34 AM, Grega Leskovsek mavri...@gmail.com wrote: provided I want to store hash of a password in MySQL ... Using MySQL, the whole check can be achieved with a SQL query, since the MD5 function is provided as part of the database query language ... Can I use also SHA1

Re: [PHP] MySQL, MD5 and SHA1

2009-04-21 Thread Jan G.B.
2009/4/21 Andrew Ballard aball...@gmail.com: On Tue, Apr 21, 2009 at 8:34 AM, Grega Leskovsek mavri...@gmail.com wrote: provided I want to store hash of a password in MySQL ... Using MySQL, the whole check can be achieved with a SQL query, since the MD5 function is provided as part of the

Re: [PHP] MySQL, MD5 and SHA1

2009-04-21 Thread Per Jessen
Jan G.B. wrote: A web application that uses an external db server would be quite ... uhm... slow! Anyone did this, yet? ;) Certainly, and it's not slow. It depends entirely on your connection to the public internet. -- Per Jessen, Zürich (18.2°C) -- PHP General Mailing List

Re: [PHP] MySQL, MD5 and SHA1

2009-04-21 Thread Micah Gersten
Andrew Ballard wrote: On Tue, Apr 21, 2009 at 8:34 AM, Grega Leskovsek mavri...@gmail.com wrote: provided I want to store hash of a password in MySQL ... Using MySQL, the whole check can be achieved with a SQL query, since the MD5 function is provided as part of the database query language ...

Fwd: [PHP] MySQL, MD5 and SHA1

2009-04-21 Thread Steve Holmes
Oops, meant to copy the list. -- Forwarded message -- From: Steve Holmes sholme...@mac.com Date: Tue, Apr 21, 2009 at 10:13 PM Subject: Re: [PHP] MySQL, MD5 and SHA1 To: Per Jessen p...@computer.org On Tue, Apr 21, 2009 at 1:35 PM, Per Jessen p...@computer.org wrote: Jan G.B

[PHP] PHP/MYSQL/ Encrypting Sensetive information

2009-04-17 Thread Russell Jones
We are looking at a project where we will potentially need to store sensetive information in a few fields of a MySQL table. Any recommendations on where to look for best practices in doing this? for encrypting the data, etc.? We will need to be able to decrypt the data as well, although this can

Re: [PHP] PHP/MYSQL/ Encrypting Sensetive information

2009-04-17 Thread tedd
At 10:00 AM -0400 4/17/09, Russell Jones wrote: We are looking at a project where we will potentially need to store sensetive information in a few fields of a MySQL table. Any recommendations on where to look for best practices in doing this? for encrypting the data, etc.? We will need to be

Re: [PHP] PHP/MYSQL/ Encrypting Sensetive information

2009-04-17 Thread דניאל דנון
If its by a user-basis, something that can be a bit risky but possible - You can encrypt it, password is hashed on database, and the key to the other data is the un-encrypted password.. On Fri, Apr 17, 2009 at 5:00 PM, Russell Jones rjon...@gmail.com wrote: We are looking at a project where we

Re: [PHP] PHP/MYSQL/ Encrypting Sensetive information

2009-04-17 Thread Stefan Langwald
MySQLs own Function AES_(EN|DE)CRYPT is pretty cool for this case. -- Stefan Langwald 2009/4/17 דניאל דנון danondan...@gmail.com: If its by a user-basis, something that can be a bit risky but possible - You can encrypt it, password is hashed on database, and the key to the other data is the

Re: [PHP] PHP/MYSQL/ Encrypting Sensetive information

2009-04-17 Thread Bastien Koert
On Fri, Apr 17, 2009 at 10:15 AM, דניאל דנון danondan...@gmail.com wrote: If its by a user-basis, something that can be a bit risky but possible - You can encrypt it, password is hashed on database, and the key to the other data is the un-encrypted password.. On Fri, Apr 17, 2009 at 5:00

Re: [PHP] PHP/MYSQL/ Encrypting Sensetive information

2009-04-17 Thread Philip Thompson
On Apr 17, 2009, at 10:17 AM, Stefan Langwald wrote: MySQLs own Function AES_(EN|DE)CRYPT is pretty cool for this case. -- Stefan Langwald We use MySQL's AES_(EN|DE)CRYPT. It's fast, easy to use and uses 128 bit encryption (optionally 256).

[PHP] PHP-MYSQL Question

2009-04-07 Thread abdulazeez alugo
Hi guys, Please can anyone tell me what I'm doing wrong with the code below? It keep returning unsuccessful. $result=mysql_query(CREATE TABLE table2(table2_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, table1_id INT NOT NULL, name VARCHAR(100) NOT NULL,

Re: [PHP] PHP-MYSQL Question

2009-04-07 Thread HostWare Kft.
@lists.php.net Sent: Tuesday, April 07, 2009 3:05 PM Subject: [PHP] PHP-MYSQL Question Hi guys, Please can anyone tell me what I'm doing wrong with the code below? It keep returning unsuccessful. $result=mysql_query(CREATE TABLE table2(table2_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT

Re: [PHP] PHP-MYSQL Question

2009-04-07 Thread Per Jessen
abdulazeez alugo wrote: Hi guys, Please can anyone tell me what I'm doing wrong with the code below? It keep returning unsuccessful. Why don't you print out mysql_error() ? It'll tell you right away. /Per -- Per Jessen, Zürich (20.1°C) -- PHP General Mailing List

RE: [PHP] PHP-MYSQL Question

2009-04-07 Thread abdulazeez alugo
From: p...@computer.org Date: Tue, 7 Apr 2009 15:18:35 +0200 To: php-general@lists.php.net Subject: Re: [PHP] PHP-MYSQL Question abdulazeez alugo wrote: Hi guys, Please can anyone tell me what I'm doing wrong with the code below? It keep returning unsuccessful. Why

[PHP] PHP/MySQL ISP recommendation that lets one edit ft_min_word_len variable?

2009-04-04 Thread Rob Gould
Can anyone here recommend an ISP that will let me have a dedicated server (not shared), and also allow me to adjust the ft_min_word_len mySQL parameter? I was originally thinking Dreamhost PS, but I recently found out that they do not allow changes to mySQL environmental variables. I really

Re: [PHP] PHP/MySQL ISP recommendation that lets one edit ft_min_word_len variable?

2009-04-04 Thread Michael A. Peters
Rob Gould wrote: Can anyone here recommend an ISP that will let me have a dedicated server (not shared), and also allow me to adjust the ft_min_word_len mySQL parameter? I was originally thinking Dreamhost PS, but I recently found out that they do not allow changes to mySQL environmental

Re: [PHP] PHP/MySQL ISP recommendation that lets one edit ft_min_word_len variable?

2009-04-04 Thread Richard Heyes
Hi, Can anyone here recommend an ISP that will let me have a dedicated server (not shared), and also allow me to adjust the ft_min_word_len mySQL parameter?  I was originally thinking Dreamhost PS, but I recently found out that they do not allow changes to mySQL environmental variables.  I

[PHP] PHP + MySQL - Load last inserts

2009-03-30 Thread Sebastian Muszytowski
Hello :) I have some troubles with php and mysql. I have a normal MySQL Query and this returns X 3 rows. Now i want to get the last 3 inserted values. For Example i've inserted A, B, C, D, E I want to get the last inserted values, e.g. E D C (in reversed order) So how to do this? I

Re: [PHP] PHP + MySQL - Load last inserts

2009-03-30 Thread Thijs Lensselink
Sebastian Muszytowski wrote: Hello :) I have some troubles with php and mysql. I have a normal MySQL Query and this returns X 3 rows. Now i want to get the last 3 inserted values. For Example i've inserted A, B, C, D, E I want to get the last inserted values, e.g. E D C (in reversed

Re: [PHP] PHP + MySQL - Load last inserts

2009-03-30 Thread Marc
I have some troubles with php and mysql. I have a normal MySQL Query and this returns X 3 rows. Now i want to get the last 3 inserted values. For Example i've inserted A, B, C, D, E I want to get the last inserted values, e.g. E D C (in reversed order) So how to do this? I already searched

Re: [PHP] PHP + MySQL - Load last inserts

2009-03-30 Thread Sebastian Muszytowski
Thijs Lensselink schrieb: Sebastian Muszytowski wrote: Hello :) I have some troubles with php and mysql. I have a normal MySQL Query and this returns X 3 rows. Now i want to get the last 3 inserted values. For Example i've inserted A, B, C, D, E I want to get the last inserted values,

Re: [PHP] PHP + MySQL - Load last inserts

2009-03-30 Thread haliphax
On Mon, Mar 30, 2009 at 7:55 AM, Sebastian Muszytowski s.muszytow...@googlemail.com wrote: Thijs Lensselink schrieb: Sebastian Muszytowski wrote: Hello :) I have some troubles with php and mysql.  I have a normal MySQL Query and this returns X 3 rows. Now i want to get the last 3

Re: [PHP] PHP + MySQL - Load last inserts

2009-03-30 Thread Sebastian Muszytowski
could use others? i think why should i use and add another system? I work with mysql already and when php+mysql have the function i need it's better and i don't waste ressources :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] PHP + MySQL - Load last inserts

2009-03-30 Thread abdulazeez alugo
Date: Mon, 30 Mar 2009 14:55:08 +0200 From: s.muszytow...@googlemail.com To: p...@addmissions.nl CC: php-general@lists.php.net Subject: Re: [PHP] PHP + MySQL - Load last inserts Thijs Lensselink schrieb: Sebastian Muszytowski wrote: Hello :) I have some troubles with php

Re: [PHP] PHP + MySQL - Load last inserts

2009-03-30 Thread haliphax
users. The second thing that aware me from doing this is, why use/build ressources when you could use others? i think why should i use and add another system? I work with mysql already and when php+mysql have the function i need it's better and i don't waste ressources :) Insert 100 records

Re: [PHP] PHP + MySQL - Load last inserts

2009-03-30 Thread Chris
too much users. The second thing that aware me from doing this is, why use/build ressources when you could use others? i think why should i use and add another system? I work with mysql already and when php+mysql have the function i need it's better and i don't waste ressources :) Insert 100

Re: [PHP] PHP + MySQL - Load last inserts

2009-03-30 Thread haliphax
, i could use code to remember but i think it would be very slow when i have too much users. The second thing that aware me from doing this is, why use/build ressources when you could use others? i think why should i use and add another system? I work with mysql already and when php+mysql have

Re: [PHP] PHP + MySQL - Load last inserts

2009-03-30 Thread Chris
The physical order of the rows changed (as you can see) but it does not re-use the id's that were deleted. Ordering by the id will get you the last bunch inserted. If you're using innodb you'll have to be aware it's transaction specific, if you're using myisam it will be system wide. I'll

RE: [PHP] MYSQL TABLES (One To Many Relationship)

2009-03-23 Thread abdulazeez alugo
:38:01 -0400 To: defati...@hotmail.com; php-general@lists.php.net From: tedd.sperl...@gmail.com Subject: Re: [PHP] MYSQL TABLES (One To Many Relationship) At 5:04 PM +0100 3/22/09, abdulazeez alugo wrote: Hi guys, I need help on something I'm working on and its really eating me up so I'll

[PHP] MYSQL TABLES (One To Many Relationship)

2009-03-22 Thread abdulazeez alugo
Hi guys, I need help on something I'm working on and its really eating me up so I'll appreciate any help I can get on it. I'm writing code for a site that posts a topic for discussion and accepts comments (Just like a parliament). There are different discussions for every day and the

Re: [PHP] MYSQL TABLES (One To Many Relationship)

2009-03-22 Thread tedd
At 5:04 PM +0100 3/22/09, abdulazeez alugo wrote: Hi guys, I need help on something I'm working on and its really eating me up so I'll appreciate any help I can get on it. I'm writing code for a site that posts a topic for discussion and accepts comments (Just like a parliament). There

RE: [PHP] [PHP MySQL] Introduction to using relational databases

2009-03-10 Thread Bob McConnell
From: Dirk Thilo Klein wrote: Dear readers, I am new to relational DB but not to MySQL PHP in general. I created a RDB using Struggling with the program's complexity I managed to create a set of databases being interconnected via (foreign) keys. What I want to know is how to

Re: [PHP] [PHP MySQL] Introduction to using relational databases

2009-03-10 Thread Chris
Bob McConnell wrote: From: Dirk Thilo Klein wrote: Dear readers, I am new to relational DB but not to MySQL PHP in general. I created a RDB using Struggling with the program's complexity I managed to create a set of databases being interconnected via (foreign) keys. What I want

[PHP] [PHP MySQL] Introduction to using relational databases

2009-03-09 Thread Thilo Klein
Dear readers, I am new to relational DB but not to MySQL PHP in general. I created a RDB using Powerdesigner. Struggling with the program's complexity I managed to create a set of databases being interconnected via (foreign) keys. What I want to know is how to use this database via

Re: [PHP] [PHP MySQL] Introduction to using relational databases

2009-03-09 Thread Dirk
Thilo Klein wrote: Dear readers, I am new to relational DB but not to MySQL PHP in general. I created a RDB using Struggling with the program's complexity I managed to create a set of databases being interconnected via (foreign) keys. What I want to know is how to use this database

Re: [PHP] [PHP MySQL] Introduction to using relational databases

2009-03-09 Thread Paul M Foster
), you have several choices. You can use the native PHP mysql functions to access the tables. Or you can use PHP's PDO classes (or similar). Both are documented at php.net (and very well, I might add). Your ER diagram is a visual representation of various CREATE TABLE statements in SQL. Using

Re: [PHP] [PHP MySQL] Introduction to using relational databases

2009-03-09 Thread Dirk
Thilo Klein wrote: Dear readers, I am new to relational DB but not to MySQL PHP in general. I created a RDB using Powerdesigner. Struggling with the program's complexity I managed to create a set of databases being interconnected via (foreign) keys. What I want to know is how to use

Re: [PHP] MySQL class. Thoughts?

2009-01-22 Thread clive
Chris wrote: That won't tell you where a query comes from ;) Add a debug_backtrace into the class to also pinpoint where the query was called from. Complicated queries built on variables (or even just long queries built over multiple lines) will be hard to find just by looking at the mysql

[PHP] MySQL class. Thoughts?

2009-01-21 Thread Jay Moore
This is a MySQL class I use and I wanted to get everyone's thoughts on how/if I can improve it. This is for MySQL only. I don't need to make it compatible with other databases. I'm curious what you all think. Thanks, Jay Class: -- ?php // Standard MySQL class class do_mysql {

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Edmund Hertle
2009/1/21 Jay Moore jaymo...@accu-com.com This is a MySQL class I use and I wanted to get everyone's thoughts on how/if I can improve it. This is for MySQL only. I don't need to make it compatible with other databases. I'm curious what you all think. Thanks, Jay Hey, 1. You know the

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Kyle Terry
On Wed, Jan 21, 2009 at 9:45 AM, Edmund Hertle edmund.her...@student.kit.edu wrote: 2009/1/21 Jay Moore jaymo...@accu-com.com This is a MySQL class I use and I wanted to get everyone's thoughts on how/if I can improve it. This is for MySQL only. I don't need to make it compatible with other

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Eric Butera
On Wed, Jan 21, 2009 at 12:45 PM, Edmund Hertle edmund.her...@student.kit.edu wrote: 2009/1/21 Jay Moore jaymo...@accu-com.com This is a MySQL class I use and I wanted to get everyone's thoughts on how/if I can improve it. This is for MySQL only. I don't need to make it compatible with

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Paul M Foster
On Wed, Jan 21, 2009 at 11:37:07AM -0600, Jay Moore wrote: This is a MySQL class I use and I wanted to get everyone's thoughts on how/if I can improve it. This is for MySQL only. I don't need to make it compatible with other databases. I'm curious what you all think. Thanks, Jay Class:

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Richard Heyes
This is a MySQL class I use and I wanted to get everyone's thoughts on how/if I can improve it. This is for MySQL only. I don't need to make it compatible with other databases. I'm curious what you all think. I have a similar thing I use, which uses the same (or at least very similar) API

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Jochem Maas
Paul M Foster schreef: On Wed, Jan 21, 2009 at 11:37:07AM -0600, Jay Moore wrote: This is a MySQL class I use and I wanted to get everyone's thoughts on how/if I can improve it. This is for MySQL only. I don't need to make it compatible with other databases. I'm curious what you all

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Philip Graham
On January 21, 2009 12:37:07 Jay Moore wrote: This is a MySQL class I use and I wanted to get everyone's thoughts on how/if I can improve it. This is for MySQL only. I don't need to make it compatible with other databases. I'm curious what you all think. I definetly think that using a DB

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Jay Moore
Good ideas guys. The input is much appreciated. Jochem (and anyone else, I guess), as I am not 100% versed with Exceptions, the php5 version you suggested, are those Exceptions able to be handled outside the class? Do I need my try block to be within the class block, or can I have the try

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Paul M Foster
On Wed, Jan 21, 2009 at 09:10:54PM +0100, Jochem Maas wrote: Paul M Foster schreef: On Wed, Jan 21, 2009 at 11:37:07AM -0600, Jay Moore wrote: This is a MySQL class I use and I wanted to get everyone's thoughts on how/if I can improve it. This is for MySQL only. I don't need to make

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Paul M Foster
On Wed, Jan 21, 2009 at 02:30:00PM -0600, Jay Moore wrote: Good ideas guys. The input is much appreciated. Jochem (and anyone else, I guess), as I am not 100% versed with Exceptions, the php5 version you suggested, are those Exceptions able to be handled outside the class? Do I need my

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Jochem Maas
Jay Moore schreef: Good ideas guys. The input is much appreciated. Jochem (and anyone else, I guess), as I am not 100% versed with Exceptions, the php5 version you suggested, are those Exceptions able to be handled outside the class? Do I need my try block to be within the class block,

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Jay Moore
I know it's very OO-y to use exceptions, but I hate them. They're like setjmp/longjmp calls in C, and they're a really headache to deal with. If you don't use default or predone handlers, you have to put all kinds of try/catch blocks around everything. They make for non-linear execution, and I

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Jochem Maas
Jay Moore schreef: I know it's very OO-y to use exceptions, but I hate them. They're like setjmp/longjmp calls in C, and they're a really headache to deal with. If you don't use default or predone handlers, you have to put all kinds of try/catch blocks around everything. They make for

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Török Alpár
2009/1/21 Jay Moore jaymo...@accu-com.com I know it's very OO-y to use exceptions, but I hate them. They're like setjmp/longjmp calls in C, and they're a really headache to deal with. If you don't use default or predone handlers, you have to put all kinds of try/catch blocks around

Re: Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread ceo
there is an art to using them, they compliment 'traditional' error handling, and I agree they can hinder if used badly. I don't think I've ever seen Exceptions used well... Invariably, I end up having to write a wrapper function around every function implemented and catch all the

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Nathan Rixham
c...@l-i-e.com wrote: there is an art to using them, they compliment 'traditional' error handling, and I agree they can hinder if used badly. I don't think I've ever seen Exceptions used well... Invariably, I end up having to write a wrapper function around every function implemented and

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Paul M Foster
On Wed, Jan 21, 2009 at 10:00:53PM +0100, Jochem Maas wrote: Jay Moore schreef: I know it's very OO-y to use exceptions, but I hate them. They're like setjmp/longjmp calls in C, and they're a really headache to deal with. If you don't use default or predone handlers, you have to put all

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Jochem Maas
Nathan Rixham schreef: c...@l-i-e.com wrote: there is an art to using them, they compliment 'traditional' error handling, and I agree they can hinder if used badly. I don't think I've ever seen Exceptions used well... Invariably, I end up having to write a wrapper function around every

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Chris
Eric Butera wrote: On Wed, Jan 21, 2009 at 12:45 PM, Edmund Hertle edmund.her...@student.kit.edu wrote: 2009/1/21 Jay Moore jaymo...@accu-com.com This is a MySQL class I use and I wanted to get everyone's thoughts on how/if I can improve it. This is for MySQL only. I don't need to make it

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread ceo
I prefer to deal with the issues locally, or have a documented behaviour with return values and error details available, much like most of PHP extensions/internals. try/catch ends up with weird code organization, imho, especially when you can only really handle some exceptions. For real

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Eric Butera
On Wed, Jan 21, 2009 at 5:53 PM, Chris dmag...@gmail.com wrote: Eric Butera wrote: On Wed, Jan 21, 2009 at 12:45 PM, Edmund Hertle edmund.her...@student.kit.edu wrote: 2009/1/21 Jay Moore jaymo...@accu-com.com This is a MySQL class I use and I wanted to get everyone's thoughts on how/if I

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Chris
Yea if you're only targeting 1 db, then why not use that class? At least then there's the php manual to figure out what something does. Because then to add query logging for the whole app, you just need to put it in the class :) (I've done that before to check what's being run and where

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Eric Butera
On Wed, Jan 21, 2009 at 6:09 PM, Chris dmag...@gmail.com wrote: Yea if you're only targeting 1 db, then why not use that class? At least then there's the php manual to figure out what something does. Because then to add query logging for the whole app, you just need to put it in the class

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Jochem Maas
Chris schreef: Yea if you're only targeting 1 db, then why not use that class? At least then there's the php manual to figure out what something does. Because then to add query logging for the whole app, you just need to put it in the class :) (I've done that before to check what's being

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Eric Butera
On Wed, Jan 21, 2009 at 6:37 PM, Jochem Maas joc...@iamjochem.com wrote: Chris schreef: Yea if you're only targeting 1 db, then why not use that class? At least then there's the php manual to figure out what something does. Because then to add query logging for the whole app, you just need

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Ashley Sheridan
On Wed, 2009-01-21 at 18:52 -0500, Eric Butera wrote: On Wed, Jan 21, 2009 at 6:37 PM, Jochem Maas joc...@iamjochem.com wrote: Chris schreef: Yea if you're only targeting 1 db, then why not use that class? At least then there's the php manual to figure out what something does. Because

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Eric Butera
On Wed, Jan 21, 2009 at 7:07 PM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: On Wed, 2009-01-21 at 18:52 -0500, Eric Butera wrote: On Wed, Jan 21, 2009 at 6:37 PM, Jochem Maas joc...@iamjochem.com wrote: Chris schreef: Yea if you're only targeting 1 db, then why not use that class?

[PHP] MySQL client version problem

2009-01-05 Thread Rene Fournier
After following some instructions on compiling PHP 5.2.8 from source ( http://osx.topicdesk.com/content/view/48/62/ ), I notice now that phpinfo() reports that I am running the MySQL client API version 4.1.22 (instead of 5.0.45). Is this something to do with how you compile PHP, or does it

Re: [PHP] MySQL client version problem

2009-01-05 Thread ceo
PHP had a built-in MySQL for awhile as I recall. You had to explicitly use --with-mysql=/usr/local (or wherever you put your mysql headers/libs) to make it choose the one you wanted. Even if it's not using built-in, it may have found an old install of your MySQL rather than your shiny new

Re: [PHP] MySQL client version problem

2009-01-05 Thread Rene Fournier
Thing is, I have MySQL 5.0.67 installed, and I've never had MySQL 4 on this box (Xserve G5, Mac OS X Server 10.4.11). Here's my configure command: ./configure --prefix=/usr/local/php5 --mandir=/usr/share/man -- infodir=/usr/share/info --with-apxs --with-ldap=/usr --with-kerberos=/ usr

Re: [PHP] MySQL client version problem

2009-01-05 Thread ceo
Historically, mysql has been both an external extension, and a built-in part of the source, depending on the version of PHP. Your current experience would indicate that it's only external in 5.2.8, but I cannot confirm nor deny that. How is MySQL installed? If it's rpm, do you have

[PHP] mysql question

2008-12-29 Thread ann kok
Hi all Do you know any websites for mysql question? I do submit the mysql forum but I would like to have more to learn Now I have mysql replication question. Thank you __ Ask a question on any topic and get answers from

Re: [PHP] mysql question

2008-12-29 Thread Phpster
The mysql forum is the best place. Note that their holiday schedule may mean some lag in getting answers. Bastien Sent from my iPod On Dec 29, 2008, at 7:51 AM, ann kok oiyan...@yahoo.ca wrote: Hi all Do you know any websites for mysql question? I do submit the mysql forum but I would

[PHP] Php mysql update

2008-12-29 Thread admin
Okay maybe i have just forgot. I am trying to update the database and do a +1 to a int field without pulling the data and adding 1 to it and sticking it back in. Someone refresh me on this please. I think it is something like. $dwsl = mysql_query(UPDATE database set Field='+1' WHERE

RE: [PHP] Php mysql update

2008-12-29 Thread Gautier Di Folco
Hello, you have to do : $dwsl = mysql_query('UPDATE database SET Field=Field+1 WHERE Criteria=\'Criteria\''); From: ad...@buskirkgraphics.com To: php-general@lists.php.net Date: Mon, 29 Dec 2008 12:05:37 -0500 Subject: [PHP] Php mysql update Okay maybe i have just forgot. I am trying

Re: [PHP] Php mysql update

2008-12-29 Thread John Corry
Wouldn't it be: mysql_query(UPDATE database set Field = Field+1 WHERE Criteria='Criteria'); Note: no '' around +1, = operator John Corry ad...@buskirkgraphics.com wrote: Okay maybe i have just forgot. I am trying to update the database and do a +1 to a int field without pulling the data and

RE: [PHP] Php mysql update

2008-12-29 Thread admin
-0500 Subject: [PHP] Php mysql update Okay maybe i have just forgot. I am trying to update the database and do a +1 to a int field without pulling the data and adding 1 to it and sticking it back in. Someone refresh me on this please. I think it is something like. $dwsl = mysql_query(UPDATE

Re: [PHP] mySQL query question

2008-11-16 Thread Chris
Jim Lucas wrote: [EMAIL PROTECTED] wrote: Ok, so just that I am clear, you are SELECTing and pulling all the data that you are submitting in the above INSERT statement from the DB initially, then you are only modifying the confirm_number value and then re- submitting all the values, as they

Re: [PHP] mySQL query question

2008-11-16 Thread Jim Lucas
Chris wrote: Jim Lucas wrote: [EMAIL PROTECTED] wrote: Ok, so just that I am clear, you are SELECTing and pulling all the data that you are submitting in the above INSERT statement from the DB initially, then you are only modifying the confirm_number value and then re- submitting all the

Re: [PHP] mySQL query question

2008-11-15 Thread Jim Lucas
Michael S. Dunsavage wrote: On Fri, 2008-11-14 at 12:46 -0800, Jim Lucas wrote: SELECT @confirm_number AS confirm_number; Are we not SELECTING the column value here? should we be selecting confirm_number as confirm_number? The idea is to give you the number that was used in the INSERT

Re: [PHP] mySQL query question

2008-11-14 Thread Michael S. Dunsavage
On Fri, 2008-11-14 at 08:46 +0100, Jochem Maas wrote: 1000 + 1 != 10001 you might consider setting a default of 1000 or 1 or whatever on the given field so it's automatically populated with that number when a contact record is created. Sorry. Hit the 0 one to few times. -- Michael S.

Re: [PHP] mySQL query question

2008-11-14 Thread Thodoris
okay I want to pull an integer from a database called confirm_number, add 1 and repost it back to the database here's the code I'm using. $queryconfirm=SELECT confirm_number from contacts ORDER BY contact DESC LIMIT 1; I assume that you are already aware that if you set the variable

Re: [PHP] mySQL query question

2008-11-14 Thread Martijn Korse
I would create a separate table for this (confirmation_numbers or something) with an autoincrement primary key. That way you can simply insert a new record for you contact and then ask (using mysql_insert_id()) what the confirmation number is. This approach is much safer as you can be 100% sure

[PHP] mySQL query question

2008-11-14 Thread ceo
okay I want to pull an integer from a database called confirm_number, add 1 and repost it back to the database No, you don't want to do that. :-) You are introducing a race condition between TWO users who hit the same page at the same time. They each get, say, 42, and they each put

Re: [PHP] mySQL query question

2008-11-14 Thread Bastien Koert
On Fri, Nov 14, 2008 at 9:58 AM, [EMAIL PROTECTED] wrote: okay I want to pull an integer from a database called confirm_number, add 1 and repost it back to the database No, you don't want to do that. :-) You are introducing a race condition between TWO users who hit the same page at

Re: [PHP] mySQL query question

2008-11-14 Thread mikesd1
update contacts set confirm_number = confirm_number + 1 order by contact desc limit 1 Here is the php query I've been using to send the record in the first place $query=INSERT INTO contacts (first_name, last_name, email, phn_number, address, city, state, zip, dates, comments, confirm_number)

Re: [PHP] mySQL query question

2008-11-14 Thread Jim Lucas
[EMAIL PROTECTED] wrote: update contacts set confirm_number = confirm_number + 1 order by contact desc limit 1 Here is the php query I've been using to send the record in the first place $query=INSERT INTO contacts (first_name, last_name, email, phn_number, address, city, state, zip,

Re: [PHP] mySQL query question

2008-11-14 Thread Bastien Koert
On Fri, Nov 14, 2008 at 1:22 PM, [EMAIL PROTECTED] wrote: update contacts set confirm_number = confirm_number + 1 order by contact desc limit 1 Here is the php query I've been using to send the record in the first place $query=INSERT INTO contacts (first_name, last_name, email,

<    1   2   3   4   5   6   7   8   9   10   >