Re: [PHP-DB] Re: [PHP-WIN] Re: Error while inserting data into mysql

2011-03-01 Thread Geoff Lane
On Tuesday, March 1, 2011, Richard Quadling wrote; > Can you tell me what column in the table is scloth100_qty? I can't find it. The issue here is probably that you have some PHP code that is passing a SELECT statement to MySQL and that SELECT includes scloth100_qty in its column list. One debugg

Re: [PHP-DB] Error while inserting data into mysql

2011-03-01 Thread Richard Quadling
On 1 March 2011 10:25, nagendra prasad wrote: > Hi All, > > I have 2 simple php pages. One with the form just like some sales voucher. > Another is to print in a proper format and to insert the form database into > mysql. When I enter some data in the sales voucher everything is going well, > howe

Re: [PHP-DB] CSV to MyDB

2011-02-25 Thread Karl DeSaulniers
I see. Thank you for that and thank you for the link. Best, Karl Sent from losPhone On Feb 25, 2011, at 10:57 AM, "Adriano Rodrigo Guerreiro Laranjeira" > wrote: Hey friend! You can create a DB table with the same structure of your CSV and store it like a normal table, using the mysqlimpo

Re: [PHP-DB] CSV to MyDB

2011-02-25 Thread Adriano Rodrigo Guerreiro Laranjeira
Hey friend! You can create a DB table with the same structure of your CSV and store it like a normal table, using the mysqlimport command: http://dev.mysql.com/doc/refman/5.5/en/mysqlimport.html In this way, you can do SELECT's and all DML commands. If you want to store the file as you receiv

Re: [PHP-DB] Cant Get Data

2011-02-22 Thread Amit Tandon
Dear Gary $_SESSION variable would be available only if you have session_start() at the top of the page. For $_POST, i presume u hve method POST defined for the form element regds amit "The difference between fiction and reality? Fiction has to make sense." On Mon, Feb 21, 2011 at

Re: [PHP-DB] Submitting data to MySQL database using HTML/PHP form

2011-02-21 Thread Nazish Zafar
Thanks! Even with the typo, the issue was resolved with your helpful comments! Thanks also for the pointer on using mysql_real_escape to 'sanitize' the user input, it's definitely become a part of my coding. On Mon, Feb 21, 2011 at 8:22 AM, Daniel Brown wrote: > On Sun, Feb 20, 2011 at 16:43,

Re: [PHP-DB] Submitting data to MySQL database using HTML/PHP form

2011-02-21 Thread Daniel Brown
On Sun, Feb 20, 2011 at 16:43, Donovan Brooke wrote: >> >>         $insert = "INSERT INTO user_info(login,password) >> >> VALUES('".mysql_real_escape_string($login)."',"'.mysql_real_escape_string($password)."')"; > > > Look at that one more time Dan. ;-) Yeah, well, that's why one should neve

Re: [PHP-DB] Submitting data to MySQL database using HTML/PHP form

2011-02-20 Thread Donovan Brooke
Daniel Brown wrote: On Sun, Feb 20, 2011 at 14:11, Nazish Zafar wrote: $insert = "INSERT INTO user_info (login, password) VALUES ("$login", "$password"); You're using double-quotes to encapsulate your $insert variable data, then never closing them. What's more, you're also using double

Re: [PHP-DB] Submitting data to MySQL database using HTML/PHP form

2011-02-20 Thread Daniel Brown
On Sun, Feb 20, 2011 at 14:11, Nazish Zafar wrote: > > $insert = "INSERT INTO user_info > (login, password) > VALUES > ("$login", "$password"); You're using double-quotes to encapsulate your $insert variable data, then never closing them. What's more, you're also using double-quotes to encap

Re: [PHP-DB] Displaying Results

