Re: [PHP-DB] display fetched data in excel format

2008-03-25 Thread ioannes
I was looking at this page: http://www-128.ibm.com/developerworks/opensource/library/os-phpexcel/#N10181 Hope this helps. Do you have a link on the pear solution as the pear example seems wrong on the above link? John santosh wrote: Hi All, I am using subquery to fetch data from

[PHP-DB] RES: [PHP] mysql joins

2008-03-25 Thread Thiago Pojda
not sure how timestamps work in MySQL, but I've written this in Oracle: CREATE TABLE USaR ( UsID char(255) null, Firstname char(255) NULL, Surname char(255) NULL, Tel char(255) NULL, Cell char(255) NULL, Email char(255) NULL ) / CREATE TABLE Tracker( UsID CHAR(255) NULL, Points

Re: [PHP-DB] HTML CSS (Off Subject) 911 Help! :-)

2008-03-25 Thread Daniel Brown
On Tue, Mar 25, 2008 at 12:24 AM, Karl James [EMAIL PROTECTED] wrote: [snip!] I need some help on formatting issues. [snip!] Right now the page looks like this. [snip!] http://www.theufl.com/2003/reports/rosters/fantasyrosters.htm [snip!] It is almost, their. However, as you can tell

[PHP-DB] Not updating certain fields in same row

2008-03-25 Thread Jason Pruim
Hi everyone, I am attempting to update a record for a login system while leaving certain fields untouched if they arn't changed, and am running into issues. Basically what I want to do, is say I have these fields: Field1 Field2 Field3 Field4 I update Field1 and Field3 but not Field2 and

Re: [PHP-DB] Not updating certain fields in same row

2008-03-25 Thread Daniel Brown
On Tue, Mar 25, 2008 at 12:59 PM, Jason Pruim [EMAIL PROTECTED] wrote: Hi everyone, I am attempting to update a record for a login system while leaving certain fields untouched if they arn't changed, and am running into issues. [snip!] I have tried this code: $tab = \t;

Re: [PHP-DB] Not updating certain fields in same row

2008-03-25 Thread Jason Pruim
On Mar 25, 2008, at 1:09 PM, Daniel Brown wrote: On Tue, Mar 25, 2008 at 12:59 PM, Jason Pruim [EMAIL PROTECTED] wrote: Hi everyone, I am attempting to update a record for a login system while leaving certain fields untouched if they arn't changed, and am running into issues. [snip!] I

Re: [PHP-DB] Not updating certain fields in same row

