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

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

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 ...

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

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] 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

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?

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

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

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

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,

Re: [PHP] mySQL query question

2008-11-14 Thread mikesd1
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 originally were, Well, actually when all is

Re: [PHP] mySQL query question

2008-11-14 Thread Jim Lucas
[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 originally were,

Re: [PHP] mySQL query question

2008-11-14 Thread Jim Lucas
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

Re: [PHP] mySQL query question

2008-11-14 Thread Michael S. Dunsavage
On Fri, 2008-11-14 at 13:31 -0800, Jim Lucas wrote: '{$Comments}', @confirm_number ) The above should be this instead @confirm_number ); Even after fixing that, nothing gets inserted into the database. I've been all

Re: [PHP] mySQL query question

2008-11-14 Thread Jim Lucas
Michael S. Dunsavage wrote: On Fri, 2008-11-14 at 13:31 -0800, Jim Lucas wrote: '{$Comments}', @confirm_number ) The above should be this instead @confirm_number ); Even after fixing that, nothing gets inserted into the

Re: [PHP] mySQL query question

2008-11-14 Thread Jim Lucas
Jim Lucas wrote: Michael S. Dunsavage wrote: On Fri, 2008-11-14 at 13:31 -0800, Jim Lucas wrote: '{$Comments}', @confirm_number ) The above should be this instead @confirm_number ); Even after fixing that, nothing gets

Re: [PHP] mySQL query question

2008-11-14 Thread Michael S. Dunsavage
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? -- Michael S. Dunsavage -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

Re: [PHP] mySQL query question

2008-11-13 Thread Micah Gersten
If you're just adding one, there is no reason to retrieve the data, process it, and update it. You can just update the number. http://dev.mysql.com/doc/refman/5.0/en/update.html Also, you should read the MySQL manual on default values:

Re: [PHP] mySQL query question

2008-11-13 Thread Michael S. Dunsavage
On Fri, 2008-11-14 at 00:52 -0600, Micah Gersten wrote: If you're just adding one, there is no reason to retrieve the data, process it, and update it. You can just update the number. http://dev.mysql.com/doc/refman/5.0/en/update.html But, the problem is that the confirm_number is a

Re: [PHP] mySQL query question

2008-11-13 Thread Jochem Maas
Michael S. Dunsavage schreef: 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; $confirmresult=$queryconfirm;

[PHP] Re: PHP/mySQL question using ORDER BY with logic

2008-10-26 Thread Carlos Medina
Rob Gould schrieb: Question about mySQL and PHP, when using the mySQL ORDER BY method... Basically I've got data coming from the database where a wine producer-name is a word like: Château Bahans Haut-Brion or La Chapelle de La Mission Haut-Brion or Le Clarence

[PHP] Re: PHP/mySQL question using ORDER BY with logic

2008-10-24 Thread Colin Guthrie
Robert Cummings wrote: On Fri, 2008-10-24 at 00:18 -0400, Rob Gould wrote: Question about mySQL and PHP, when using the mySQL ORDER BY method... Basically I've got data coming from the database where a wine producer-name is a word like: Château Bahans Haut-Brion or

Re: [PHP] Mysql search

2008-10-23 Thread tedd
At 11:16 PM -0700 10/21/08, Ryan S wrote: clipp Am hoping someone out there can recommend a better script or maybe share some of your own code? Any help would be appreciated. Do it right... read up on MySQL's fulltext matching. Cheers, Rob. /clipp Did some searching based on your tip,

Re: [PHP] Mysql search

2008-10-22 Thread Ryan S
clipp Am hoping someone out there can recommend a better script or maybe share some of your own code? Any help would be appreciated. Do it right... read up on MySQL's fulltext matching. Cheers, Rob. /clipp Did some searching based on your tip, got what i was looking for, just didnt

Re: [PHP] Mysql search