2011-02-15 Thread Donovan Brooke
Ethan Rosenberg wrote: Dear List - I have a form. In one field, the customer types the name of a product. The first seven(7) results of the MySQL query that the entry generates should be displayed as a clickable drop down list. How do I do it? Thanks. Ethan MySQL 5.1 PHP 5.3.3-6 Linux [Debia

Re: [PHP-DB] Doctrine or another recomended ORM?

2011-02-03 Thread Miriam Natanzon
Hi, At the beginning I also think about Doctrine, BUT- I really don't like the way it uses comments for type declaration.I think this is a miss use of comments. miriam On Tue, Feb 1, 2011 at 8:41 PM, Ruwan Geeganage wrote: > Hi Natanzon, > > Doctrine is good. > check this post also > http://ww

Re: [PHP-DB] Doctrine or another recomended ORM?

2011-02-01 Thread Ruwan Geeganage
Hi Natanzon, Doctrine is good. check this post also http://www.geeganage.com/symfony-doctrine-emory-usage/ Propel is also good, but I think Doctrine is better. Thanks. On Tue, Feb 1, 2011 at 10:08 PM, Philip Thompson wrote: > http://cakeph

Re: [PHP-DB] Doctrine or another recomended ORM?

2011-02-01 Thread Philip Thompson
http://cakephp.org/ On Jan 16, 2011, at 6:02 AM, Miriam Natanzon wrote: > Hi, > > I want to choose an open-source ORM platform to use as a base for many > different applications as a standard environment in my organization. ( we > used DBI for PERL in the past). > I saw and read about Doctrine

Re: [PHP-DB] Leap Year

2011-01-31 Thread Bastien Koert
On Mon, Jan 31, 2011 at 8:06 AM, Ron Piggott wrote: > > Does mySQL have the ability to figure out if it is leap year?  If so, what is > the correct syntax for: > > AND `day` <> 366 "unless it is leap year" > Ron > > The Verse of the Day > “Encouragement from God’s Word” > http://www.TheVerseOfThe

Re: [PHP-DB] RSS Feed

2011-01-30 Thread Ron Piggott
tp://www.TheVerseOfTheDay.info -Original Message- From: Bastien Koert Sent: Sunday, January 30, 2011 4:10 PM To: Ron Piggott Cc: php-db@lists.php.net Subject: Re: [PHP-DB] RSS Feed On Sun, Jan 30, 2011 at 2:27 PM, Ron Piggott wrote: I have a question about the mySQL query below. T

Re: [PHP-DB] RSS Feed

2011-01-30 Thread Bastien Koert
On Sun, Jan 30, 2011 at 2:27 PM, Ron Piggott wrote: > > I have a question about the mySQL query below.  The purpose is to find the > last 15 days Bible reading for an RSS feed. > > In the table each day’s reading is assigned the day # in the year (between 1 > and 365).  But if the query is ran o

Re: [PHP-DB] stripslashes ( encodings to from MySQL )

2011-01-28 Thread Donovan Brooke
Sorry, should have done some simple testing!.. It appears that stripslashes is smarter than simply stripping all "/". So, my apologies for interrupting the class! ;-) Donovan -- D Brooke -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] 2nd Pair of eyes please

2011-01-27 Thread juju buddy
Good god, I'm just a beginning php programmer and my head already aches reading everyone's problems! lol. Great to see there are people out there who care and will help if need be!! On 27 January 2011 17:10, Donovan Brooke wrote: > Hello, > to respond to some of the comments/questions.. > > No,

Re: [PHP-DB] 2nd Pair of eyes please

2011-01-27 Thread Donovan Brooke
Hello, to respond to some of the comments/questions.. No, it wasn't parsing anything... and yes, I put ini_set('display_errors', 1); error_reporting(E_ALL | E_STRICT); at the top of the page. (as well as there is a custom built PHP management app that allows to turn on the display_errors.. whi

Re: [PHP-DB] 2nd Pair of eyes please

2011-01-27 Thread Karl DeSaulniers
On Jan 27, 2011, at 4:00 AM, Richard Quadling wrote: On 26 January 2011 23:52, Donovan Brooke wrote: [snip] print = ""; ^ Never mind, found it. :-/ Donovan -- D Brooke -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Cons

Re: [PHP-DB] 2nd Pair of eyes please

2011-01-27 Thread Richard Quadling
On 26 January 2011 23:52, Donovan Brooke wrote: > [snip] >> >> print = ""; > >        ^ > Never mind, found it. :-/ > > Donovan > > > -- > D Brooke > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > Considering that the error is a pa

Re: [PHP-DB] 2nd Pair of eyes please

2011-01-26 Thread Donovan Brooke
[snip] print = ""; ^ Never mind, found it. :-/ Donovan -- D Brooke -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP-DB] 2nd Pair of eyes please

2011-01-26 Thread Daevid Vincent
> -Original Message- > From: Donovan Brooke [mailto:li...@euca.us] > Sent: Wednesday, January 26, 2011 2:35 PM > To: php-db@lists.php.net > Subject: [PHP-DB] 2nd Pair of eyes please > > O.K., I give up.. I can't seem to find why this breaks the page to > a point where nothing gets disp

Re: [PHP-DB] bool type (between MySQL and PHP)

2011-01-25 Thread Donovan Brooke
Daniel Brown wrote: On Tue, Jan 25, 2011 at 17:40, Donovan Brooke wrote: Thanks Dan, I think the error would still persist using DEFAULT.. because as mentioned, I don't think MySQL likes: UPDATE tablename SET vbool= ..which is not great news for me since I'd like to avoid having to redo all

Re: [PHP-DB] bool type (between MySQL and PHP)

2011-01-25 Thread Daniel Brown
On Tue, Jan 25, 2011 at 17:40, Donovan Brooke wrote: > > Thanks Dan, > > I think the error would still persist using DEFAULT.. because as mentioned, > I don't think MySQL likes: > > UPDATE tablename SET vbool= > > ..which is not great news for me since I'd like to avoid having to redo > all my boo

Re: [PHP-DB] bool type (between MySQL and PHP)

