RE: [PHP-DB] Reading emails with PHP

2003-12-19 Thread Dillon, John
It may be sacrilege to mention it here, but there is an excellent perl module for handling mail bounces; I've used it to write a handler that catches the returned mail, gets the address(es) and reason(s) for the bounce, and then goes into our DB and flags the matching users. I looked all

RE: [PHP-DB] Splitting a string by a ,

2003-12-05 Thread Dillon, John
I don't wish to hyjack this string but there is a module in perl for extracting emails from files, I could not get it to work but wonder is there any pre-written function in php that would parse text and extract the emails. I wish to do it with pst files, ie people who have written to me over

[PHP-DB] Dumping database/restoring

2003-12-04 Thread Dillon, John
I use Mascon from scibit to view my database. It has a dump facility to dump to another database or to a local file. I am afraid of the first option lest it overwrites tables already on the other server. When I dump to a local file it is a text file and I can't work out how I would restore from

RE: Re[2]: [PHP-DB] Dumping database/restoring

2003-12-04 Thread Dillon, John
Hi Richard, I simply login to my server and issue a command like: I think that's the bit I missed. I've managed to create the database-d web site (and live happily) without ever logging in to a shell-type area. I've begun to use Putty/SSH as Leech doesn't show me a shell to type commands

RE: Re[2]: [PHP-DB] Dumping database/restoring

2003-12-04 Thread Dillon, John
Hi Richard, I simply login to my server and issue a command like: mysqldump -hmysqlserverhost.com -utheusername -p dbname dbname.sql It will then prompt me for my password and dump the database (dbname) into dbname.sql -h = the sql host (often localhost) -u = a mysql account that has

[PHP-DB] Parse error on array and SQL query

2003-11-20 Thread Dillon, John
On line 188 and similar: line 187$this=$altIDs[$i]; line 188$query .= ID='$this'; I get the error: Parse error: parse error in /home/jdillon/public_html/provreport.php on line 188 Could this be because some setting has been changed on my shared

RE: [PHP-DB] Parse error on array and SQL query

2003-11-20 Thread Dillon, John
November 2003 14:43 To: 'Dillon, John'; [EMAIL PROTECTED] Subject: RE: [PHP-DB] Parse error on array and SQL query Speaking for myself only, I'm probably going to need to see more code than this to be able to help. These two lines appear to be OK. The error might be in what feeds line 187

RE: [PHP-DB] Parse error on array and SQL query

2003-11-20 Thread Dillon, John
Dillon, John wrote: On line 188 and similar: line 187$this=$altIDs[$i]; line 188$query .= ID='$this'; I get the error: Parse error: parse error in /home/jdillon/public_html/provreport.php on line 188 Could this be because some setting has

[PHP-DB] RE: Adding in MySQL

2003-11-12 Thread Dillon, John
Thanks for the three replies and two tickings-off. It was a spelling mistake in my table name. The reason I tend to top post is that you then don't have to read the disclaimer or address details from my company in a reply. Sometimes in easy situations the question is clear from the reply plus

[PHP-DB] Adding in MySQL

2003-11-11 Thread Dillon, John
Can I UPDATE an int record with MySql and add 1 to it? without extracting it into a variable first? If so, what am I looking for in the www.mysql.com manual. Seems it only deals with SELECT and WHERE. Thanks, John    

[PHP-DB] number_format problem

2003-11-05 Thread Dillon, John
I want to show a number from a database in the format x,xxx.00 in a textfield, then if it is changed by the user I want to post the value of the number to a decimal field. However, once you number_format the number it becomes a string, and numbers like 3,379.90 give a value of 3 when posted to

[PHP-DB] Configuring GD for Windows: image functions

2003-10-24 Thread Dillon, John
Could someone suggest where I am going wrong in configuring GD for Windows please? Ruunning Apache 1.3.2 and PHP 4.3.28 Apache httpd.conf says: LoadModule php4_module c:/PHP/php-4.3.2-Win32/sapi/php4apache.dll php.ini is only in c:\WINNT and says extension=php_gd2.dll

[PHP-DB] RE: Configuring GD for Windows: image functions

2003-10-24 Thread Dillon, John
php 4.3.28. So is it a solution to change to 4.3.3 as there is something about Upgraded the bundled GD library to version GD 2.0.15 in the announcements: http://www.php.net/release_4_3_3.php. Thanks, John -Original Message- From: Dillon, John Sent: 24 October 2003 15:22 To: '[EMAIL

[PHP-DB] RE: Error settings

2003-10-22 Thread Dillon, John
: php_flag register_globals on. -Original Message- From: Dillon, John Sent: 21 October 2003 16:05 To: [EMAIL PROTECTED] Subject: Error settings How do I get rid of the undefined variable errors I get on a new (default) set up of Apache 1.3.28/PHP4.3.2 (without re-writing the code). It works

[PHP-DB] Error settings

2003-10-21 Thread Dillon, John
How do I get rid of the undefined variable errors I get on a new (default) set up of Apache 1.3.28/PHP4.3.2 (without re-writing the code). It works on the internet on my host providers server but I am running this on localhost. I also get undefined offset error. Regards, John