2008-10-21 Thread Robert Cummings
On Tue, 2008-10-21 at 21:48 -0700, Ryan S wrote: Hey all, I have two columns in my DB title varchar(254) and jtext text which I would like to search, as the user might enter two or more words I am opting not to use LIKE %search_term% so started searching google, I came across this

Re: [PHP] MYSQL insert problems

2008-10-17 Thread chris smith
On Sat, Oct 18, 2008 at 3:22 AM, Frank Stanovcak [EMAIL PROTECTED] wrote: I'm using the following code to try and do a simple insert query. However it won't insert the data into the table, and I get no error messages. What have I done wrong this time? You will be getting an error. echo

Re: [PHP] MySQL Workbench coming for Linux

2008-09-16 Thread Jochem Maas
Ross McKay schreef: Posting this here, because a few people responded when I mentioned not having a Linux-native data modelling tool. Apparently, MySQL Workbench should be alpha-ready by end of the month... http://dev.mysql.com/workbench/?p=138 no news of MacOSX, what's the chance this will

[PHP] Re: PHP-MYSQL Error: Can't connect to MySQL socket. Can someone helpme out please?

2008-05-10 Thread Rahul
By the way it installed MySQL 6 and PHP 5.0.4 and from the console this command does not work: mysql -u root -p but only this works: mysql -h hostname -u root -p I tried doing the same while connecting to the database via php but it does not work. Rahul wrote: I am using Fedora Core 4. As

Re: [PHP] mysql query and maximum characters in sql statement

2008-05-08 Thread Sanjeev N
Hi Jim Lucas, You are correct... i want to run in the same way. but as my 2 tables, column name are different i cant run the LOAD DATA infile. And the example you mentioned for break at 100, also i thought to use in that way. but one of the column had the text type which we cant predict about

Re: [PHP] mysql query and maximum characters in sql statement

2008-05-08 Thread Chris
Sanjeev N wrote: Hi Jim Lucas, You are correct... i want to run in the same way. but as my 2 tables, column name are different i cant run the LOAD DATA infile. If you're inserting the same data, then use LOAD DATA INFILE to load it into a temporary table, then use INSERT SELECT's to put

Re: [PHP] mysql query and maximum characters in sql statement

2008-05-02 Thread Jim Lucas
Waynn Lue wrote: Wouldn't using LOAD DATA INFILE be better than writing your own script? depends, does the data file match the table column for column? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] mysql query and maximum characters in sql statement

2008-05-02 Thread Chris
Jim Lucas wrote: Waynn Lue wrote: Wouldn't using LOAD DATA INFILE be better than writing your own script? depends, does the data file match the table column for column? Doesn't have to. http://dev.mysql.com/doc/refman/5.0/en/load-data.html By default, when no column list is provided at

Re: [PHP] mysql query and maximum characters in sql statement

2008-05-01 Thread Wolf
Sanjeev N [EMAIL PROTECTED] wrote: Hi, I have written a program which imports the tab delimited file and insert all the line from file to the mysql line by line. I am succeding in the above case. but problem with the above method is its taking to too much time while inserting into the

Re: [PHP] mysql query and maximum characters in sql statement

2008-05-01 Thread Jim Lucas
Sanjeev N wrote: Hi, I have written a program which imports the tab delimited file and insert all the line from file to the mysql line by line. I am succeding in the above case. but problem with the above method is its taking to too much time while inserting into the database. The file's size

Re: [PHP] mysql query and maximum characters in sql statement

2008-05-01 Thread Jim Lucas
Jim Lucas wrote: Sanjeev N wrote: Hi, I have written a program which imports the tab delimited file and insert all the line from file to the mysql line by line. I am succeding in the above case. but problem with the above method is its taking to too much time while inserting into the

Re: [PHP] mysql query and maximum characters in sql statement

2008-05-01 Thread Waynn Lue
Wouldn't using LOAD DATA INFILE be better than writing your own script? On 5/1/08, Jim Lucas [EMAIL PROTECTED] wrote: Jim Lucas wrote: Sanjeev N wrote: Hi, I have written a program which imports the tab delimited file and insert all the line from file to the mysql line by line. I