2011-01-25 Thread Donovan Brooke
Daniel Brown wrote: On Tue, Jan 25, 2011 at 17:05, Donovan Brooke wrote: What is the best PHP practice when using bools with MySQL? Save 1's and 0's instead of true/false? You could either do an INT(1) DEFAULT 0 or an ENUM('Y','N') to make it easier on yourself. Thanks Dan, I think

Re: [PHP-DB] bool type (between MySQL and PHP)

2011-01-25 Thread Daniel Brown
On Tue, Jan 25, 2011 at 17:05, Donovan Brooke wrote: > > What is the best PHP practice when using bools with > MySQL? Save 1's and 0's instead of true/false? You could either do an INT(1) DEFAULT 0 or an ENUM('Y','N') to make it easier on yourself. -- Network Infrastructure Manager Documen

Re: [PHP-DB] Re: Getting Results

2011-01-21 Thread Richard Quadling
On 21 January 2011 12:39, Karl DeSaulniers wrote: > Very informative, > Thank you Richard. > > I will have to flag this one and come back to it. > My database structure may require something of this measure down the line > with the auditing ability I plan on building into the admin section. > > Ne

Re: [PHP-DB] Re: Getting Results

2011-01-21 Thread Karl DeSaulniers
Very informative, Thank you Richard. I will have to flag this one and come back to it. My database structure may require something of this measure down the line with the auditing ability I plan on building into the admin section. Never heard of USE AdventureWorks. Is that a SQL system functio

Re: [PHP-DB] Re: Getting Results

2011-01-21 Thread Karl DeSaulniers
Ahh yes, I remember that now. Thank you. Karl On Jan 21, 2011, at 6:17 AM, Richard Quadling wrote: On 21 January 2011 11:58, Karl DeSaulniers wrote: So to do descending order I'd put DES or DEC? Just curious about that one. ASC and DESC -- Richard Quadling Twitter : EE : Zend @RQuadli

Re: [PHP-DB] Re: Getting Results

2011-01-21 Thread Richard Quadling
On 21 January 2011 11:58, Karl DeSaulniers wrote: > So to do descending order I'd put DES or DEC? Just curious about that one. ASC and DESC -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY -- PHP Database Mailing List (http://www.php.net/) To unsubsc

Re: [PHP-DB] Re: Getting Results

2011-01-21 Thread Richard Quadling
On 21 January 2011 11:58, Karl DeSaulniers wrote: > I did not know you could do a SELECT inside a SELECT. Commonly known as a "sub select". You can use them like ... SELECT columns FROM ( SELECT columns FROM table) WHERE column IN (SELECT column FROM table) As part of a FROM or as part of a WH

Re: [PHP-DB] Getting Results

2011-01-20 Thread Karl DeSaulniers
Hi Robbyka, ."USERS." and ."VIP." are constant variables used to hide the actual names of the tables for security reasons. Those variables will have content. Not sure what you mean by "semi locon like => from ".users";" The user names are set up to be unique. No two user names can be identi

Re: [PHP-DB] Getting Results

2011-01-20 Thread Karl DeSaulniers
Thanks Robbyka, The username would be what your referring to with the .idvip So.. "select username, userlevel,email, timestamp from ".USERS.", ".VIP." where ".VIP.".username=".USERS.".username; yes? Karl On Jan 20, 2011, at 7:24 PM, Robbyka Gheo wrote: i think its wrong, try this script?

Re: [PHP-DB] Configuring PHP with GD and JPEG support

2011-01-16 Thread Karl DeSaulniers
11 17:10:35 -0600 To: php-db@lists.php.net Subject: Re: [PHP-DB] Configuring PHP with GD and JPEG support On Jan 10, 2011, at 9:35 AM, mike dorian wrote: Hello, Questions with regards to compiling PHP to support GD with JPEG on 64-bit CentOS 5.5. 1) Specifying folder for jpeg library When I execute

RE: [PHP-DB] Configuring PHP with GD and JPEG support

2011-01-15 Thread mike dorian
Just tried it with the following but still fails. All I'm getting is a blank page. > From: k...@designdrumm.com > Date: Mon, 10 Jan 2011 17:10:35 -0600 > To: php-db@lists.php.net > Subject: Re: [PHP-DB] Configuring PHP with GD and JPEG support > > > On Jan 10, 201

Re: [PHP-DB] Connecting to MySQL

2011-01-15 Thread Kranthi Krishna
note that you'll have to restart apache after any changes to httpd.conf/php.ini in your case httpd.conf was changed when u installed PDO Kranthi. http://goo.gl/e6t3 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP-DB] Connecting to MySQL

2011-01-15 Thread Cristiano Di Buduo
Resolved itself, just had to reboot. Works fine now. Thanks anyway :) > From: cristiano_di_bu...@hotmail.com > To: phps...@gmail.com > Subject: RE: [PHP-DB] Connecting to MySQL > Date: Fri, 14 Jan 2011 21:58:33 +0100 > > > It o

Re: [PHP-DB] Oracle PDO UTF-8 problem