2008-03-25 Thread Matt Anderton
I usually pre-populate the form with the values that are already in the record: (... using PEAR's MDB2 package -- http://pear.php.net/packages/MDB2 ) $query = SELECT * FROM member WHERE username = ' . $_POST['username'] . '; $result = $db-query($query); $member =

Re: [PHP-DB] Not updating certain fields in same row

2008-03-25 Thread Jason Pruim
On Mar 25, 2008, at 1:17 PM, Matt Anderton wrote: I usually pre-populate the form with the values that are already in the record: (... using PEAR's MDB2 package -- http://pear.php.net/packages/MDB2 ) $query = SELECT * FROM member WHERE username = ' . $_POST['username'] . '; $result =

RE: [PHP-DB] Not updating certain fields in same row

2008-03-25 Thread Miguel Guirao
You can't use the function empty() because as soon as the form is submitted, the value of an empty field in the form, is a blank in the variable in your script, so basically your password field is NOT empty, it has a value, a blank. So you need to test your password field to NOT to be empty, also

Re: [PHP-DB] Not updating certain fields in same row

2008-03-25 Thread Matt Anderton
I encrypt my pw's the same way but I usually don't include the password on an edit my info page. I create a separate change password screen where I force them to type in their old password and then type a new one twice. if the encrypted, salted old password attempt does not match what is in the

Re: [PHP-DB] Not updating certain fields in same row

2008-03-25 Thread Daniel Brown
On Tue, Mar 25, 2008 at 1:14 PM, Jason Pruim [EMAIL PROTECTED] wrote: the actual query I'm using is this: $chpwsql = UPDATE current SET customerName='$customerName', loginName='$loginName', loginPassword='$PW', email='$email', adminLevel='$adminLevel' WHERE Record='$Record1';

Re: [PHP-DB] Not updating certain fields in same row

2008-03-25 Thread Evert Lammerts
I might be way off here. Php.net tells me that: [quote] mysql_real_escape_string — Escapes special characters in a string for use in a SQL statement string **mysql_real_escape_string** ( string $unescaped_string [, resource $link_identifier ] ) [/quote] and you use [quote]

Re: [PHP-DB] Not updating certain fields in same row

2008-03-25 Thread Evert Lammerts
Correction: Also, this condition: [quote] if (!isset($_POST['txtLoginName']) || empty($_POST['txtLoginName'])) [/quote] is true if and only if no form element by the name txtLoginName existed on the previous page - and on top of that, empty() does the same as isset() and apart from that

Re: [PHP-DB] Not updating certain fields in same row

2008-03-25 Thread Jason Pruim
On Mar 25, 2008, at 2:57 PM, Evert Lammerts wrote: I might be way off here. Php.net tells me that: [quote] mysql_real_escape_string — Escapes special characters in a string for use in a SQL statement string **mysql_real_escape_string** ( string $unescaped_string [, resource

Re: [PHP-DB] Not updating certain fields in same row

2008-03-25 Thread Chris
Jason Pruim wrote: Hi everyone, I am attempting to update a record for a login system while leaving certain fields untouched if they arn't changed, and am running into issues. Basically what I want to do, is say I have these fields: Field1 Field2 Field3 Field4 I update Field1 and Field3

[PHP-DB] numeric string to single digit array

2008-03-25 Thread Richard Dunne
Can anyone tell me how how to convert a string of integers into an array of single digit integers. i.e. 1223123 into ['1','2,','2','3','1,'2','3'] ? When I retreive a column of single digit integers I end up with a long string of numbers. I think PHP is seeing this as one whole number and

[PHP-DB] Re: **{SPAM}** [PHP-DB] numeric string to single digit array

2008-03-25 Thread Dustin Simpson
Richard, Someone might have a quicker/better way, but what about: ?php $numbers = '1223123'; $numberarray = str_split($numbers,1); print_r($numberarray); ? Thanks, --Dustin Richard Dunne wrote: Can anyone tell me how how to convert a string of integers into an array of single

Re: [PHP-DB] numeric string to single digit array

2008-03-25 Thread Chris
Richard Dunne wrote: Can anyone tell me how how to convert a string of integers into an array of single digit integers. i.e. 1223123 into ['1','2,','2','3','1,'2','3'] ? $string = '12345'; $array = array(); for ($i = 0; $i strlen($string); $i++) { $array[] = $string[$i]; } I'm sure

Re: [PHP-DB] numeric string to single digit array

2008-03-25 Thread Chris
Please always CC the mailing list so others can learn and also contribute answers. Also please don't top-post as it makes it hard to follow discussions. Richard Dunne wrote: I am using MySQL and retrieving a single column which consists of single digit integers. I have been doing a lot of

Re: [PHP-DB] numeric string to single digit array

2008-03-25 Thread Richard Dunne
Sorry for the top-posting, it's my mail client, not my design. I honestly have not even looked at myphpadmin much, using the CLI mostly. - Original Message - From: Chris [EMAIL PROTECTED] Date: Wednesday, March 26, 2008 0:53 am Subject: Re: [PHP-DB] numeric string to single digit

Re: [PHP-DB] Table optimization ideas needed

2008-03-25 Thread Shelley
Yes, Index can help a lot. But actually there has been five indices. The table takes 1.4G space while the indices take 2.3G. The select sentence is still slow. :( On Tue, Mar 25, 2008 at 11:50 AM, Chris [EMAIL PROTECTED] wrote: Shelley wrote: Hi all, I made a post a week ago to ask for

Re: [PHP-DB] numeric string to single digit array

2008-03-25 Thread Chris
Richard Dunne wrote: Sorry for the top-posting, it's my mail client, not my design. I honestly have not even looked at myphpadmin much, using the CLI mostly. It's easy enough to click to another place in your mail client ;) So what happens when you run that query manually? -- Postgresql

Re: [PHP-DB] Table optimization ideas needed

2008-03-25 Thread Chris
Shelley wrote: Yes, Index can help a lot. But actually there has been five indices. The table takes 1.4G space while the indices take 2.3G. The select sentence is still slow. :( Post your exact query, table definition(s), indexes and see if anyone has some suggestions. If it's a mysql

Re: [PHP-DB] Table optimization ideas needed

2008-03-25 Thread Shelley
+--+---+--+-+---++ | Field| Type | Null | Key | Default | Extra | +--+---+--+-+---++ | id | int(11)

Re: [PHP-DB] Table optimization ideas needed

2008-03-25 Thread Chris
Shelley wrote: +--+---+--+-+---++ | Field| Type | Null | Key | Default | Extra | +--+---+--+-+---++ | id