Re: [PHP] mysql joins

2008-03-25 Thread Andrew Ballard
On Tue, Mar 25, 2008 at 8:20 AM, Steven Macintyre [EMAIL PROTECTED] wrote: I have three tables, namely; User - UID - Firstname - Surname - Tel - Cell - Email Tracker - UID - Points Winners - UID - Datetime (-00-00 00:00:00) I need to get the following

Re: [PHP] mysql joins

2008-03-25 Thread Wolf
Steven Macintyre [EMAIL PROTECTED] wrote: I have three tables, namely; User - UID - Firstname - Surname - Tel - Cell - Email Tracker - UID - Points Winners - UID - Datetime (-00-00 00:00:00) I need to get the following information from the above tables (in my

Re: [PHP] mysql test and error

2008-02-25 Thread Daniel Brown
On Sun, Feb 24, 2008 at 5:00 PM, hE [EMAIL PROTECTED] wrote: The following program gave the error: Parse error: parse error in C:\apache\htdocs\mysqltest.php on line 10 Look at this part of the code: $result = mysql_query($sql); if ($result == 0) echo 'bError ' . mysql_errno() . ': '.

Re: [PHP] Mysql vs. Mysqli crash handling

2008-02-25 Thread Daniel Brown
On Mon, Feb 25, 2008 at 3:07 PM, Larry Garfield [EMAIL PROTECTED] wrote: Hi folks. I've an odd issue. Only fair. You're an odd bird, and we're an odd bunch. ;-P If I connect to a MySQL DB using ext/mysql, and for whatever reason the process dies (uncaught exception, fatal error,

Re: [PHP] Mysql vs. Mysqli crash handling

2008-02-25 Thread Larry Garfield
On Monday 25 February 2008, Daniel Brown wrote: On Mon, Feb 25, 2008 at 3:07 PM, Larry Garfield [EMAIL PROTECTED] wrote: Hi folks. I've an odd issue. Only fair. You're an odd bird, and we're an odd bunch. ;-P If I connect to a MySQL DB using ext/mysql, and for whatever reason the

Re: [PHP] mysql test and error

2008-02-24 Thread Brady Mitchell
On Feb 24, 2008, at 1135AM, hE wrote: hi, I found an e-book in the net about php and mysql and with its sample program I am trying to test whether I have mysql working correctly or not. the following program gives error message. why? What exactly does the error message say? We can help

Re: [PHP] mysql test and error

2008-02-24 Thread hE
The following program gave the error: Parse error: parse error in C:\apache\htdocs\mysqltest.php on line 10 html headtitleTest MySQL/title/head body !-- mysql_up.php -- ?php $host=”localhost”; $user=”root”; $password=””; mysql_connect($host,$user,$password); $sql=”show status”; $result =

Re: [PHP] mysql test and error

2008-02-24 Thread Brady Mitchell
On Feb 24, 2008, at 200PM, hE wrote: The following program gave the error: Parse error: parse error in C:\apache\htdocs\mysqltest.php on line 10 Did you copy/paste the code? If so maybe the quotation marks are the fancy smart quotes like MS Office likes to use. Try replacing your

RE: [PHP] mysql input

2008-02-19 Thread Bastien Koert
I agree, but they all provide some level of handling just might not be the 'most correct' way of handling it bastien Subject: RE: [PHP] mysql input From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] CC: [EMAIL PROTECTED]; php-general@lists.php.net Date: Mon, 18 Feb 2008 23:31:21 -0500 On Mon

Re: [PHP] mysql input

2008-02-19 Thread Richard Lynch
On Mon, February 18, 2008 10:05 pm, nihilism machine wrote: I have a user saving a VARCHAR(255) field in a mysql db which has single quotes in the text, how can i replace them so that they dont fuck up my mysql command? http://php.net/mysql_real_escape_string Google for SQL injection for