2011-01-14 Thread Christopher Jones
Glad you resolved it. Overall, I have to recommend the OCI8 extension over the unmaintained (like much of PDO) PDO_OCI extension. Chris On 01/13/2011 11:36 PM, Karsten Lehmann wrote: I found out that the error depends on the wrong character set of the Oracle Database. In my case this was a W

Re: [PHP-DB] Connecting to MySQL

2011-01-14 Thread Bastien Koert
On Fri, Jan 14, 2011 at 2:15 PM, Cristiano Di Buduo wrote: > > I just downloaded both PHP and MySQL, both newest stable versions, both are > working well, but when i try{} to : > >     $dbh = new PDO('mysql:host=localhost;dbname=test', "user", "passwd"); > > i catch{} a "could not find driver" er

Re: [PHP-DB] Oracle PDO UTF-8 problem

2011-01-13 Thread Karsten Lehmann
I found out that the error depends on the wrong character set of the Oracle Database. In my case this was a Western Europ instance of the Database. The same data on a UTF8 instance was displayed as excpected. Am 13.01.2011 10:42, schrieb Karsten Lehmann: Doesn't work. I got the following erro

RE: [PHP-DB] Query syntax error?

2011-01-13 Thread Harvey
Thanks, I got it working now, had to use the a/b/c thing a few times -Original Message- From: jose [mailto:jojap...@gmail.com] Sent: Thursday, January 13, 2011 9:52 AM Cc: php-db@lists.php.net Subject: Re: [PHP-DB] Query syntax error? you have renamed places_data table to 'a

Re: [PHP-DB] Query syntax error?

2011-01-13 Thread jose
you have renamed places_data table to 'a' 2011/1/13 Harvey : > Hello, > > I have a query on a page that used to work fine, but is now generating an > error. > > I assume that the version of php or mysql was updated on the webhost server > or something like that? > > Here is the query: > > select c

Re: [PHP-DB] Oracle PDO UTF-8 problem

2011-01-13 Thread Karsten Lehmann
Doesn't work. I got the following error after i set the parameter in the PDO construct Fatal error: Undefined class constant 'MYSQL_ATTR_MAX_BUFFER_SIZE' IMHO this is only a MYSQL parameter but i worked with oracle. Am 13.01.2011 10:27, schrieb kesavan trichy rengarajan: Try increasing this:

Re: [PHP-DB] Oracle PDO UTF-8 problem

2011-01-13 Thread kesavan trichy rengarajan
Try increasing this: PDO::MYSQL_ATTR_MAX_BUFFER_SIZE More info here: http://php.net/manual/en/ref.pdo-mysql.php On Thu, Jan 13, 2011 at 7:23 PM, Karsten Lehmann wrote: > Hello > > I try to read a 2000 character long string out of database. The database is > an oracle 10g Express Edition with UTF

Re: [PHP-DB] Connecting PHP to MySQL on Windows - RESOLVED

2011-01-10 Thread michael manning
Hi, Thanks to everyone who assisted me. Removing the line: ::1 localhost from the c:\windows\system32\drivers\etc\hosts file did the trick and allowed me to access MySQL databases without any problems. I confirmed this was the correct solution by re-adding the line and seeing it fail again,

Re: [PHP-DB] Configuring PHP with GD and JPEG support

2011-01-10 Thread Karl DeSaulniers
On Jan 10, 2011, at 9:35 AM, mike dorian wrote: Hello, Questions with regards to compiling PHP to support GD with JPEG on 64-bit CentOS 5.5. 1) Specifying folder for jpeg library When I execute the following command, am I saying the full path to libdir is at /usr/source/lib64? ./configu

Re: [PHP-DB] Can't find sqlite_open

2011-01-08 Thread Niel Archer
> Hello, > I have a script that is calling sqlite_open, however, sqlite_open can't be > found on my systems. I'm running RHEL5 and I get the following relevant > output from php -i: > > PDO support => enabled > PDO drivers => odbc, sqlite > > pdo_sqlite > > PDO Driver for SQLite 3.x => enabled

Re: [PHP-DB] Connecting PHP to MySQL on Windows

2011-01-07 Thread Daniel Brown
On Fri, Jan 7, 2011 at 15:06, Gavin Chalkley wrote: > Mike, > > A plain HOST file should have the commented part at the top, and only 1 > reference to localhost unless you are creating Virtual hosts. > > I would suggest removing the "::1" line As long as he never plans to use IPv6 on there, t

Re: [PHP-DB] Connecting PHP to MySQL on Windows

2011-01-07 Thread Gavin Chalkley
Mike, A plain HOST file should have the commented part at the top, and only 1 reference to localhost unless you are creating Virtual hosts. I would suggest removing the "::1" line BR Gavin On Fri, Jan 7, 2011 at 4:18 AM, michael manning wrote: > Hi, > > I swapped out 'localhost" for '127.0.0.

Re: [PHP-DB] combining the results of mysql query and finding the unique tuples in php

