Re: [PHP-DB] Database question

2002-08-21 Thread Ignatius Reilly
important design stuff that you won't find in web tutorials. Ignatius Reilly - Original Message - From: Shiloh Madsen To: [EMAIL PROTECTED] Sent: Wednesday, August 21, 2002 1:34 AM Subject: [PHP

Re: [PHP-DB] Charts...

2002-08-21 Thread Ignatius Reilly
for SVG templates for making dynamical plot and line charts; I haven't found much on the web. Can anyone help? Thanks Ignatius Reilly - Original Message - From: James Hatridge To: PHP_DB Sent

Re: [PHP-DB] Indepth Tutorial... need help.

2002-09-03 Thread Ignatius Reilly
For a SQL tutorial, I would recommend that you get yourself a copy of Joe Celko's SQL for smarties. Best investment I ever made. Everything you need to know is there. Bon courage! - Original Message - From: Matt Zur [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, September 03,

Re: [PHP-DB] One last step

2002-09-03 Thread Ignatius Reilly
Try SELECT name, COUNT(*) AS nb FROM mytable GROUP BY name ORDER BY nb DESC Ignatius RClark [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello all, I have a MySQL database with some 2 million rows in it. I am counting all of the different names in one

Re: [PHP-DB] Upload csv file into mysql

2002-09-04 Thread Ignatius Reilly
Hi Dr, try: LOAD DATA INFILE myfile.csv INTO TABLE mytable FIELDS TERMINATED BY , LINES TERMINATED BY \r\n ; of course, the structure of your CSV file must match exactly that of your table. hth - Original Message - From: Dr. Indera [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent:

Re: [PHP-DB] Upload csv file into mysql

2002-09-04 Thread Ignatius Reilly
Message - From: Karel Pøíbramský [EMAIL PROTECTED] To: Ignatius Reilly [EMAIL PROTECTED]; [EMAIL PROTECTED]; Dr. Indera [EMAIL PROTECTED] Sent: Wednesday, September 04, 2002 10:33 AM Subject: RE: [PHP-DB] Upload csv file into mysql Hi this is very helpful to me what if i have TABLE (id_item

Re: [PHP-DB] Form question.......

2002-09-05 Thread Ignatius Reilly
Another way is to refresh the page everytime the user has filled a field in and moves to another: FORM name=myform INPUT type =text name=field1 value= onchange=javascript:submit_field( 1 ) INPUT type=hidden name=field_to_check value= SCRIPT language=JavaScript function submit_field( i ) {

Re: [PHP-DB] php - checkboxes - mysql

2002-09-10 Thread Ignatius Reilly
Try something like this: INPUT type=checkbox name=?php echo( $row['name'] ) ; ? value=1 ?php echo( $row['homeno'] == 0 ? : checked ) ; ? (value is a dummy value - HTML will POST the name=value pair only if checked.) HTH Ignatius

Re: [PHP-DB] Trying to speed up php output from mysql

2002-09-17 Thread Ignatius Reilly
Does your process hang or simply is too long? Perhaps the limiting factor is not the writing speed, but a memory requirement problem. Try to compute how long it should take: - do your row processing after a SELECT ... LIMIT 1000 clause - time how long it takes, and extrapolate Then you will

Re: [PHP-DB] joining 2 tables - help please..

2002-09-18 Thread Ignatius Reilly
Try: SELECT C.category_name, SUM( IF( ISNULL( P.product_ID ),0, 1) ) AS total FROM category AS C LEFT JOIN product AS P ON C.category_ID = P.category_ID GROUP BY C.category_ID Ignatius - Original Message - From: [EMAIL PROTECTED] To: [EMAIL

Re: [PHP-DB] SQL update help

2002-09-21 Thread Ignatius Reilly
When in doubt, bracket : $sql = UPDATE $table SET pages = '{$PHP_SELF}' WHERE session = '{$holy_cow}'; Less cute, but more readable. Ignatius - Original Message - From: Dave Smith [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday,

Re: [PHP-DB] Flush database

2002-09-27 Thread Ignatius Reilly
why not simply store the server time at log in in the DB after a successful log in together with the IP address; and at the next log in request perform a SQL time difference comparison? Ignatius - Original Message - From: wade [EMAIL

Re: [PHP-DB] results of query

2002-10-07 Thread Ignatius Reilly
It depends what you want to do with it. To display it in HTML, you can write them in a 2-D array: myarray[$i][$j], where $i is the row nb and $j the column nb, and write two nested loops. To export them to Access, CSV, ... you can issue your query through Access ODBC. You can then save as a

Re: [PHP-DB] Javascript

2002-10-11 Thread Ignatius Reilly
I have met this problem before. The only solution I have found is to assign 0 values to the INPUT tags: input type=text name=field1 addChange=add(); value=0 HTH Ignatius - Original Message - From: Shahmat Dahlan [EMAIL PROTECTED] To: [EMAIL

Re: [PHP-DB] Javascript

2002-10-11 Thread Ignatius Reilly
' Field2='1' Field3='2' Field1+Field2+Field3 = '012' If you use Field1=Number('0') Field2=Number('1') Field3=Number('2') Field1+field2+field3 = 3 Cheers Simon -Original Message- From: Ignatius Reilly [mailto:[EMAIL PROTECTED]] Sent: 11 October 2002 15:48 To: Shahmat Dahlan

Re: [PHP-DB] MySQL REGEXP functionality... any way to make this easier?

2002-10-14 Thread Ignatius Reilly
If you want to generalize the process to a n-set, a recursion method is clearly required. XSLT looks the best candidate to me to do this. I will tackle it when I find some time. Cheers Ignatius - Original Message - From: Xepherys [EMAIL

Re: [PHP-DB] desperate need for MySQL host

2002-10-15 Thread Ignatius Reilly
I know and use a very good one, if you can understand French: www.ovh.net Free PHP, MySQL, XSLT support. Ignatius - Original Message - From: Seabird [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 15, 2002 9:46 PM Subject:

Re: [PHP-DB] Variable won't be passed from HTTP address bar

2002-10-18 Thread Ignatius Reilly
Try instead: if( $_POST['action'] ==test ){ echo Test;} HTH Ignatius - Original Message - From: Michel Bakkenes - bakkenes.net [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, October 18, 2002 1:26 PM Subject: [PHP-DB] Variable won't be

Re: [PHP-DB] Custom Sort Order in MySQL

2002-10-19 Thread Ignatius Reilly
You can use an auxiliary lookup table: FK_mygraderank - Secret1 A+ 2 ... Now join this table to your SELECT query on FK_mygrade, add 'rank' to the SELECT items, and ORDER BY rank HTH Ignatius

Re: [PHP-DB] printing an array

2002-10-24 Thread Ignatius Reilly
Hi, usually, one issues an HTML row for each row of the query result. BTW, don't forget TR elements! But your query results has only one row, and your table has 4 columns. Can you explain in more detail what you want to do? Ignatius - Original

Re: [PHP-DB] Re: [PHP] Enum table entry

2002-10-19 Thread Ignatius Reilly
Hi, in some cases, you might prefer to use a multiple SELECT element; this can give you a much more compact user interface (though you probably won't use it if you have 40 options ...) It goes like this: SELECT multiple name=action[] size=5 OPTION value=0

Re: [PHP-DB] Getting rows where column has changed?

2002-10-27 Thread Ignatius Reilly
How often in a day must you do this? Every 5mn? Ignatius - Original Message - From: Leif K-Brooks [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, October 27, 2002 7:33 AM Subject: [PHP-DB] Getting rows where column has changed? I'm

Re: [PHP-DB] Date and time issues

2002-11-04 Thread Ignatius Reilly
If you are using MySQL, you may profitably investigate the function DATE_ADD( date, INTERVAL ) Ignatius J. Reilly - Original Message - From: Frederik Feys [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 04, 2002 10:32 PM Subject:

Re: [PHP-DB] Idea as to why this query won't work as expected?

2002-11-05 Thread Ignatius Reilly
AND/ OR precedence mistake. Your query will return all the rows for which order_status='Not Shipped' Probably what you want is: select * FROM OrderTable WHERE submitted=1 AND dateinserted='1036386000' AND dateinserted='1036502796' AND ( order_status='Shipped' OR order_status='Not Shipped' )

Re: [PHP-DB] sort by date

2002-11-06 Thread Ignatius Reilly
Good point. Tell me and I forget, show me and I remember, involve me and I understand Ignatius - Original Message - From: Snijders, Mark [EMAIL PROTECTED] To: 'Marco Tabini' [EMAIL PROTECTED]; Terry Romine [EMAIL PROTECTED] Cc: [EMAIL

Re: [PHP-DB] mysql_fetch_array() question

2002-11-06 Thread Ignatius Reilly
John is right. In fact one routinely calls two different $result(s) when coding nested loops: while( $details = mysql_fetch_array( $result ) ) { while ( $Email = mysql_fetch_array( $result2 ) ) .. } } when executing the next instance of your loop: while( $details = mysql_fetch_array(

Re: [PHP-DB] Structure Question...

2002-11-07 Thread Ignatius Reilly
You have to create a table: CREATE TABLE product_categ ( FK_productID definition, FK_categID definition ) and list all relationships productID belongs to categID Ignatius - Original Message - From: Doug Coning [EMAIL PROTECTED] To: [EMAIL

Re: [PHP-DB] Extracting column names from a db

2002-11-10 Thread Ignatius Reilly
A mix-up in your loop. Try: while ( $row = mysql_fetch_array( $result ) ) { echo $row['Field'] ; } (you may just as well use the field names provided by SHOW COLUMNS - more readable than numerical indexes) HTH Ignatius - Original Message

Re: [PHP-DB] php array max value pr. year

2002-11-11 Thread Ignatius Reilly
Hi Martin, I am sure that many would love to help you, but really you must explain your problem more clearly! Can you give more details? Ignatius - Original Message - From: Martin Allan Jensen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent:

Re: [PHP-DB] arrays db

2002-11-11 Thread Ignatius Reilly
Why don't you want to do this with SQL? Ignatius - Original Message - From: Martin Allan Jensen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 11, 2002 2:48 PM Subject: [PHP-DB] arrays db Okey people, i try again!! I

[PHP-DB] Re: [PHP-WIN] update tablename

2002-11-12 Thread Ignatius Reilly
You can not do it directly. You have to create a new table as a copy of the old one: CREATE TABLE new_table SELECT * FROM old_table Your problem will be that the MySQL PHP user will probably not have the CREATE rights. Ignatius Rodrigo San Martin

Re: [PHP-DB] array sorting

2002-11-12 Thread Ignatius Reilly
Just loop through the first index, then search on the second index: while ( list( $key, $value ) = each( $my_arr ) ) { // now $value is your ( [0] = 10 [1] = 40 [2] = 50 [3] = 80 [4] = 130 [5] = 220 [6] = 320 ) array // sort your array by values sort( $value ) ; // get the last

Re: [PHP-DB] HTML Forms question...

2002-11-19 Thread Ignatius Reilly
Great piece of advice Mike. Thanks. Far from obvious. I was stuck with this problem since a few days. Will that also apply to n-dimensional array, like: document.form[system[]][0][1] ? Ignatius - Original Message - From: Ford, Mike [LSS]

Re: [PHP-DB] $_get 2 variables

2002-11-19 Thread Ignatius Reilly
http://localhost/myscript.php?var1=blahvar2=blah2 Ignatius - Original Message - From: Gavin Amm [EMAIL PROTECTED] To: Php-Db (E-mail) [EMAIL PROTECTED] Sent: Wednesday, November 20, 2002 7:30 AM Subject: [PHP-DB] $_get 2 variables Hi, I'm

Re: [PHP-DB] standart variabels melfunction

2002-11-19 Thread Ignatius Reilly
Martin, what you are experiencing is the normal way to call form variables. There is no problem. You should use register_globals=Off whenever possible. better security. Ignatius - Original Message - From: Beau Lebens [EMAIL PROTECTED] To:

Re: [PHP-DB] FW: Selecting not on DB

2002-11-20 Thread Ignatius Reilly
You could create an auxiliary table nb_1_10 containing a field nb with all integers from 1 to 10 Then perform a SELECT join: SELECT nb_1_10.* FROM ABC, nb_1_10 WHERE nb_1_10.nb NOT IN ABC.number AND some condition that returns only one row from ABC - like here (1,4,6,10) Ignatius

Re: [PHP-DB] Undefined Constant

2002-11-26 Thread Ignatius Reilly
Well, is there an input field in your form whose name corresponds to .?= $row[price]; ? ? It is more likely that if you have a dynamic form your fields will be called by a ID identifier, like INPUT name=1012price is 12 EUR Where 12 is the price of grommet with ID 1012 in your DB So perhaps your

Re: [PHP-DB] Help with date

2002-11-28 Thread Ignatius Reilly
If you use MySQL: SELECT DATE_ADD( $my_date, INTERVAL n DAY ) AS new_date ; Ignatius - Original Message - From: Dankshit [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED]; PHP1 [EMAIL PROTECTED] Sent: Thursday, November 28, 2002 6:06 PM Subject:

Re: [PHP-DB] mysql - enum

2002-12-02 Thread Ignatius Reilly
DESCRIBE tbl_name col_name Ignatius - Original Message - From: Bastian Vogt [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, December 02, 2002 1:41 PM Subject: [PHP-DB] mysql - enum Hi, is it possible to get all possible values of

Re: [PHP-DB] displaying duplicate records...

2002-12-04 Thread Ignatius Reilly
I do not understand your first question. Your query in effect shows duplicates. To prevent future duplicates, you can do it in two ways: 1. with MySQL: create a unique index on what should be unique, most likely the email (it looks like your business logic implies one entry per email) in fact

Re: [PHP-DB] displaying duplicate records...

2002-12-04 Thread Ignatius Reilly
address? Ignatius Reilly [EMAIL PROTECTED] wrote in message 030801c29b8b$8bd88ee0$015a@server">news:030801c29b8b$8bd88ee0$015a@server... I do not understand your first question. Your query in effect shows duplicates. To prevent future duplicates, you can do it in two way

Re: [PHP-DB] I got this idea...

2002-12-04 Thread Ignatius Reilly
Well, we can only offer very general guidelines at this stage. What you can do is write a script that: - call all the URLs showing paintball prices (btw what is a paintball?) - extract the product name and price. this will require a specific REGEX for each URL called, and regular testing vs

Re: [PHP-DB] calling function on submit instead of going to a new script

2002-12-04 Thread Ignatius Reilly
Simply append a parameter to the URL: action=same_page.php?selector=1 your script will take various actions based on a switch: switch $_POST['selector'] { case 1 : etc. Ignatius ___ - Original Message - From: Gavin Amm [EMAIL PROTECTED] To:

Re: [PHP-DB] Newline help...

2002-12-05 Thread Ignatius Reilly
If you're on a Window$ system, try \r\n instead of \n Ignatius - Original Message - From: NIPP, SCOTT V (SBCSI) [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 05, 2002 5:28 PM Subject: [PHP-DB] Newline help... I must be

Re: [PHP-DB] test

2002-12-05 Thread Ignatius Reilly
Test successful. Congratulations. Ignatius You can't trust the Russians. They have no word for 'détente'. - Original Message - From: Art Chevalier [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 05, 2002 8:38 PM Subject:

Re: [PHP-DB] Function questions...

2002-12-06 Thread Ignatius Reilly
I would replace $query = SELECT * FROM accounts WHERE verifyurl='$safe_verify_string'; by $query = SELECT * FROM accounts WHERE verifyurl='{$safe_verify_string}'; to force interpolation of variable $safe_verify_string HTH Ignatius - Original

Re: [PHP-DB] MySQL Array

2002-12-06 Thread Ignatius Reilly
Try: $query = INSERT INTO anagrafe (codice,nome, cognome, codicefiscale) VALUES (' .strtoupper($codicefiscale) .','{$NOME}',' .strtoupper($cognome) .',' .strtoupper($co dicefiscale) .', etc then mysql_query ( $query ) ; Ignatius - Original

Re: [PHP-DB] CREATE TABLE QUERY PHP/MySQL

2002-12-06 Thread Ignatius Reilly
Very likely you have to GRANT the CREATE permission to your PHP user account. Also investigate the CREATE TEMPORARY TABLE grant status available since version 4+. Very convenient. Ignatius - Original Message - From: Jonathan [EMAIL PROTECTED]

Re: [PHP-DB] CREATE TABLE QUERY PHP/MySQL

2002-12-07 Thread Ignatius Reilly
, a preview reply mentioned mysql_error(). How would I use function to verify that the table was created? Do I simply write If (mysql_error() != ) Return false A typical way to use it is mysql_***( *** ) or die( mysql_error() ) ; -Original Message- From: Ignatius Reilly [mailto

Re: [PHP-DB] Form TextArea Formatting

2002-12-09 Thread Ignatius Reilly
What do you mean by formatted text? All you can enter in a textarea is a sequence of characters belonging to your encoding schema (including non-printing characters). Ignatius - Original Message - From: Keith Spiller [EMAIL PROTECTED] To:

Re: [PHP-DB] Select Query Help...

2002-12-10 Thread Ignatius Reilly
Try: SELECT DISTINCT F.question, F.answer FROM Faqs AS F, FaqsRelatedToProducts Table AS FP WHERE F.faqid = FP.faqid DTH? Ignatius - Original Message - From: Michael Knauf/Niles [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, December

Re: [PHP-DB] Catalog

2002-12-11 Thread Ignatius Reilly
lots of excellent resources on www.devshed.com, notably a PHPShop tutorial and a catalogue implementation. Ignatius - Original Message - From: Hynek Semecký ME [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, December 11, 2002 11:54 AM

Re: [PHP-DB] flytte bsd harddisk til anden pc

2002-12-12 Thread Ignatius Reilly
なるほど. 私も,そう言う問題に会った. Ignatius - Original Message - From: Martin Allan Jensen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 12, 2002 2:26 PM Subject: [PHP-DB] flytte bsd harddisk til anden pc Hej Allesammen, har et strt

Re: [PHP-DB] Selecting more than asked for

2002-12-14 Thread Ignatius Reilly
$SQL = SELECT * FROM resources where unit_id='{$unit_id}' order by level ; Ignatius - Original Message - From: Alex Francis [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, December 14, 2002 8:37 PM Subject: [PHP-DB] Selecting more than

Re: [PHP-DB] Get error message, need help

2002-12-16 Thread Ignatius Reilly
You should write: $myquery = SELECT * FROM user WHERE username = '{$user}' ... ; As a bonus, it is much more readable. Ignatius - Original Message - From: David [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, December 16, 2002 2:16 AM

Re: [PHP-DB] trees in MySQL

2002-12-19 Thread Ignatius Reilly
The difficulty you are being confronting could be alleviated by using an XML data model (meaning non relational). Of course, I don't know about your requirements, but it could be a direction worth investigating. I use the php_xslt.dll (sablotron) extension, which I find works quite pleasantly.

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

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

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

Re: [PHP-DB] LEFT JOIN not working

2003-01-09 Thread Ignatius Reilly
, such 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] Sent: Thursday, January 09, 2003 12:18 PM Subject: Re: [PHP-DB] LEFT JOIN

Re: [PHP-DB] LEFT JOIN not working

2003-01-09 Thread Ignatius Reilly
. 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 Subject: Re: [PHP-DB] LEFT JOIN not working Exactly my question - why

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

Re: [PHP-DB] LEFT JOIN not working

2003-01-09 Thread Ignatius Reilly
. 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 [EMAIL PROTECTED] To: Ignatius Reilly [EMAIL PROTECTED

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 Subject: SV: [PHP-DB] LEFT JOIN not working Hi, You might want

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

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

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

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, January

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 [EMAIL

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: Thursday,

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=?php echo time() ; ? This will force the refresh. Ignatius - Original Message - From: Philip Zee [EMAIL PROTECTED] To: [EMAIL PROTECTED]

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: Corne'

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: [PHP-DB]

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 data

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: php-db

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

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() ) -

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 OPTIONs with hidden fields: SELECT name=myselect[] OPTION value=1Al di Meola/OPTION OPTION value=2John McLaughlin/OPTION ... /SELECT INPUT name=replica[1] type=hidden value=Al di Meola / INPUT name=replica[2] type=hidden value=John McLaughlin / ... But I fail to

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 I only

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:

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 string for

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 unit

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

Re: [PHP-DB] Need For SPEED

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

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: [PHP-DB]

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

2003-08-28 Thread Ignatius Reilly
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 Subject: Re: [PHP-DB] MySQL, PHP or ghost? On Wed, 27 Aug 2003

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 the

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: [EMAIL PROTECTED] Sent: Thursday

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

2003-08-28 Thread Ignatius Reilly
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 Beckman [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday

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

2003-08-28 Thread Ignatius Reilly
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 Beckman [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, August

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 character, or

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

  1   2   >