RE: [PHP-DB] Error settings

2003-10-21 Thread Dillon, John
From: Dillon, John [EMAIL PROTECTED] How do I get rid of the undefined variable errors I get on a new (default) set up of Apache 1.3.28/PHP4.3.2 (without re-writing the code). It works on the internet on my host providers server but I am running this on localhost. I also get undefined offset

RE: [PHP-DB] Round a number

2003-10-03 Thread Dillon, John
This should do it: http://www.mysql.com/doc/en/Miscellaneous_functions.html FORMAT(X,D) Formats the number X to a format like '#,###,###.##', rounded to D decimals, and returns the result as a string. If D is 0, the result will have no decimal point or fractional part: mysql SELECT

[PHP-DB] ereg_replace

2003-09-30 Thread Dillon, John
strip_tags() is used to remove HTML tags, eg for showing text on the browser and then sending it by plain text email or storing in the db. As a matter of interest, how is this done using ereg_replace. I thought this would work ^.*$, that is being with and any number of single characters ending

[PHP-DB] MySQL: CREATE TABLE, BLOB, UNIQUE, INDEX etc

2003-08-29 Thread Dillon, John
My code: $query= CREATE TABLE IF NOT EXISTS temp3 UNIQUE(CON175) IGNORE SELECT DISTINCT CONCAT($tbl2.this,$tbl2.that) AS CON175 FROM $tbl2 WHERE $tbl2.this='$rcc' ; gives error: Query failed: BLOB column 'CON175' used in key specification without a key length. Manual

[PHP-DB] MySQL query failing on apostrophe in data

2003-08-27 Thread Dillon, John
How do I avoid the problem in the subject hereto? SELECT query uses variable in the WHERE clause. Fails on the following query: SELECT Tbl.fld FROM Tbl WHERE Tbl.fld2='11301201 0603A HKA 3902 #3708_JD's AE Exp' AND ... John

[PHP-DB] RE: MySQL query failing on apostrophe in data

2003-08-27 Thread Dillon, John
Seemingly: http://www.php.net/manual/en/function.mysql-escape-string.php -Original Message- From: Dillon, John Sent: 27 August 2003 17:59 To: 'PHP-DB' Subject: MySQL query failing on apostrophe in data How do I avoid the problem in the subject hereto? SELECT query uses variable

[PHP-DB] DISTINCT not working

2003-08-21 Thread Dillon, John
Any ideas on why the DISTINCT would not work in the following testing code: $query=CREATE TABLE IF NOT EXISTS temp3TEMP SELECT DISTINCTROW ROUND($tbl2.Net*.175,2) AS ExpNet175, CONCAT($tbl2.Journal,$tbl2.Description) AS CON175 FROM $tbl2 WHERE

[PHP-DB] RE: DISTINCT not working

2003-08-21 Thread Dillon, John
version on my computer as well? John -Original Message- From: Dillon, John Sent: 21 August 2003 16:12 To: [EMAIL PROTECTED] Subject: DISTINCT not working Any ideas on why the DISTINCT would not work in the following testing code: $query=CREATE TABLE IF NOT EXISTS temp3TEMP

RE: [PHP-DB] Queries probably timing out

2003-08-20 Thread Dillon, John
is get your host to upgrade. Or host your own server. It's starting to sound like a OS issue after searching around on google. I'l call up tech support and whine until they did something, but that's just me. :) That query isn't that bad. -Micah On Tuesday 19 August 2003 10:54 am, Dillon, John

[PHP-DB] Queries probably timing out

2003-08-19 Thread Dillon, John
I'm doing queries on tables with 45,000 rows in one table and 1-2000 rows in another.. I think the queries are failing due to timeout on the server. The server is not dedicated to me and I may not be able to affect the timeout settings...though I'll ask my hosting company (Positive Internet). If

RE: [PHP-DB] Queries probably timing out

2003-08-19 Thread Dillon, John
guessing it's PHP. If you get an error, post it on the list. -Micah On Tuesday 19 August 2003 2:59 am, Ignatius Reilly wrote: - Original Message - From: Dillon, John [EMAIL PROTECTED] To: PHP-DB List [EMAIL PROTECTED] Sent: Tuesday, August 19, 2003 11:47 AM

RE: [PHP-DB] Functions - scope of returned result

2003-08-14 Thread Dillon, John
To answer my own question again, I didn't assign the returned value from the function call to a variable: $piv_result=queries(); All OK. -Original Message- From: Dillon, John [mailto:[EMAIL PROTECTED] Sent: 14 August 2003 17:54 To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] Functions

RE: [PHP-DB] adding integer to field in query