2011-01-07 Thread Bastien Koert
On Fri, Jan 7, 2011 at 9:46 AM, Toby Hart Dyke wrote: > On 1/7/2011 12:10 AM, Fahim M wrote: >> >> Hi >> I have a certain number of mysql tables(relation), say 50, some of them >> having 5 fields and some with 6 fields. a particular search item may be >> found in multiple tables with multiple rows

Re: [PHP-DB] combining the results of mysql query and finding the unique tuples in php

2011-01-07 Thread Toby Hart Dyke
On 1/7/2011 12:10 AM, Fahim M wrote: Hi I have a certain number of mysql tables(relation), say 50, some of them having 5 fields and some with 6 fields. a particular search item may be found in multiple tables with multiple rows. I am using a loop to find all those. My problem is I want to first c

Re: [PHP-DB] Connecting PHP to MySQL on Windows

2011-01-06 Thread michael manning
Hi, I swapped out 'localhost" for '127.0.0.1' in the url but this had no effect. I had a look at my hosts file at c:\windows\system32\drivers\etc and this contained: # Copyright (c) 1993-2006 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file cont

Re: [PHP-DB] Connecting PHP to MySQL on Windows

2011-01-06 Thread Daniel Brown
On Thu, Jan 6, 2011 at 21:12, michael manning wrote: > Hi Daniel, > When testing with the CLI, netstat shows: [snip!] What happens when you swap out 'localhost' for '127.0.0.1' in the connection routine? If that works, check to make sure your hosts file properly designates 127.0.0.1 as 'loca

Re: [PHP-DB] Connecting PHP to MySQL on Windows

2011-01-06 Thread michael manning
Hi Daniel, When testing with the CLI, netstat shows: = C:\Users\mmanning>netstat -b Active Connections Proto Local Address Foreign AddressState TCP127.0.0.1:80 mmanning-PC:49391 ESTABLISHED [httpd.exe] TCP127.0.0.1:3306 mmanning-PC:

Re: [PHP-DB] using PDO vs mysql extension

2011-01-06 Thread Daniel Brown
On Thu, Jan 6, 2011 at 02:52, Miriam Natanzon wrote: > Hi, > > I want to build an internal module for common DB-involved tasks: starting > with connection, simple queries and go on to multiple pages of results and > connecting tables and so on. > > We are currently working with MySQL but maybe in

Re: [PHP-DB] Connecting PHP to MySQL on Windows

2011-01-06 Thread Daniel Brown
On Thu, Jan 6, 2011 at 01:13, michael manning wrote: > Hi, > > I have installed MySQL 5.1.52, Apache 2.2.15 and PHP 5.3.2 on my Windows > Vista computer. > The MySQL works fine with the command line client and I have tested the > Apache and PHP and it appears fine when I test this with the phpinfo

Re: [PHP-DB] Word Matching Application

2011-01-05 Thread Ron Piggott
Subject: Re: [PHP-DB] Word Matching Application On Wed, Jan 5, 2011 at 21:23, Ron Piggott wrote: I only know how to do one array at a time, using FOREACH, like this: === echo "\r\n"; foreach($match_words as $word) { echo "" . $word . "\r\n"; } e

Re: [PHP-DB] Word Matching Application

2011-01-05 Thread Daniel Brown
On Wed, Jan 5, 2011 at 21:23, Ron Piggott wrote: > > I only know how to do one array at a time, using FOREACH, like this: > > === > echo "\r\n"; > >    foreach($match_words as $word) { >        echo "" . $word . "\r\n"; >    } > > echo "\r\n"; > === You could either swap that out for a simple

Re: [PHP-DB] Two forms on one page

2011-01-03 Thread Karl DeSaulniers
On Jan 3, 2011, at 5:17 PM, Ethan Rosenberg wrote: 'Submit Ktten' Shouldn't this be.. 'Submit Kitten' If your asking for it to explicitly equal that (===), then you need to spell Kitten with an "i" in it? But, that may not be what is actually wrong, just somehting I think I caught. B

Re: [PHP-DB] Two forms on one page

2011-01-03 Thread Toby Hart Dyke
On 1/3/2011 10:52 PM, Ethan Rosenberg wrote: Dear List - I would like to have two(2) forms in one PHP script. I would like to have the forms appear sequentially; ie, that the first form would appear, the data would be entered, and then the second form would appear, the data would be entered,

Re: [PHP-DB] Re: Word Activity Application

2011-01-03 Thread Niel Archer
> > The FOREACH below is giving me the error: > Invalid argument supplied for foreach() Not surprising as the $match_words will contain a boolean result from shuffle. Shuffle works directly on the variable it is given and returns true or false, depending on success. rtfm ;-) > Does anyone unders

Re: [PHP-DB] Re: [PHP] Regex for telephone numbers

2010-12-30 Thread Daniel Brown
On Thu, Dec 30, 2010 at 14:07, Ethan Rosenberg wrote: > > Josh - > > I used use \d{3}-\d{3}-\d{4}. > > It works beautifully!! Just keep in mind that invalid numbers will also pass that check, such as 000-000- or 123-456-6789. That's why my example was a bit more involved. -- Network I