RE: [PHP] mysql input

2008-02-19 Thread Richard Lynch
On Mon, February 18, 2008 10:19 pm, Bastien Koert wrote: mysql_real_escape_string() Yes. addslashes() No, not right for different charsets. See above. htmlentities() Completely and wildly inappropriate. Might as well use a cannon to slice a tomato. -- Some people have a gift link here.

Re: [PHP] MySQL Stored Procedures

2008-02-19 Thread Chris
my only wish was that more people wrote more articles about the proper structure. You mean like the example on the mysql website? http://dev.mysql.com/doc/refman/5.0/en/stored-procedures.html -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List

Re: [PHP] mysql input

2008-02-18 Thread Robert Cummings
On Mon, 2008-02-18 at 23:05 -0500, nihilism machine wrote: I have a user saving a VARCHAR(255) field in a mysql db which has single quotes in the text, how can i replace them so that they dont fuck up my mysql command? mysql_real_escape_string() Cheers, Rob. --

RE: [PHP] mysql input

2008-02-18 Thread Robert Cummings
On Mon, 2008-02-18 at 23:19 -0500, Bastien Koert wrote: mysql_real_escape_string() addslashes() htmlentities() take your pick That's a bad answer. If he's using MySQL then he SHOULD use mysql_real_escape_string(). None of the other functions will fully protect him from malicious input.

RE: [PHP] mysql input

2008-02-18 Thread Bastien Koert
mysql_real_escape_string() addslashes() htmlentities() take your pick bastien From: [EMAIL PROTECTED] To: php-general@lists.php.net Date: Mon, 18 Feb 2008 23:05:10 -0500 Subject: [PHP] mysql input I have a user saving a VARCHAR(255) field in a mysql db which has single quotes in the

Re: [PHP] mysql question

2008-02-14 Thread Richard Lynch
On Sun, February 10, 2008 11:52 am, Per Jessen wrote: nihilism machine wrote: $ret = mysql_result($r, 0); mysql_free_result($r); if ($this-auto_slashes) return stripslashes($ret); else return $ret; } what is $ret, an array? No, it's a mysql result object. No, it's a single field

Re: [PHP] mysql question #2

2008-02-14 Thread Richard Heyes
At any rate, just seeing this tells me that you've got a real mess on your hands... Or you could say, You're going to have some fun cleaning that. -- Richard Heyes http://www.websupportsolutions.co.uk Knowledge Base and Helpdesk software hosted for you - no installation, no maintenance, new

Re: [PHP] mysql question #2

2008-02-14 Thread Richard Lynch
On Sun, February 10, 2008 12:12 pm, nihilism machine wrote: public function select_one($sql) { if ($this-auto_slashes) { return stripslashes($ret); If you have to call stripslashes() on data coming FROM MySQL, then you have really messed up... You've

Re: [PHP] mysql question

2008-02-11 Thread Daniel Brown
On Feb 10, 2008 1:03 PM, Per Jessen [EMAIL PROTECTED] wrote: Yep, you're right - I read mysql_query where the OP said mysql_result. Don't feel bad. I did the exact same thing when I was reading over the post just now. -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--;

Re: [PHP] mysql question

2008-02-10 Thread Nathan Nobbe
On Feb 10, 2008 12:52 PM, Per Jessen [EMAIL PROTECTED] wrote: nihilism machine wrote: $ret = mysql_result($r, 0); mysql_free_result($r); if ($this-auto_slashes) return stripslashes($ret); else return $ret; } what is $ret, an array? No, it's a mysql result object. no, its the

Re: [PHP] mysql question

2008-02-10 Thread Per Jessen
nihilism machine wrote: $ret = mysql_result($r, 0); mysql_free_result($r); if ($this-auto_slashes) return stripslashes($ret); else return $ret; } what is $ret, an array? No, it's a mysql result object. if so how can i access the individual rows in it? Look up mysql_fetch_assoc().

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