Re: [PHP-DB] Set Logout Time for No Activity

2002-12-20 Thread Ignatius Reilly
Another possibility is after each page call to rewrite the client's cookie's validity to, say, current time + 1800s: session_start() ; setcookie( session_name(), session_id(), time()+1800, "/" ) ; ob_start() ; // etc. If the user does not call a page for more than 30', the cookie will be destroy

Re: [PHP-DB] form validation

2002-12-20 Thread Ignatius Reilly
Hi Mignon, it is really quite simple: you can pack several screens (each containing for instance a form) in a same script. each form contains a hidden field, say "selector" now, the script begins by a switch: if ( isset( $_POST['submit'] ) ) { switch ( $selector ) { // Switch 1: process the

Re: [PHP-DB] Help with date....

2003-01-07 Thread Ignatius Reilly
You can do it very nicely with MySQL: $query = "SELECT WEEKDAY( '{$mydate}' )" ; Provided your date is correctly formatted ( -mm-dd ) Ignatius - Original Message - From: "Rodrigo Corrêa" <[EMAIL PROTECTED]> To: "PHP1" <[EMAIL PROTECTED]> Se

Re: [PHP-DB] LEFT JOIN not working

2003-01-09 Thread Ignatius Reilly
problem 1: move the WHERE clauses to the ON clauses problem 2: Obviously your intent with " COUNT(ads_clickrate.date) " is to count the number of non-null occurences of click. But COUNT() is not the appropriate function to do this (it will simply give you the number of rows inside a group). Try r

Re: [PHP-DB] LEFT JOIN not working

2003-01-09 Thread Ignatius Reilly
as an id, unique and required, instead of "name") Ignatius - Original Message - From: "Lisi" <[EMAIL PROTECTED]> To: "Ignatius Reilly" <[EMAIL PROTECTED]>; "PHP-DB" <[EMAIL PROTECTED]> S

Re: [PHP-DB] LEFT JOIN not working

2003-01-09 Thread Ignatius Reilly
m?" D. Ivester, CEO, Coca Cola - Original Message - From: "Lisi" <[EMAIL PROTECTED]> To: "Ignatius Reilly" <[EMAIL PROTECTED]>; "PHP-DB" <[EMAIL PROTECTED]> Sent: Thursday, January 09, 2003 1:11 PM

Re: [PHP-DB] two inserts at once?

2003-01-09 Thread Ignatius Reilly
If you are using MySQL, you can't. (none of my business, but why not simplifying your table names: "faqProduct" instead of "faqRelatedToProduct" ?) Ignatius - Original Message - From: "Michael Knauf/Niles" <[EMAIL PROTECTED]> To: <[EMAIL PROTEC

Re: [PHP-DB] LEFT JOIN not working

2003-01-09 Thread Ignatius Reilly
table only. Therefore: WHERE YEAR(ads_displayrate.date) = '2003' AND MONTH(ads_displayrate.date) = '01' (if your table ads_displayrate has such date fields). HTH Ignatius - Original Message - From: "Lisi" <[EMAI

Re: [PHP-DB] LEFT JOIN not working

2003-01-15 Thread Ignatius Reilly
. Ignatius - Original Message - From: "Henrik Hornemann" <[EMAIL PROTECTED]> To: "Ignatius Reilly" <[EMAIL PROTECTED]> Cc: "PHP-DB" <[EMAIL PROTECTED]> Sent: Wednesday, January 15, 2003 10:56 AM Su

Re: [PHP-DB] making my own week? :)

2003-01-15 Thread Ignatius Reilly
The simplest seems to store the date normally in the DB. When you need your special "Cinema" date, just do a modulo 7: myDayOfWeek = ( WEEKDAY( '2003-01-17' ) + 3 ) % 7 HTH Ignatius - Original Message - From: "Matthew Nock" <[EMAIL PROTECTED]>

Re: [PHP-DB] Mail() and replies

2003-01-15 Thread Ignatius Reilly
Quite doable. Check the IMAP functions. Ignatius - Original Message - From: "Baumgartner Jeffrey" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, January 15, 2003 5:19 PM Subject: [PHP-DB] Mail() and replies > Is there any way to

Re: [PHP-DB] need help spotting this php parse error

2003-01-23 Thread Ignatius Reilly
Dunno. I also remember once having a parse error, but it was on line 35. Cheers Ignatius - Original Message - From: "David Rice" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, January 23, 2003 8:53 PM Subject: [PHP-DB] need help s

Re: [PHP-DB] MySQL Query Question

2003-01-23 Thread Ignatius Reilly
It is safe to test if the divisor is zero: replace columnB/columnC by IF( columnC = 0, 0, columnB/columnC ) (the "0" could be anything else; this depends on your business logic) Ignatius - Original Message - From: "Jeremy" <[EMAIL PROTECTED]

Re: [PHP-DB] Import and export data from php/mysql

2003-01-24 Thread Ignatius Reilly
What is your problem exactly? Have you investigated the MySQL manual under: LOAD DATA INFILE SELECT ... INTO OUTFILE ? Ignatius - Original Message - From: "Bruno Pereira" <[EMAIL PROTECTED]> To: "PHP-db list" <[EMAIL PROTECTED]> Sent: Friday, J

Re: [PHP-DB] SQL: Limit 1 usage?

2003-01-30 Thread Ignatius Reilly
Doubly wrong PHP syntax. Try instead: $sql = "SELECT * FROM accessnums WHERE areacode='{$_POST['areacode']}' and city='{$_POST['cityselected']}' ORDER BY network LIMIT 1"; Ignatius - Original Message - From: "jason wesley upton" <[EMAIL PROTECT

Re: [PHP-DB] update

2003-02-04 Thread Ignatius Reilly
If you want to use WHERE clause, see the INSERT table SELECT ... syntax. Extremely convenient. You inherit all the flexibility of the SELECT statement. Ignatius - Original Message - From: "Doug Thompson" <[EMAIL PROTECTED]> To: "Ike Austin" <

Re: [PHP-DB] first 10 or so words

2003-02-14 Thread Ignatius Reilly
Or rather SUBSTRING_INDEX(str,delim,count) Because you want to use a custom delimiter (space, comma) Ignatius - Original Message - From: "Peter Lovatt" <[EMAIL PROTECTED]> To: "Bruce Levick" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thur

Re: [PHP-DB] printing repeat table headers

2003-02-16 Thread Ignatius Reilly
It is not easy to design a SQL query that will repeat headers every 33 rows. So this should be done in the PHP code. Why not use a counter, that you increment at every mysql_fetch_array() and test if !( $counter % 33 ) Side remarks: you could also define a CSS class for TH and use TH as headers.

Re: [PHP-DB] Web Page Caching

2003-02-17 Thread Ignatius Reilly
You can append to the URL a dummy variable that is sure to change every time: http://.../mypage?nocache= This will force the refresh. Ignatius - Original Message - From: "Philip Zee" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, Fe

Re: [PHP-DB] Grabbing emails into MySql

2003-02-24 Thread Ignatius Reilly
Investigate PHP's IMAP functions. Ignatius - Original Message - From: "Dave Carrera" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, February 25, 2003 8:09 AM Subject: [PHP-DB] Grabbing emails into MySql Hi All How would I go about

Re: [PHP-DB] Storing an array in the database

2003-02-28 Thread Ignatius Reilly
If your array is multidimensional, you could store it in a javascript-style: // get the print_r() // replace (recursively) all instances of "Array( .. )" by "[...]" If you ever plan to write a class or a function to do that, let me know! Ignatius -

Re: [PHP-DB] Help with a query

2003-03-07 Thread Ignatius Reilly
Still not good. Try: "SELECT a.item_id, a.subtotal, a.quantity FROM shopping_cart a, orders b WHERE b.session_id = ".session_id()." AND b.customer_id = $customer_id AND a.order_id = b.border_id" session_id() must be interpolated. Ignatius - Original Message - From: "Co

Re: [PHP-DB] I'm almost there! Just a little more help

2003-03-07 Thread Ignatius Reilly
You must use absolute path names "c:\\..." in copy(). As a matter of personal hygiene, I would not recommend to use file/ dir names containing spaces in your document root directory (or any place that the PHP user must have access). Why not try c:/apache/htdocs ? Ignatius - Original Message

Re: [PHP-DB] table relationship

2003-03-10 Thread Ignatius Reilly
Yes. You have to use the "subtype" relational design: USER user_id (PK) | | | || | |

Re: [PHP-DB] Dynamic Variable names

2003-03-11 Thread Ignatius Reilly
The way to go is: ${"tips_".$i} where $i is your increment control variable HTH Ignatius, Brussels "Where the fuck is Belgium?" (D. Ivester, CEO, Coca-Cola) - Original Message - From: "David Rice" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, March 09, 2003 1:34 PM Subject: [

Re: [PHP-DB] sorting problem...

2003-03-13 Thread Ignatius Reilly
Take a look at the MySQL DATE_FORMAT() function. Ignatius - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, March 13, 2003 2:43 PM Subject: [PHP-DB] sorting problem... > Hi All, > > I need to sort some da

Re: [PHP-DB] several pointers to records in one field

2003-03-18 Thread Ignatius Reilly
The standard relational way is a relationship table: children - FK_parentID (parent) FK_childrenID (child) PRIMARY KEY ( FK_parentID, FK_childrenID ) HTH Ignatius - Original Message - From: "Alain Barthélemy" <[EMAIL PROTECTED]> To: "ph

Re: [PHP-DB] Solidarity with the World View

2003-03-20 Thread Ignatius Reilly
Largely off topic palso. This mailing list does not care about what you have to say on this subject. It is a great professional tool for many of us, and does not need to be polluted. Ignatius - Original Message - From: <[EMAIL PROTECTED]> To: <

Re: [PHP-DB] database model

2003-06-04 Thread Ignatius Reilly
I have been using Dezign for Databases from Datanamic for several years. http://www.datanamic.com/ Not free, but invaluably helpful. I strongly recommend it. Ignatius - Original Message - From: "Snijders, Mark" <[EMAIL PROTECTED]> To: <[EMAIL P

Re: [PHP-DB] array fill/sort question

2003-06-11 Thread Ignatius Reilly
Another approach: 1. Load all results from the query in an array 2. Sort the array using a custom-defined user-defined comparison function ( usort() ). Study the example in the PHP manual. Writing your own comparison function is easy: - explode your IP addresses in 4 items each ( explode() ) - com

Re: [PHP-DB] Keeping entries of a select-box after submitting the form

2003-06-13 Thread Ignatius Reilly
What you can do is replicate all s with hidden fields: Al di Meola John McLaughlin ... ... But I fail to see why so doing would be useful. Your dynamic form is created after some query; therefore why not simply call the same query after submission to obtain all possible values of the options

Re: [PHP-DB] time without seconds

2003-06-17 Thread Ignatius Reilly
Check the TIME_FORMAT(time,format) MySQL function. Ignatius _ - Original Message - From: "Lisi" <[EMAIL PROTECTED]> To: "PHP-DB" <[EMAIL PROTECTED]> Sent: Tuesday, June 17, 2003 1:16 PM Subject: [PHP-DB] time without seconds > If I have a time stored in MySQL, and

Re: [PHP-DB] MySQL editor

2003-06-19 Thread Ignatius Reilly
Try also DBTools (forWindows). Very nice. Been using for 2 years, and happy about it. http://www.dbtools.com.br/EN/ Ignatius _ - Original Message - From: "Achilles Maroulis" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, June 19, 2003 10:46 AM Subject:

Re: [PHP-DB] checking a string for numbers

2003-06-26 Thread Ignatius Reilly
$extract = preg_replace( "/[^0-9]/", "", $str ) // will extract the figures from your string HTH Ignatius _ - Original Message - From: "Jamie Saunders" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, June 26, 2003 1:04 PM Subject: [PHP-DB] checking a s

Re: [PHP-DB] mssql and Apache 1.3.28 and Win2k

2003-08-06 Thread Ignatius Reilly
I don't know the reason (perhaps OS-based, since tables are implemented as eponymous files), but it was a pretty awful idea to allow special chars in names in the first place. you probably have only two options, equally unpleasant: - rename your tables and columns - back-tick all your non-standard

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

2003-08-14 Thread Ignatius Reilly
Your SQL looks legal (at least for MySQL). Probably a PHP error then. Do a die( $query ) to see if the query is well-formed and $thisID correctly interpolated. Personnally I would rather write: $query=" UPDATE Choice SET visits = visits + 1 WHERE ID = {$thisID} ; " [if ID is o

Re: [PHP-DB] Breaking down a table field....

2003-08-14 Thread Ignatius Reilly
SELECT DISTINCT unit... Ignatius _ - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, August 07, 2003 3:37 PM Subject: [PHP-DB] Breaking down a table field > I have a table, wth many entries. > Each entry has been asigned a

Re: [PHP-DB] Queries probably timing out

2003-08-19 Thread Ignatius Reilly
- Original Message - From: "Dillon, John" <[EMAIL PROTECTED]> To: "PHP-DB List" <[EMAIL PROTECTED]> Sent: Tuesday, August 19, 2003 11:47 AM Subject: [PHP-DB] Queries probably timing out I'm doing queries on tables with 45,000 rows in one table and 1-2000 rows in a

Re: [PHP-DB] Need For SPEED

2003-08-21 Thread Ignatius Reilly
Sorry I don't seem to get it. 1. What is"the import function provided in PHPList" ? 2. What do you mean by "initialize each data record " ? Ignatius _ - Original Message - From: "Creigh Shank" <[EMAIL PROTECTED]> To: &

Re: [PHP-DB] MySQL, PHP or ghost?

2003-08-27 Thread Ignatius Reilly
Read the MySQL manual. "0" value is interpreted as 2000. Your empty string is converted to an integer, thus 0. HTH Ignatius _ - Original Message - From: "Peter Beckman" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, August 27, 2003 3:39 AM Subject: [P

Re: [PHP-DB] MySQL, PHP or ghost?

2003-08-28 Thread Ignatius Reilly
e logical. I have no quarrel with this behaviour. Ignatius _ - Original Message - From: "Peter Beckman" <[EMAIL PROTECTED]> To: "Ignatius Reilly" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, August 27, 2003 4:13 PM

Re: [PHP-DB] Simple field replace...?

2003-08-28 Thread Ignatius Reilly
hundreds of what? rows or columns? Ignatius _ - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, August 28, 2003 11:35 AM Subject: [PHP-DB] Simple field replace...? > Hi there, > I need to take a field in my database, and remove

Re: [PHP-DB] Simple field replace...?

2003-08-28 Thread Ignatius Reilly
Then a simple substring will do: UPDATE mytable SET url = SUBSTRING( url FROM 5 ) btw your date column looks pretty awful. HTH Ignatius _ - Original Message - From: <[EMAIL PROTECTED]> To: "Ignatius Reilly" <[EMAIL PROTECTED]> Cc: &l

Re: [PHP-DB] MySQL, PHP or ghost?

2003-08-28 Thread Ignatius Reilly
(I do not know what SQL-92 says about this). Therefore data validation should be done outside MySQL. Ignatius _ - Original Message - From: "Martin Marques" <[EMAIL PROTECTED]> To: "Ignatius Reilly" <[EMAIL PROTECTED]>; "Peter Bec

Re: [PHP-DB] MySQL, PHP or ghost?

2003-08-28 Thread Ignatius Reilly
You may decide that another RDBMS may suit your needs better. Someone told me that Oracle is quite nice. Ig _ - Original Message - From: "Martin Marques" <[EMAIL PROTECTED]> To: "Ignatius Reilly" <[EMAIL PROTECTED]>; "Peter

Re: [PHP-DB] SELECT Part of a Field

2003-08-29 Thread Ignatius Reilly
SUBSTRING() _ - Original Message - From: "Shaun" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, August 29, 2003 11:57 AM Subject: [PHP-DB] SELECT Part of a Field > Hi, > > How can I SELECT a portion of a field in a table for example the first > charac

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

2003-08-29 Thread Ignatius Reilly
You should be very wary of the CREATE TABLE ... SELECT statement. >From experience, the types created are not always conform to intuition - I've had my share of nasty surprises Much safer to do a CREATE TABLE statement defining the column types, then do an INSERT INTO ... SELECT Ignatius

Re: [PHP-DB] Need For SPEED

2003-08-21 Thread Ignatius Reilly
What is your data load method? What is the type of your table(s)? With LOAD DATA and text files, I load several million rows in about a minute. Also please don't cross-post. Better first find out what the most suitable mailing list is. Ignatius _ - Original Message --

Re: [PHP-DB] UNION Clause in queries

2003-08-31 Thread Ignatius Reilly
UNION appeared in MySQL 4.0.0 Mayhap your provider has not yet upgraded. There is no such thing as disabling/ granting UNION. HTH Ignatius _ - Original Message - From: "John Ryan" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, August 31, 2003 8:58 PM Sub

Re: [PHP-DB] all files in a directory

2003-09-05 Thread Ignatius Reilly
There are many good user-contribued examples in the online PHP manual at function readdir() Ignatius _ - Original Message - From: "FB" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, September 05, 2003 11:55 AM Subject: [PHP-DB] all files in a directory

Re: [PHP-DB] MySQL: How to properly extract fields from retrieved single record ???

2003-09-22 Thread Ignatius Reilly
read the PHP manual and examples under the function mysql_fetch_array(). I find the MySQL manual is very well done and helpful. I've been using it as a reference for 2 years. Take a harder look! Ignatius _ - Original Message - From: "-{ Rene Brehmer }-" <[EMAIL PRO

Re: [PHP-DB] update db with variables

2003-09-24 Thread Ignatius Reilly
Quotes missing around $value. Try instead: mysql_query( "UPDATE tablename SET {$name} LIKE '{$value}' WHERE ID={$id}") Of course, even though the code does not show, you have properly validated user input before firing this query... HTH Ignatius _ - Original Message -

Re: [PHP-DB] mySQL vs pgSQL | php vs others

2003-09-24 Thread Ignatius Reilly
Yeah, banking is too serious a business in Argentina, as everybody knows, to entrust to MySQL. Ignatius _ - Original Message - From: "Martin Marques" <[EMAIL PROTECTED]> To: "nabil" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, September 24, 2003 9:24 PM

Re: [PHP-DB] Re: Email Application

2003-09-25 Thread Ignatius Reilly
If your mail server supports IMAP, you should use the PHP IMAP functions. Very convenient. Ignatius _ - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, September 24, 2003 11:42 PM Subject: [PHP-DB] Re: Email Application > Hey

Re: [PHP-DB] Round a number

2003-10-03 Thread Ignatius Reilly
SELECT TRIM( TRAILING '.' FROM TRIM( TRAILING '0' FROM mycol ) ) Ignatius _ - Original Message - From: "Shaun" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, October 03, 2003 5:12 PM Subject: [PHP-DB] Round a number > Hi, > > I have a query that r

Re: [PHP-DB] Round a number

2003-10-03 Thread Ignatius Reilly
l Message ----- From: "Ignatius Reilly" <[EMAIL PROTECTED]> To: "DB list PHP" <[EMAIL PROTECTED]>; "Shaun" <[EMAIL PROTECTED]> Sent: Friday, October 03, 2003 5:27 PM Subject: Re: [PHP-DB] Round a number > SELECT > TRIM( TRA

Re: [PHP-DB] REGEXP and Variables.

2003-10-09 Thread Ignatius Reilly
Can't you do without REGEX? eg WHERE employ_id = '($employ_id)' OR company LIKE '($name)' REGEXes are expensive. Ignatius _ - Original Message - From: "Shannon Doyle" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, October 09, 2003 10:18 AM Subject: [

Re: [PHP-DB] MySQL Regular expression

2003-10-09 Thread Ignatius Reilly
Problem is, REGEX will only test for a match, not returning anything other than 0|1 You can instead: 1. Use a UDF doing just that (counting occurences in a string): http://www.tsc.ro/free/ (haven't tried it myself, because no Windows dll available) 2. Replace successively all figures by '' and c

Re: [PHP-DB] pass by reference

2003-10-09 Thread Ignatius Reilly
Specify it only at function definition: myFunction( &$var1, &$var2 ) { // ... } $var = myFunction( $var1, $var2 ) ; Ignatius _ - Original Message - From: "Jeremy Shovan" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, October 09, 2003 9:54 PM Subjec

Re: [PHP-DB] TIME FORMAT USING PHP

2003-10-11 Thread Ignatius Reilly
$time = "0900" ; $time2 = substr( $time, 0, 2 ).":".substr( $time, 2, 2 ) ; Ignatius _ - Original Message - From: "Delz" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, October 11, 2003 7:17 AM Subject: [PHP-DB] TIME FORMAT USING PHP > Hi All, > > We h

Re: [PHP-DB] query for multiple values

2003-10-15 Thread Ignatius Reilly
SELECT * FROM table WHERE column IN ( 'this', 'that', 'theother' ) Ignatius _ - Original Message - From: "Robbie Staufer" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, October 16, 2003 12:10 AM Subject: [PHP-DB] query for multiple value

Re: [PHP-DB] Multiple forms and multiple submissions

2003-10-18 Thread Ignatius Reilly
One solution is to use a javascript to set your hidden field to "already_submitted" (or such) at the end of the last form page. Therefore upon refresh, the user will come to the "already submitted" page. Add one "already submitted" switch case. BTW your construct switch ( ) { } else is quite non-

Re: [PHP-DB] Using two colomns of mysql data as key/value pairs in arrays

2003-10-20 Thread Ignatius Reilly
mysql_fetch_array( $result ) _ - Original Message - From: "Devon" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, October 20, 2003 3:30 PM Subject: [PHP-DB] Using two colomns of mysql data as key/value pairs in arrays > I have been scouring the online do

Re: [PHP-DB] Using two colomns of mysql data as key/value pairs in arrays

2003-10-20 Thread Ignatius Reilly
Easy, old boys. Nobody has "holed" or meant to hole anybody. Let's keep this ML what it is, that is a great learning and working instrument. Ignatius _ - Original Message - From: "Jon Kriek" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, October 20, 2003

Re: [PHP-DB] date function

2003-11-02 Thread Ignatius Reilly
have a look at the PEAR date package. http://pear.php.net/package/Date _ - Original Message - From: "OpenSource" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, November 02, 2003 11:13 PM Subject: [PHP-DB] date function Hi guys, This might not be the be

Re: [PHP-DB] Select Value with 's

2003-11-06 Thread Ignatius Reilly
SQL. Backticks force reading the string as a SQL object (db, table, column), as opposed to a string. Eg you could in theory have columns called "select" or "Mes Documents", and do: SELECT * FROM `select` AS S, `Mes Documents`AS MD ... of course it is wholly unadvisable to do so. Best to steer cl

Re: [PHP-DB] dynamic graph on web site

2003-11-10 Thread Ignatius Reilly
The jpgraph library is what you're looking for. _ - Original Message - From: "Hull, Douglas D" <[EMAIL PROTECTED]> To: "Note To php mysql List (E-mail)" <[EMAIL PROTECTED]> Sent: Monday, November 10, 2003 8:36 PM Subject: [PHP-DB] dynamic graph on web site In php/

Re: [PHP-DB] Splitting a CSV file

2003-11-25 Thread Ignatius Reilly
You may have hit the browser time-out limit, which you can not control (at least for IE; don't know about others). To prevent this, arrange for the script send regularly some invisible content to the browser (eg send a HTML comment line every 100 lines of your CSV file) HTH Ignatius _

Re: [PHP-DB] php / xml

2003-11-26 Thread Ignatius Reilly
The standard way is XSLT, for which PHP has excellent support. However, it takes some effort to learn the language. Get yourself "XSLT" by Michael Kay, Wrox Press. HTH Ignatius _ - Original Message - From: "stefan bogdan" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]

Re: [PHP-DB] PHP and XML Parsing

2003-11-26 Thread Ignatius Reilly
If your "&" is meant as a content data, as opposed to an entity call, then your XML is probably not valid. To write "&" as a character, you can either: - use & directly - declare an & entity having the value & and write & in your document HTH Ignatius _ - Original Mess

Re: [PHP-DB] convert date in german format

2003-11-26 Thread Ignatius Reilly
at the top of your script, do: setlocale ( LC_TIME, 'de_DE' ) ; (assumes your machine has German support installed) HTH Ignatius _ - Original Message - From: "Ruprecht Helms" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, November 26, 2003 16:58 Subje

Re: [PHP-DB] Updating multilple tables?

2003-11-27 Thread Ignatius Reilly
One possible reason you did not google back anything is that what you are asking can't be done in SQL. In SQL you can update only one table at a time. Why not write a PHP function that does the job successively on each table? To list tables in MySQL: SHOW TABLES FROM HTH Ignatius __

Re: [PHP-DB] Updating multilple tables?

2003-11-27 Thread Ignatius Reilly
nother table. Ignatius _ - Original Message - From: <[EMAIL PROTECTED]> To: "Ignatius Reilly" <[EMAIL PROTECTED]> Cc: "PHP DB list" <[EMAIL PROTECTED]> Sent: Thursday, November 27, 2003 16:02 Subject: Re: [PHP-DB] Updating multilple tables? > All go

Re: [PHP-DB] Fonction timer

2003-12-02 Thread Ignatius Reilly
PHP est un langage de programmation, pas un daemon. Le plus simple est de créer des tâches automatisées qui exécutent des scripts PHP. Sous Windows 2000 c'est très facile: Scheduled Task > Command prompt > (terminer) Ensuite tu édites la scheduled task: Properties > Run > c:/php/php.exe c:/tasks/m

Re: [PHP-DB] Fonction timer

2003-12-02 Thread Ignatius Reilly
Dear friend, you're besides the point and needlessly condescending. Michel was asking about something very different: PHP cron jobs, not time intervals. Ignatius _ - Original Message - From: "Ivan Fomitchev" <[EMAIL PROTECTED]> To: "Michel GUIRAUDOU" <[EMAIL PROTECT

Re: [PHP-DB] Redirect.

2003-12-02 Thread Ignatius Reilly
header( "Location: http://..."; ) ; _ - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, December 02, 2003 12:18 Subject: [PHP-DB] Redirect. Hi all, I have a problem.How can I redirect from a PHP script to another script in asp,

Re: [PHP-DB] calculations using variables in html table cell

2003-12-03 Thread Ignatius Reilly
If you have to build complex, dynamic tables, do yourself a favour and use a class that will allow you to feed directly arrays of numbers. I use PEAR HTML_Table, which is great and easy to use. You will have recouped the investment of learning the class after about one hour. HTH Ignatius _

Re: [PHP-DB] multi-language site

2004-01-15 Thread Ignatius Reilly
I would not consider a DB-based design. I use two approaches (sometimes mixed): 1. Write content in XML files (one per language) and transform them with XSLT. This is nice for mostly content-based sites. 2. Write the complete application in English and translate it with the excellent PHP gettext

Re: [PHP-DB] multi-language site

2004-01-15 Thread Ignatius Reilly
ent, they'll send you a Spanish one back without messing > with your tags - only the content gets translated. > > Of course, it DOES all come down to dollars and cents and how important the > translation really is; only you can decide that. > > HTH > > Rich >

Re: Re[2]: [PHP-DB] multi-language site

2004-01-15 Thread Ignatius Reilly
Quite right. When implementing gettext, one will normally use the rule 1 string = 1 sentence (such as "please select a country"). _ - Original Message - From: "Richard Davey" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, January 15, 2004 19:48 Subject

[PHP-DB] Re: L'utente Fabio Farinelli ha cambiato indirizzo di posta elettronica.

2004-01-15 Thread Ignatius Reilly
Somebody with admin rights to this list please castrate this Farinelli user. Thanks _ - Original Message - To: "Ignatius Reilly" <[EMAIL PROTECTED]> Sent: Thursday, January 15, 2004 20:22 Subject: L'utente Fabio Farinelli ha cambiato indirizzo

Re: [PHP-DB] multi-language site

2004-01-16 Thread Ignatius Reilly
extremely powerful. In addition you can use XSLT if the news are stored as XML strings in the DB. HTH Ignatius _ - Original Message - From: "Muhammed Mamedov" <[EMAIL PROTECTED]> To: "Ignatius Reilly" <[EMAIL PROTECTED]>; "phpdb"

Re: [PHP-DB] multi-language site

2004-01-16 Thread Ignatius Reilly
Usually it is the other way round: to assemble a page, a script will call successively several XSLT transformations: eg top, left nav bar, central content, footer... Each XSLT call returns HTML from content stored in XML. Ignatius > > I also wonder if XSLT can accept any php code? > > -- PHP Dat

Re: [PHP-DB] MySQL general Question...

2004-01-16 Thread Ignatius Reilly
Standard SQL for comparing strings is LIKE '=' in lieu of 'LIKE' is a MySQL extension to SQL, therefore non-standard. Ignatius _ - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, January 16, 2004 15:39 Subject: [PHP-DB] MySQL gener

Re: [PHP-DB] multi-language site

2004-01-16 Thread Ignatius Reilly
The same can be achieved in a much simpler way with Gettext! With gettext, you send a file to your translator, and receive the same file completed. Period. Instead of logging to a DB, the translator simply creates string translations with a user-friendly editor, such as the excellent POEdit (http:

Re: [PHP-DB] counting a value

2004-01-30 Thread Ignatius Reilly
SELECT favourite_nb, COUNT(*) AS tally FROM mytable GROUP BY favourite_nb HTH Ignatius _ - Original Message - From: "js" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, January 30, 2004 19:07 Subject: [PHP-DB] counting a value i want to know what i can u

Re: [PHP-DB] Row count in a query

2004-01-31 Thread Ignatius Reilly
The best way I can think of is: - create a temporary table T with an autoincrement field + desired output column structure - perform a INSERT INTO T SELECT 0, in the temp table - you now have the desired result in your temp table HTH Ignatius _ - Original Message -

Re: [PHP-DB] Row count in a query

2004-01-31 Thread Ignatius Reilly
Hmmm... I would not bet money on John Holmes bad coding. (disclaimer: I have no financial stake in PHP|A, other than being a happy subscriber) More likely the original question was not well formulated. cheers Ignatius _ - Original Message - From: "Martín Marqués" <

Re: [PHP-DB] From MySQL to EXCEL

2004-02-02 Thread Ignatius Reilly
C'est possible! I use the PEAR Spreadsheet_Excel_Writer for this purpose. Very nice. HTH Ignatius _ - Original Message - From: "Christine Clerc" <[EMAIL PROTECTED]> To: "PHP DB list" <[EMAIL PROTECTED]> Sent: Monday, February 02, 2004 11:02 Subject: [PHP-DB] From

Re: [PHP-DB] Associated popup menu (php/mysql)

2004-02-06 Thread Ignatius Reilly
By "pop-up" do you really mean "pop-up" or rather drop-down boxes? Have a look at the PEAR Quickform class and its "hierselect" form element (hierarchical dropdown boxes) http://pear.php.net/manual/en/package.html.html-quickform.tutorial.php HTH Ignatius _ - Original M

Re: [PHP-DB] Acessing a excel worksheet from a php site

2004-02-06 Thread Ignatius Reilly
Check this class: http://sourceforge.net/projects/phpexcelreader/ HTH Ignatius _ - Original Message - From: "Griffiths, Daniel" <[EMAIL PROTECTED]> To: "Bruno Pereira" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, February 06, 2004 10:10 Subject: RE: [PHP-D

Re: [PHP-DB] Rules in a database

2004-02-06 Thread Ignatius Reilly
A bit of algebra first: any expression formed of atomic expressions, AND, OR and parentheses can be reduced to a "canonical" form, by using the De Morgan laws: a AND ( b OR c ) is equiv. to a AND b OR a AND c So a rule can eventually be reduced to "AND" groups, joined by "OR": a(1) AND... AND a(n

Re: [PHP-DB] Question

2004-02-07 Thread Ignatius Reilly
Quotes: $_POST['testField'] _ - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, February 07, 2004 20:36 Subject: [PHP-DB] Question > Dear friends, > > On submitting form to mysql database I get a parse error,There is no problem

Re: [PHP-DB] FW: db design - which is better

2004-02-07 Thread Ignatius Reilly
Use the second design. SQL 101 / 1st normal form. _ - Original Message - From: "mayo" <[EMAIL PROTECTED]> To: "php-db" <[EMAIL PROTECTED]> Sent: Saturday, February 07, 2004 23:19 Subject: [PHP-DB] FW: db design - which is better > > > -Original Message- > F

Re: [PHP-DB] Rules in a database

2004-02-07 Thread Ignatius Reilly
k that the required monomes have been associated as a complex rule. HTH (hope I am right! - not tested) Ignatius _ - Original Message - From: "John Dillon" <[EMAIL PROTECTED]> To: "Ignatius Reilly" <[EMAIL PROTECTED]> Sent: Saturday, February

Re: [PHP-DB] FW: db design - which is better

2004-02-07 Thread Ignatius Reilly
k with. A few hundred to a few thousand records, maybe 20 fields, > rarely adding another field. > > I wonder sometimes whether it make sense to put everything in one table > instead of using joins. > > yours, putting-his-foot-in-his-mouth, > > Gil > > > > -O

Re: [PHP-DB] FW: db design - which is better

2004-02-07 Thread Ignatius Reilly
the data comes from one table. > > This would be probably very stupid in a financial or medical database which > has tens of millions of records and 100s if not 1000s of tables but SEEMS > (I'm very open to being corrected) to work better on a fairly small web > accessed datab

Re: [PHP-DB] Help With An UPDATE Query Please

2004-02-10 Thread Ignatius Reilly
UPDATE table SET column = CONCAT( MID( column, 2, LENGTH( column ) - 1 ), MID( column, 1, 1 ) ) WHERE column LIKE 'M%' HTH Ignatius _ - Original Message - From: "Shaun" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, February 10, 2004 14:15 Subjec

Re: [PHP-DB] Brick Codes

2004-02-17 Thread Ignatius Reilly
Hmmm... Better try: WHERE (LEFT( Brick,3) = LEFT(`Post Code`,3)) ^^ no quotes^^ back ticks (because of the space in the column name) HTH Ignatius _ - Original Message - From: "Ricardo Lopes" <[EMAIL PROTECTED]> To: "Shaun" <[EMAIL PR

Re: [PHP-DB] SUM and JOIN together

2004-02-18 Thread Ignatius Reilly
Unless you are using 4.1 (which allows subqueries), you should perform 3 queries, the first 2 creating temporary tables: - sum - difference - left join Ignatius _ - Original Message - From: "rogue" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, February

<    1   2   3   >