2003-08-14 Thread Dillon, John
Thanks to both responses. In fact, it decided to work once I put 0 in the cell that 1 was to be added to! It seems it got it started.. 1+NULL=? -Original Message- From: Matt Schroebel [mailto:[EMAIL PROTECTED] Sent: 13 August 2003 15:48 To: Dillon, John; [EMAIL PROTECTED] Subject: RE

[PHP-DB] RE: Pivot tables

2003-08-14 Thread Dillon, John
Darn, here's the link: http://www.mysql.com/articles/wizard/print_version.html -Original Message- From: Dillon, John Sent: 11 August 2003 19:09 To: [EMAIL PROTECTED] Subject: Pivot tables Here is the worth-reading mysql answer to my question below. Pity it's implemented on perl

RE: [PHP-DB] Extracting result - unknown number of fields

2003-08-14 Thread Dillon, John
: CPT John W. Holmes [mailto:[EMAIL PROTECTED] Sent: 14 August 2003 16:29 To: Dillon, John; [EMAIL PROTECTED] Subject: Re: [PHP-DB] Extracting result - unknown number of fields From: Dillon, John [EMAIL PROTECTED] While doing a cross tabulation, I've got a query which gives me a variable number

[PHP-DB] Extracting result - unknown number of fields

2003-08-14 Thread Dillon, John
While doing a cross tabulation, I've got a query which gives me a variable number of fields: $query=SELECT Dept; $count=count($piv_cos); for($x=0;$x$count;$x++){ $query.=, SUM(IF(Co='$piv_cos[$x]',Exps175,0)) AS '$piv_cos[$x]'; } $query.= FROM $tbl1 GROUP BY Dept;

RE: [PHP-DB] Functions - scope of returned result

2003-08-14 Thread Dillon, John
One more bite on this code. function queries(){ //code.. $piv_result=mysql_db_query($db, $query, $connection) or die (Query9 failed: $query); return $piv_result; } function print(){ global $piv_result; $count_fields=mysql_num_fields($piv_result);

RE: [PHP-DB] Extracting result - unknown number of fields

2003-08-14 Thread Dillon, John
($result, $i)./th; } echo /tr\n; while ($row = mysql_fetch_row($result)) { //Table body echo tr; for ($f=0; $f $fields; $f++) { echo td$row[$f]/td; } echo /tr\n;} echo /table http://www.php.net/manual/en/function.mysql-num-fields.php -Original Message- From: Dillon, John [mailto:[EMAIL PROTECTED

[PHP-DB] adding integer to field in query

2003-08-14 Thread Dillon, John
How do you add a number to a field within the query, ie without having to extract? Eg $query=UPDATE Choice SET visits=(visits+1) WHERE ID='$thisID'; is the above visits=(visits+1) legal, cos it doesn't work at the moment? Thanks, John    

[PHP-DB] Pivot tables

2003-08-12 Thread Dillon, John
Here is the worth-reading mysql answer to my question below. Pity it's implemented on perl not PHP though...anyone know a PHP implementation? I will need to generate a pivot table similar to that in Excel, in this version I want to list a unique list of fields across

RE: [PHP-DB] SQLT question: LEFT JOIN

2003-08-01 Thread Dillon, John
I want all the records from two joined tables but where the JOIN applies (say I join on the ID field and not all LEFT table IDs are in the RIGHT table) I only want the records which comply with a test. I tried: SELECT tbl1.fld1, tbl2.fld1 FROM tbl1 LEFT JOIN tbl2 ON tbl1.ID=tbl2.ID WHERE

RE: [PHP-DB] session problem

2003-07-23 Thread Dillon, John
This is advertising a porno site. -Original Message- From: tana dsasa [mailto:[EMAIL PROTECTED] Sent: 23 July 2003 11:11 To: [EMAIL PROTECTED] Subject: [PHP-DB] session problem I have installed an user-login aplication on my website ( http://www.norbertnet.ro ) but i have problems with

[PHP-DB] Query fails after changing column name using Mascon

2003-07-03 Thread Dillon, John
When I change the name of a field the mysql query fails (using the new field name). It works if I change to an existing field. If I change that field name query doesn't work (having amended the query). Sounds like my table is not being updated to new field name, so query doesn't find the new

[PHP-DB] POSTed form and address

2003-06-26 Thread Dillon, John
I have a simple page saying: if(password is correct){then print the page} otherwise {print the login form}. The login form uses the method=post. But the page I get back has the form values: login details, in the address line. I thought get gave you the variables in the address line and with post

[PHP-DB] RE: POSTed form and address

2003-06-26 Thread Dillon, John
Sorry people. My page was not refreshing properly. In future, I'll use version numbers to know what I'm looking at. -Original Message- From: Dillon, John Sent: 26 June 2003 17:29 To: [EMAIL PROTECTED] Subject: POSTed form and address I have a simple page saying: if(password

[PHP-DB] POSTing page

2003-06-24 Thread Dillon, John
If someone POSTs information - using action=yourpage from theirpage (using a copy of the form on yourpage - can you tell where what theirpage is, ie where the information was POSTed from? John http://www.cantor.com CONFIDENTIAL: This e-mail, including its contents and

[PHP-DB] check boxes and php

2003-03-27 Thread Dillon, John
I want to create a page where the user will have a list of its favorites and by ticking a box opposite the item will be able to delete it by clicking the submit button. I want to make this dynamic so that the php works out the one to delete based on the value of the tickbox (I'm thinking), having