Re: [PHP-DB] Re: [PHP] Regex for telephone numbers

2010-12-29 Thread Karl DeSaulniers
You could also help them out a little with something like.. $phone = str_replace("(", "", $phone); $phone = str_replace(")", "-", $phone); HTH, Karl On Dec 29, 2010, at 6:27 PM, Josh Kehn wrote: On Dec 29, 2010, at 7:12 PM, Ethan Rosenberg wrote: Dear List - Thank you for all your

Re: [PHP-DB] Re: [PHP] Regex for telephone numbers

2010-12-29 Thread Karl DeSaulniers
Hi Ethan, Could you do a string compare and check at certain characters for a dash? IE: check the second character to see if it is a dash for 1-800... if that is not a dash, check the fourth character for a dash, 469-9... then the other places where dashes would be based on those two charact

Re: [PHP-DB] bindParam OR bindValue

2010-12-28 Thread Artur Ejsmont
i am not 100% sure but should you not remove ' from around the variables to have (NULL, :f1, :l1 etc? prepared statements take care of escaping and quoting. http://www.php.net/manual/en/pdo.prepare.php does it help? art -- Visit me at: http://artur.ejsmont.org/blog/ -- PHP Database Mailing L

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

2010-12-20 Thread David Hutto
On Mon, Dec 20, 2010 at 7:37 AM, Daniel Brown wrote: > On Sat, Dec 18, 2010 at 17:02, David Hutto wrote: >> or maybe it's saturday morning and i'm drunk? > >    This seems to be the most likely, and considering how all messages > are permanently and independently archived and propagate throughout

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

2010-12-20 Thread Daniel Brown
On Sat, Dec 18, 2010 at 17:02, David Hutto wrote: > or maybe it's saturday morning and i'm drunk? This seems to be the most likely, and considering how all messages are permanently and independently archived and propagate throughout the Internet, it might be a good reason not to go nuts in se

Re: [PHP-DB] SUM() Math in mySQL

2010-12-19 Thread Chris
On 20/12/10 15:38, Ron Piggott wrote: I am working on the query below. It’s purpose is to manage the RSS Feed for the site. The part of the query I am struggling with is: SUM(`include_in_rss_feed`) AS current_rss_feed What I need is the total value of *ALL* the `include_in_rss_feed` , not th

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

2010-12-17 Thread Daniel Brown
On Fri, Dec 17, 2010 at 12:16, Richard Quadling wrote: > > And have you seen all the sad faces ... > > : { > > on http://docs.php.net/manual/en/control-structures.goto.php#92763 > > Can't be good for them. If only people knew how many hours - literally, hours - it took me to keep that page cl

Re: [PHP-DB] NULL to 0 result

2010-12-15 Thread Chris
On 15/12/10 21:42, Richard Quadling wrote: On 14 December 2010 21:53, Ron Piggott wrote: What change is needed to this query so if “currently_in_rss” is NULL it will be assigned a value of 0 SELECT `reference`, COUNT(`reference`) AS currently_in_rss FROM `ministry_profiles` WHERE `rss_feed_

Re: [PHP-DB] NULL to 0 result

2010-12-15 Thread Richard Quadling
On 14 December 2010 21:53, Ron Piggott wrote: > > What change is needed to this query so if “currently_in_rss” is NULL it will > be assigned a value of 0 > > SELECT `reference`, COUNT(`reference`) AS currently_in_rss FROM > `ministry_profiles` WHERE `rss_feed_include` = 1 GROUP BY `rss_feed_incl

Re: [PHP-DB] NULL to 0 result

2010-12-14 Thread Bastien Koert
On Tue, Dec 14, 2010 at 4:53 PM, Ron Piggott wrote: > > What change is needed to this query so if “currently_in_rss” is NULL it will > be assigned a value of 0 > > SELECT `reference`, COUNT(`reference`) AS currently_in_rss FROM > `ministry_profiles` WHERE `rss_feed_include` = 1 GROUP BY `rss_fee

Re: [PHP-DB] Resetting auto_increment

2010-12-14 Thread Daniel Brown
On Tue, Dec 14, 2010 at 13:43, Toby Hart Dyke wrote: > > Use  'ALTER tablename AUTO_INCREMENT=1' rather than 'UPDATE tablename > AUTO_INCREMENT=1'. Yeah, again, my fault. Not enough coffee on this cold (~7F) winter's day, perhaps. -- Network Infrastructure Manager Documentation, Webmaster

Re: [PHP-DB] Resetting auto_increment

2010-12-14 Thread Daniel Brown
On Tue, Dec 14, 2010 at 13:02, Ethan Rosenberg wrote: >> >>    UPDATE tablename AUTO_INCREMENT=1; > > mysql> update Visit3 auto_increment=1; > ERROR 1064 (42000): You have an error in your SQL syntax; check the manual > that corresponds to your MySQL server version for the right syntax to use > ne

Re: [PHP-DB] Resetting auto_increment

2010-12-14 Thread Toby Hart Dyke
On 12/14/2010 1:02 PM, Ethan Rosenberg wrote: At 12:38 PM 12/14/2010, Daniel Brown wrote: On Tue, Dec 14, 2010 at 12:34, Ethan Rosenberg wrote: > Dear List - > > Thanks for all your help. > > How do I reset auto_increment so that the primary key will start from 1. > The primary key is now 24

Re: [PHP-DB] Resetting auto_increment

2010-12-14 Thread Ethan Rosenberg
At 12:38 PM 12/14/2010, Daniel Brown wrote: On Tue, Dec 14, 2010 at 12:34, Ethan Rosenberg wrote: > Dear List - > > Thanks for all your help. > > How do I reset auto_increment so that the primary key will start from 1. > The primary key is now 2421. I have deleted all the data in the table and

Re: [PHP-DB] Resetting auto_increment

2010-12-14 Thread Daniel Brown
On Tue, Dec 14, 2010 at 12:34, Ethan Rosenberg wrote: > Dear List - > > Thanks for all your help. > > How do I reset auto_increment so that the primary key will start from 1. >  The primary key is now 2421.  I have deleted all the data in the table and > started over, and the primary key just incr

Re: [PHP-DB] Incorrect encoding when data read from a mysql database

2010-12-08 Thread Bastien Koert
On Fri, Dec 3, 2010 at 4:42 AM, Neil Jackson wrote: > Hi, > I am designing a website that requires storing data in 3 different languages, > English, Portuguese and Tetum. > > When I read the data from the database the accented characters are displayed > as a ? in Firefox and Opera, a square in IE

RE: [PHP-DB] Re: [PHP] Closing Browser

2010-12-06 Thread Oddity Software LLC
If you are trying to do some automation type stuff you might want to look at something like Robo Task - http://www.robotask.com/ You can schedule a browser open to specified URL's (php script) and have it close the window handle after the page is loaded. Regards, Will T Chief Technical Officer

Re: [PHP-DB] NULL values

2010-12-04 Thread Richard Quadling
On 4 December 2010 11:40, Amit Tandon wrote: > Dear Ron > > Or try this > > SELECT * FROM `paypal_payment_info` WHERE ifnull(os1, '') <> > 'commission_paid' > > regds > amit > > "The difference between fiction and reality? Fiction has to make sense." > > > On Sat, Dec 4, 2010 at 7:55

Re: [PHP-DB] NULL values

2010-12-04 Thread Amit Tandon
Dear Ron Or try this SELECT * FROM `paypal_payment_info` WHERE ifnull(os1, '') <> 'commission_paid' regds amit "The difference between fiction and reality? Fiction has to make sense." On Sat, Dec 4, 2010 at 7:55 AM, Ron Piggott wrote: > > When I do the following query in mySQL on

Re: [PHP-DB] NULL values

2010-12-03 Thread Scotty Logan
On Fri, Dec 3, 2010 at 6:25 PM, Ron Piggott wrote: > > When I do the following query in mySQL only 1 record is retrieved. > > SELECT * FROM `paypal_payment_info` WHERE `os1` NOT LIKE 'commission_paid' > > I am surprised by this.  This one record has no characters in it, but the > “INSERT INTO” th

Re: [PHP-DB] Re: [PHP] Strange Query Error...

2010-11-27 Thread Karl DeSaulniers
On Nov 27, 2010, at 1:24 PM, Don Wieland wrote: On Nov 27, 2010, at 10:44 AM, Daniel P. Brown wrote: Note how you keep changing case here. For example, m.aucciim_id vs. m.AUCCIIM_ID. Also note that all of this is cAsE-sEnSiTiVe. You are right. But it still chokes in PHP: select m.* fr

Re: [PHP-DB] ON DUPLICATE KEY UPDATE

2010-11-27 Thread kesavan trichy rengarajan
Read through this: http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html, especially the last 2 paragraphs. On Sun, Nov 28, 2010 at 12:40 PM, Ron Piggott < ron.pigg...@actsministries.org> wrote: > My question is with the syntax below: If the “ON DUPLICATE KEY UPDATE > `name` = '$name'”

Re: [PHP-DB] Re: [PHP] Strange Query Error...

2010-11-27 Thread Niel Archer
> On Nov 27, 2010, at 10:08 AM, Daniel P. Brown wrote: > > > one primary question: are you using the mysql_* > > family, mysqli_* family, or another method of interfacing with MySQL? > > mysql_ > > $results = mysql_query($query) or die(mysql_error()); > > Don > > -- > PHP Database Mailing Lis

Re: [PHP-DB] Using placeholder without pass by reference in MySqli

2010-11-27 Thread None
?> "Bastien" wrote in message news:962f0fd6-0eaa-495a-831e-da05bc1ab...@gmail.com... On 2010-11-26, at 7:46 PM, "None" wrote: > ?Could be a silly question, but i can't find a method to use placeholder > (MySqli) without passing by reference (bind_param) or receive by > reference (bind_resu

Re: [PHP-DB] Using placeholder without pass by reference in MySqli

2010-11-26 Thread Bastien
On 2010-11-26, at 7:46 PM, "None" wrote: > ?Could be a silly question, but i can't find a method to use placeholder > (MySqli) without passing by reference (bind_param) or receive by reference > (bind_result)? is that right? I really hate use reference becouse in large > program is common cr

Re: [PHP-DB] If condition in query

2010-11-18 Thread Amit Tandon
My question - 1. why have u used mysqli_fetch_array($result[0]), in place of mysqli_fetch_array($result)) i.e. without array brackets as $result is not an array. What is returned by mysqli_fetch_array is an array. 2. Have u checked the your query (print $sq1) after u added "*extra test in the que

Re: [PHP-DB] If condition in query

2010-11-18 Thread Niel Archer
> Dear list - > > Thank you for all your excellent help. > > I wish to search a table. In this case, I have five(5) columns: > site, Record, BMI, Weight and Height. > I wish to be able to search on one or more of the columns. If I use > a query like: > > $ste = $_POST['site']; > $req = $_POS

RE: [PHP-DB] query help

2010-11-17 Thread Ashay Chaudhary
The most performant methods are to use well parameterized stored procedure or a prepared parameterized statement. : Ashay -Original Message- From: Niel Archer [mailto:n...@chance.now] Sent: Wednesday, November 17, 2010 6:30 AM To: php-db@lists.php.net Subject: Re: [PHP-DB] query help

RE: [PHP-DB] query help

2010-11-17 Thread Constantin Brinzoi
rom: Artur Ejsmont [mailto:ejsmont.ar...@gmail.com] Sent: 17 noiembrie 2010 16:07 To: Vinay Kannan Cc: PHP DB; php mysql Subject: Re: [PHP-DB] query help well i guess you could do that. but it gets complicated after a while and there will be a lot of work and probably after a while you will get

Re: [PHP-DB] query help

2010-11-17 Thread Niel Archer
> Hello PHP Gurus, > > I need your help on an insert query. > > I wanted to know if there is way to insert an array of values into a DB. An > eg would explain this better : > > If I have 2 tables in a DB, 1) users has 3 columns 2) hobbies = 5 columns > > I was thinking of having a single functi

Re: [PHP-DB] query help

2010-11-17 Thread Max E.K
From: "Vinay Kannan" To: "PHP DB" , "php mysql" Sent: Wednesday, November 17, 2010 2:51:35 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna Subject: [PHP-DB] query help Hello PHP Gurus, I need your help on an insert query. I wanted to know if there is way to insert an arra

Re: [PHP-DB] query help

2010-11-17 Thread Bastien Koert
On Wed, Nov 17, 2010 at 8:51 AM, Vinay Kannan wrote: > Hello PHP Gurus, > > I need your help on an insert query. > > I wanted to know if there is way to insert an array of values into a DB. An > eg would explain this better : > > If I have 2 tables in a DB, 1) users has 3 columns 2) hobbies = 5 co

Re: [PHP-DB] query help

2010-11-17 Thread Artur Ejsmont
well i guess you could do that. but it gets complicated after a while and there will be a lot of work and probably after a while you will get into some problems. You have to handle escaping, special types etc. Then what about performance? how to query the data ... using similar approach or is

Re: [PHP-DB] French and Spanish Accent Letters

2010-11-10 Thread Bastien
I use utf-8 for that it works well Bastien Koert 905-904-0334 Sent from my iPhone On 2010-11-10, at 10:03 AM, "Ron Piggott" wrote: > > I have a column that is VARCHAR 250. I need it to be able to accept french > and spanish accents. The purpose of the column is organization names. The >

Re: [PHP-DB] French and Spanish Accent Letters

2010-11-10 Thread Andrés G . Montañez
Hi Ron, you should use CHARSET=utf8 COLLATE=utf8_unicode_ci in your table for a wide option of languages. Example: CREATE TABLE `t_my_table` ( `row_id` int(10) unsigned NOT NULL, `row_name` varchar(64) COLLATE utf8_unicode_ci NOT NULL, ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unic

Re: [PHP-DB] French and Spanish Accent Letters

2010-11-10 Thread Daniel Brown
On Wed, Nov 10, 2010 at 10:16, Ron Piggott wrote: > > I did Daniel --- php-db@lists.php.net ; Thank you for telling me about the > mySQL list. > > I failed to mention in my original e-mail the database is mySQL. My fault. Force of habit mentioning the php-db@ list. Sorry if there was any co

Re: [PHP-DB] French and Spanish Accent Letters

2010-11-10 Thread Ron Piggott
: Wednesday, November 10, 2010 10:08 AM To: Ron Piggott Cc: php-db@lists.php.net Subject: Re: [PHP-DB] French and Spanish Accent Letters On Wed, Nov 10, 2010 at 10:03, Ron Piggott wrote: I have a column that is VARCHAR 250. I need it to be able to accept french and spanish accents. The purpose

<    6   7   8   9   10   11   12   13   14   15   >