Re: [PHP-DB] mysql_num_rows

2002-09-19 Thread 1LT John W. Holmes
I'm getting a strange error message from calling this function It spits out Unknown column 'Resource' in 'field List' This is my query: SELECT dept.name, count(maintenance.deptid)/$total AS percentage FROM maintenance JOIN dept WHERE maintenance.deptid=dept.deptid GROUP BY dept.name

Re: [PHP-DB] set_magic_quotes_runtime???

2002-09-19 Thread 1LT John W. Holmes
So what does set_magic_quotes_runtime(0) do then??? Will it shut off the automatic backslashing of single quotes at run time or not? (it certainly doesn't seem to) It will turn off the escaping of quotes from data your script reads while it's executing, namely from data returned from a

Re: [PHP-DB] magic_quotes_gpc?

2002-09-19 Thread 1LT John W. Holmes
New PHP (long time PERL user) here. I am using an Access database - yeah I know Access is crap, but I have no choice. Anyway, it seems that this magic backslash thing is unavoidable. As I understand it, I can shut it off at the .ini level, but I am running this app on a hosted server with

Re: [PHP-DB] how can I do?

2002-09-19 Thread 1LT John W. Holmes
Or this works well too and might be faster for the DB. SELECT * FROM SomeTable WHERE create_date BETWEEN $start_date AND $end_date Benchmark it yourself, but I've found that BETWEEN is slower. It's easier to read, though. ---John Holmes... -- PHP Database Mailing List

Re: [PHP-DB] how can I do?

2002-09-19 Thread 1LT John W. Holmes
I am trying to find the records whose create dates (field name =create_date) are between the ones I want .For example , I want to seee the records between $start_date and $end_date ..So I tried the code below..But it looks not that right to me?... select * from bug where .. and

Re: [PHP-DB] advise needed for 'authorized only' site

2002-09-23 Thread 1LT John W. Holmes
I have set up a section of my company site for use by authorized dealers only. I am currently using mysql authorization, which works for the first page, but if someone were to type in the url of an underlying page they would be able to get in without authorization. I know I could use

Re: AW: [PHP-DB] getting mysql_fetch_row into array

2002-09-23 Thread 1LT John W. Holmes
$res = mysql_query (SELECT COUNT(deptid) FROM maintenance GROUP BY deptid); $deptcount = array(); // reset the array while ($row = mysql_fetch_row ($res)) { $deptcount[] = $row[0]; this should be $deptcount[] .= $row[0]; shouldn't it? No. The way it's written is it's adding an

Re: [PHP-DB] advise needed for 'authorized only' site

2002-09-23 Thread 1LT John W. Holmes
Why do you need the secret variable? If your server is set up correctly, the user can't create any session variables, all they can do is create a session ID. So you could just check for a user-id and you'd be good. ---John Holmes... - Original Message - From: Jackson Miller [EMAIL

Re: [PHP-DB] Return Array from Function

2002-09-26 Thread 1LT John W. Holmes
You can't start variables with a number. ---John Holmes... - Original Message - From: Hutchins, Richard [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 26, 2002 4:18 PM Subject: [PHP-DB] Return Array from Function Can somebody tell me what I might be doing wrong in

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

2002-10-03 Thread 1LT John W. Holmes
$bgcolor = ($count++ 1) ? blue : black; Then use $bgcolor in your tr ---John Holmes... - Original Message - From: Rodrigo [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Thursday, October 03, 2002 8:29 AM Subject: [PHP-DB] Table question Hi people, is there a way to print a

Re: [PHP-DB] Showing multiple option list from db query?

2002-10-03 Thread 1LT John W. Holmes
I have a database (mysql) that has some rows entered. Format: Name | Desription | catid This has some info in it like this Joe Man 1 Jack Man 1 Jacky Female 2 Emily Female 2 What I am trying to do is create dynamically created select lists so that all with catid 1 are in the fisrt

Re: [PHP-DB] results of query

2002-10-07 Thread 1LT John W. Holmes
What does everyone typically use to display the results of a query. For example, I have a database that has a series of subjects and grades. If I select * from the table, I want a nice way for the data to be displayed. In cold fusion, I can simply use a grid that dynamically fills in. Can

Re: [PHP-DB] need help

2002-10-08 Thread 1LT John W. Holmes
Remove all of the @ for one, so you can see if there are any errors. You're using $rs as two different variables, also. Check mysql_error() after your query to see if an error is returned. ---John Holmes... - Original Message - From: Frederick Belfon [EMAIL PROTECTED] To: [EMAIL

Re: [PHP-DB] DEALING WITH RETRIEVING AND WRITING DATE VALUE FROM/TO TABLE

2002-10-09 Thread 1LT John W. Holmes
I need to know how to retrieve a date field from a database table using MYSQL_DB_QUERY to create recordset. As well as writing a Date Variable to a table using MYSQL_QUERY . For one, don't use mysql_db_query(), it's depreciated. You'd use mysql_query() for both instances and

Re: [PHP-DB] Separating content from style

2002-10-09 Thread 1LT John W. Holmes
One of the most popular template engines is Smarty. Search on google for it. There are plenty of others and even some modules that can be installed into PHP for faster performance. YOu can easily seperate logic from presentation with PHP, but most people choose not to. For most simple projects

Re: [PHP-DB] Getting valie between two fields? (mysql)

2002-10-16 Thread 1LT John W. Holmes
I have a table something like this: __ | id | number | | 1 | 1 | | 2 | 23| | 3 | 59| | 4 | 103 | If I have a number, say 30, I need to get the last number it's above - in this case id 2. Any ideas? $number = 30; SELECT id FROM table WHERE

Re: [PHP-DB] Print data

2002-10-23 Thread 1LT John W. Holmes
hello, at my company we have several network printers and i was was wondering if it's possible to print directly to them using PHP, instead of showing on the screen or both ... to gain more control on what is printed, because of the nasty browsers header and footer ... whom i now how to

Re: [PHP-DB] Function that outputs at line xxx

2002-10-23 Thread 1LT John W. Holmes
__LINE__ and __FILE__ should work. ---John Holmes... - Original Message - From: Peter Beckman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 23, 2002 3:00 PM Subject: [PHP-DB] Function that outputs at line xxx Hey -- I'm writing a database error handler function in

Re: [PHP-DB] Function that outputs at line xxx

2002-10-23 Thread 1LT John W. Holmes
Beckman [EMAIL PROTECTED] To: 1LT John W. Holmes [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, October 23, 2002 3:26 PM Subject: Re: [PHP-DB] Function that outputs at line xxx John, that does work! Thanks. The problem is this: Database calls are in db.inc. The script problem occurs

Re: [PHP-DB] Credit Card Info Cryptography

2002-10-23 Thread 1LT John W. Holmes
When ever I see easy, encrypt, and credit card in the same sentence, it makes me worry. Don't store credit card numbers. Charge them once and don't save it anywhere. ---John Holmes... - Original Message - From: Ryan Jameson (USA) [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday,

Re: [PHP-DB] Credit Card Info Cryptography

2002-10-23 Thread 1LT John W. Holmes
need to implement it. Thery is wonderful, however, practicle must preside. Hmmm, that's funny. I would think that _security_ must preside. Maybe I run a different business than you do. ---John Holmes... -Original Message- From: 1LT John W. Holmes [mailto:holmes072000;charter.net] Sent

Re: [PHP-DB] Manioulating a Flat File

2002-10-18 Thread 1LT John W. Holmes
Here's what I'd like to know: Is there a PHP function for easily finding and removing a line from a flat file of data. And, if not, is there a way to remove a line (or lines) after finding them using fget()? Easy way to do this is with file(). It'll read the entire file into an array, with each

Re: [PHP-DB] Millions of records in MySQL

2002-10-25 Thread 1LT John W. Holmes
I remember ages ago that mysql does not properly handle upwards of 10 million records in a table? What's this got to do with PHP? And yes, MySQL will handle it, depending on what you're doing with the data. There are always alternatives, though. ---John Holmes... -- PHP Database

[PHP-DB] Re: [PHP] RE: [PHP-DB] Broken Links 2

2002-10-24 Thread 1LT John W. Holmes
You might want to check out netpbm. I've seen that it makes better quality thumbnails. Plus, you can include it in your package (if appropriate) and people that don't have GD installed can use it. ---John Holmes... - Original Message - From: Rankin, Randy [EMAIL PROTECTED] To: [EMAIL

Re: [PHP-DB] Converting database from MS Access to MySQL on Linux

2002-10-29 Thread 1LT John W. Holmes
Can u pls help in Converting database from MS Access to MySQL on Linux. Pls send the code for converting. http://www.google.com/search?hl=enie=UTF-8oe=UTF-8q=Converting+database+f rom+MS+Access+to+MySQL+on+Linux ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To

Re: [PHP-DB] fetching image by url and storing in mysql

2002-10-29 Thread 1LT John W. Holmes
You don't need filesize(). $fp = fopen('address_to_image','r'); while(!feof($fp)) { $image .= fread($fp,1); } Something like that will work... ---John Holmes... - Original Message - From: Marcus Fleige [EMAIL PROTECTED] To: PHP-Mailinglist [EMAIL PROTECTED] Sent: Tuesday, October

Re: [PHP-DB] Retruning an array from a row

2002-10-30 Thread 1LT John W. Holmes
- Original Message - From: Erick Wellem [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 30, 2002 6:44 AM Subject: [PHP-DB] Retruning an array from a row Hello All, How can I return and print an array from a user defined function from a database from a row like this,

Re: [PHP-DB] Inserting current date(MySQL)?

2002-10-30 Thread 1LT John W. Holmes
I'm my trying to insert to current date from a php form? I know that MySQL has a CURDATE() fucntion and PHP has several date function, but I cann't seem to get either to work? Here is my existing code: $ADDDATE=date(Y-m-d); [snip] VALUES ('$_POST[ADDDATE]', You've got two

Re: [PHP-DB] need help with SHOW Colums

2002-10-31 Thread 1LT John W. Holmes
So show us the code that you tried with. This code doesn't do us any good because it's not causing the error. ---John Holmes... - Original Message - From: David Rice [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, October 31, 2002 11:31 AM Subject: [PHP-DB] need help with SHOW

Re: [PHP-DB] Am I doing This Right?

2002-11-01 Thread 1LT John W. Holmes
No, you're doing it wrong. ---John Holmes... - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, November 01, 2002 2:05 AM Subject: [PHP-DB] Am I doing This Right? ?php function war3_replays_submit() { if ( isset($replay_file) ) {

Re: [PHP-DB] mysql_fetch_array() question

2002-11-06 Thread 1LT John W. Holmes
That's not true. You can assign them to different variables and it works fine. $r1 = mysql_query(select * from main limit 1) or die(mysql_error()); $r2 = mysql_query(select * from apft limit 1) or die(mysql_error()); $row1 = mysql_fetch_array($r1); $row2 = mysql_fetch_array($r2);

Re: [PHP-DB] MySQL password protection?

2002-11-06 Thread 1LT John W. Holmes
I was wondering if it is possible to protect my password to the MySQL-server from being in a PHP-script. Now I can't do that, so everybody who gets to see my php-sourcecode also can see my (not protected/not encrypted) password. How can I change this? You can't, unless you want to put it in

Re: [PHP-DB] MySQL password protection?

2002-11-06 Thread 1LT John W. Holmes
and encrypt that one file (they don't need to see it anyway). use a php encoder for the file with your login info in it. -Original Message- From: 1LT John W. Holmes [mailto:holmes072000;charter.net] Sent: Wednesday, November 06, 2002 4:16 PM To: William Trappeniers; [EMAIL PROTECTED] Subject

Re: [PHP-DB] checking for 0 results?

2002-11-15 Thread 1LT John W. Holmes
How about: $sql = ... ; $result = mysql_query($sql); if($row = mysql_fetch_row($result)) { do { //process results in $row }while($row = mysql_fetch_row($result); } else { //no results } This way you don't have to make an extra call to mysql_num_rows() and it saves you time. ---John

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

2002-11-19 Thread 1LT John W. Holmes
OK. If I am using the POST method and the checkbox 'name' for all of the checkboxes is 'system', how do I access the results? I am researching on the PHP site trying to figure out what this array is, and how I access this if the index name is the same for all elements. I am hoping that

Re: [PHP-DB] formatted text, php and mysql

2002-11-19 Thread 1LT John W. Holmes
Have you looked at the nl2br() function? echo trtd . nl2br($content) . /td/tr; That may give you the output you're looking for. ---John Holmes... - Original Message - From: Griffiths, Daniel [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 19, 2002 11:50 AM Subject:

Re: [PHP-DB] retriving values from two tables

2002-11-19 Thread 1LT John W. Holmes
Hi all, I am karthik. I am using using php with mysql. i am stuck with a qury. Pls hep me out. i have two tables. Here is table with sample data Table Name : Links linkid header 1 yahoo.com 2 google.com 3

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

2002-11-20 Thread 1LT John W. Holmes
Try... $query = INSERT INTO accounts (accnts,timestamp) VALUES(''.$accnts[0].'','TIMESTAMP(10)'); Might work? Aaron For the OP, you don't really want to insert the text TIMESTAMP(10) into a column, do you? If you want the current 10-digit timestamp, then you can just use NOW() or

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

2002-11-20 Thread 1LT John W. Holmes
OK. This sounds great, but now I am getting a completely different error message. You have an error in your SQL syntax near '-sys) VALUES('sn4265-turner')' at line 1 Here is the INSERT statement: $query = INSERT INTO accounts (id-sys) VALUES('.$accnts[0].'); Do I have to rename the

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

2002-11-20 Thread 1LT John W. Holmes
$query = INSERT INTO accounts (`id-sys`, rtime) VALUES('.$accnts[0].', 'NOW()'); Remove the quotes around NOW(). It's a function, not a string. ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] autoupload

2002-11-22 Thread 1LT John W. Holmes
I am currently creating a php/mysql site for a client. Many of the customers who will be using this site also use a vb/access program to store a lot of the same data. The client asked me last night if we could write an app that would run on the customers machine that would routinely take

Re: [PHP-DB] Re: MySQL/PHP Iterative Tree

2002-11-26 Thread 1LT John W. Holmes
You may want to check out using Nested Sets instead of a Parent-Child-ID system. I think it's an easier system for representing hierarchies. Here is a good article on the system: http://searchdatabase.techtarget.com/tip/1,289483,sid13_gci537290,00.html Google for Nested Sets +sql or something

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

2002-12-05 Thread 1LT John W. Holmes
HTML doesn't render newlines, only BR. Look at your HTML source code and the newlines are there. or, if you're on windows, use \r\n for newlines. ---John Holmes... - Original Message - From: NIPP, SCOTT V (SBCSI) [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 05, 2002

Re: [PHP-DB] MySQL Array

2002-12-05 Thread 1LT John W. Holmes
I think he meant that he is only pulling one column, i.e. field1 with each mysql_fetch_array and he wants that in four columns. $c = 1; echo tr; while($ar = mysql_fetch_array($result)) { echo td{$ar['field1']}/td; if(($c % 4) == 0) { echo /trtr; } } You'll have to account for incomplete rows

Re: [PHP-DB] mileage calculator

2002-12-06 Thread 1LT John W. Holmes
I know a lot of sites, such as car dealerships, where you can put in your zip code and then you can search for cars within 50,100, etc miles of your house. How is this done? I have a site that we want to implement a feature like this. What is stored in the db? Can I simply write a function

Re: [PHP-DB] Return 1 instance of each unique record?

2002-12-06 Thread 1LT John W. Holmes
How do I get MySQL to summarize a query so that I receive only 1 instance per similar record. I.E. if you have 10 records with name Smith and 5 records with Barney, etc, that it would return 2 records instead of 15. This should be on a MySQL list... SELECT * FROM tbl WHERE ... GROUP BY

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

2002-12-10 Thread 1LT John W. Holmes
$tmp = $_POST['sbcuid'].-.$_POST['system'][$a]; $update = UPDATE accounts SET atime='NOW()' WHERE \id-sys\='.$tmp.'; echo $update; $result1 = mysql_query($update, $Prod) or die(mysql_error()); echo mysql_affected_rows(); Try: $update = UPDATE accounts SET atime=NOW() WHERE id-sys='$tmp';

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

2002-12-10 Thread 1LT John W. Holmes
I have definitely isolated the problem. If I change the column name that the match is being performed on from 'id-sys' to 'id_sys' I can execute the query without having to worry about quoting the column name and everything works. I think that I am just going to leave the column name

Re: [PHP-DB] Still having problems...?!

2002-12-10 Thread 1LT John W. Holmes
Warning: open(/tmp\sess_1df563d6d8c8b4b16534c438251e7107, O_RDWR) failed: No such file or directory (2) in E:\Webroot\tutorial\page1.php on line 3 Warning: open(/tmp\sess_1df563d6d8c8b4b16534c438251e7107, O_RDWR) failed: No such file or directory (2) in Unknown on line 0 Warning: Failed to

Re: [PHP-DB] newbie - last_insert_id() with mysql

2002-12-12 Thread 1LT John W. Holmes
mysql_insert_id() is a PHP function, not a MYSQL function. You are also missing a close quote on your insert string. So you have to do it like this: Correct, but LAST_INSERT_ID() is a MySQL function which is what he's using... $sql2 = insert into acl (adminId,transportId,securityId)

Re: [PHP-DB] bulk miorting rows into mysql db

2002-12-13 Thread 1LT John W. Holmes
I have a few hundred rows of data to import into a mysql db. Its currently tab separated. What's the most straight forward way (ie i dont want to enter it line by line) of doing a bulk import? I have full admin rights to my dev server. Is there a method or software app that people can

Re: [PHP-DB] Listing A Certain # Range

2002-12-16 Thread 1LT John W. Holmes
LIMIT 5,10 LIMIT 10,15 Something like that should work. Not quite. LIMIT n,m where n is the starting point and m is how many rows you want returned. LIMIT 5 or LIMIT 0,5 LIMIT 5,5 LIMIT 10,5 etc... ---John Holmes... Im using MySQL and PHP 4.2.3 on Apache and Mandrake Linux, I was

Re: [PHP-DB] Updating data on remote server

2002-12-16 Thread 1LT John W. Holmes
Do you have root access to the internet MySQL server? The easiest way to do this would be to use replication, I think. It doesn't sound too difficult to set up and it would do all of the updating for you. Is that an option? If not, then you can enable binary logging (I think that's what it is) in

Re: [PHP-DB] Inserting URL into table

2002-12-19 Thread 1LT John W. Holmes
I'm trying to insert a URL into a char field. MySQLFront punts out this error with my compiled query: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '','Yahoo mail','httpNULL/www.yahoo.co.uk/')' Well

Re: [PHP-DB] trees in MySQL

2002-12-19 Thread 1LT John W. Holmes
If you don't know how many nodes you're going to have and the amount of branches under each node, then that's the only way to do it. However, if you can define those numbers, you can use something like the following. A manager would have 50 numbers, for example. So, rather than counting through

Re: [PHP-DB] Help Needed

2002-12-26 Thread 1LT John W. Holmes
Everything's perfect.. except my browser keep blank when I run my php files... No, obviously it's not perfect because it's not working at all. Your page is blank because ? phpinfo() ? will be evaluated as an unknown HTML tag and come out blank. Find another tutorial that discusses how to set

Re: [PHP-DB] php/mysql

2002-12-26 Thread 1LT John W. Holmes
I don't know where the error lays, in php, mysql or red hat 8. But, I can't get my databased php-apps to work. I am trying to run: apache_1.3.27 php-4.2.3 mysql-3.23.53 redhat 8.0 What happens is that apache and php work nicely, but my apps cannot connect to mysql. In IRM I get can not

Re: [PHP-DB] php/mysql

2002-12-26 Thread 1LT John W. Holmes
I don't use RedHat, but I've heard (possibly here) that the RH PHP RPM does not properly install MySQL support by default and that there's something like php_mysql.rpm (or something similar) that needs to be installed as well? Does any of that sound familiar to anyone? I've heard

Re: [PHP-DB] php/mysql

2002-12-26 Thread 1LT John W. Holmes
I don't know where the error lays, in php, mysql or red hat 8. But, I can't get my databased php-apps to work. I am trying to run: apache_1.3.27 php-4.2.3 mysql-3.23.53 redhat 8.0 What happens is that apache and php work nicely, but my apps cannot connect to mysql. In IRM I

Re: [PHP-DB] Help about printing an integer variable

2003-01-06 Thread 1LT John W. Holmes
You can specify a padding character and length with printf www.php.net/printf ---John Holmes... - Original Message - From: Martín Agüero [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, January 06, 2003 9:52 AM Subject: [PHP-DB] Help about printing an integer variable I need to

Re: [PHP-DB] insert form data

2003-01-08 Thread 1LT John W. Holmes
I am able to get the query to work by itself but it will not work using the if (isset ($submit)) and NO errors are outputting...nothing. That's because $submit is not set Any suggestions would be greatly appreciated. I havnt even gotten to the form variables yet...and yes, my globals

Re: [PHP-DB] insert form data

2003-01-08 Thread 1LT John W. Holmes
When I post to my next page in the survey in the form action, instead of this page, the data doesnt go into the database. Does anyone know a way around this other than rewriting all the pages into one page? Use sessions or hidden form fields to transfer the data between pages. ---John

Re: [PHP-DB] insert form data

2003-01-08 Thread 1LT John W. Holmes
... Actually, I dont need these variables in the rest of the form, I just need to go to the next page...Like a hyperlink on the submit button maybe ??? Seems like I've seen that... Mignon On Wed, 2003-01-08 at 14:12, 1LT John W. Holmes wrote: When I post to my next page in the survey

Re: [PHP-DB] HTML tags in auth.php script

2003-01-10 Thread 1LT John W. Holmes
Hello every one. I am still learning how PHP works. Can some one answer this for me please. This piece of code here works fine ONLY without the HTML tags (The first line and the last lines in the code). The moment I add these lines I get the following error: (By the way I don't get these

Re: [PHP-DB] blob

2003-01-07 Thread 1LT John W. Holmes
I want to be able to load PDFs into mysql DB, but I'm not very familiar with the blob data type? Can someone point me on the right direction how to do this? Use fopen() in binary mode and fread() to read the file into a string, then insert it into the database as you would any other variable

Re: [PHP-DB] Date math functions...

2003-01-15 Thread 1LT John W. Holmes
[snip] if ($dateDiff == 3) { mysql($DBName,UPDATE Balances SET CompEarned=CompTaken+8 WHERE said='$said') or die(mysql_error()); mysql($DBName,INSERT INTO Log VALUES('DATE_ADD($StopDate, INTERVAL 1 DAY','',1,2,'$CalendarDetailsID')) or die(mysql_error()); My big question is about using the

Re: [PHP-DB] Date math functions...

2003-01-15 Thread 1LT John W. Holmes
[snip] if ($dateDiff == 3) { mysql($DBName,UPDATE Balances SET CompEarned=CompTaken+8 WHERE said='$said') or die(mysql_error()); mysql($DBName,INSERT INTO Log VALUES('DATE_ADD($StopDate, INTERVAL 1 DAY','',1,2,'$CalendarDetailsID')) or die(mysql_error()); My big question is about

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

2003-01-15 Thread 1LT John W. Holmes
Is there any way to receive mail via PHP? What I am interested in doing is creating a double opt-in e-mail list whereby someone can subscribe to an e-mail service via an on-line form. Upon doing so, they would get a confirmation e-mail. Replying to this e-mail would confirm the subscription

Re: [PHP-DB] Date math functions...

2003-01-15 Thread 1LT John W. Holmes
mysql($DBName,UPDATE Balances SET CompEarned=CompTaken+8 WHERE said='$said') or die(mysql_error()); mysql($DBName,INSERT INTO Log VALUES(DATE_ADD($StopDate, INTERVAL 1 DAY,'',1,2,'$CalendarDetailsID')) or die(mysql_error()); Actually this is generating another error. Now, without

Re: [PHP-DB] While + Function

2003-01-23 Thread 1LT John W. Holmes
if(category = 'bla') Maybe you shouldn't be using a constant if it's going to be changing each time the page loads. ---John Holmes... - Original Message - From: Shachar Tal [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, January 23, 2003 7:46 AM Subject: Re: [PHP-DB] While +

Re: [PHP-DB] function needed

2003-01-24 Thread 1LT John W. Holmes
You could also use this: function getdomainname($name) { $parts = explode('.',$name); return $parts[count($parts)-2]; } which will always return the second to last section when divided up by the periods. So it will return 'domain' for all of the following: www.domain.com

Re: [PHP-DB] function needed

2003-01-24 Thread 1LT John W. Holmes
But what about www.domain.co.uk, you ask? Well, it'll fail with this. :) Just filter out the 'co.' like the other function that was posted and this will still work. ---John Holmes... - Original Message - From: 1LT John W. Holmes [EMAIL PROTECTED] To: heilo [EMAIL PROTECTED]; [EMAIL

Re: [PHP-DB] too many connections?

2003-01-27 Thread 1LT John W. Holmes
any idea what this means? i have not touched or changed my config.php file since i put it up the first time... it contains my db connect info. also, i just downloaded it from the server to see if it had been modified and it had not. thanks again and best, addison Warning: Too many

Re: [PHP-DB] mysql_insert_id() vs. last_insert_id()

2003-01-28 Thread 1LT John W. Holmes
I've been checking the last_insert_id() function out and I am curious. The MySQL docs say to use the mysql_insert_id() function after an insert into query to grab the key value. Both seem to work; however, there are some subtle differences. Which is the best one to use after a single insert

Re: [PHP-DB] sql syntax error

2003-01-29 Thread 1LT John W. Holmes
- Original Message - From: Addison Ellis [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, January 28, 2003 10:46 PM Subject: [PHP-DB] sql syntax error hello, i can not pinpoint this. your time and help is very much appreciated. best, addison Error: id=,

Re: [PHP-DB] Storing IP into DB

2003-01-30 Thread 1LT John W. Holmes
I wondered if anyone could help me. I would like to store the user IP only once per multiple visits. The code below store the user IP on every visit which is not my intention. Please I would like to have the IP stored at once upon repetitive visits of the user. Thank Below is my code ?

Re: [PHP-DB] Storing IP into DB

2003-01-30 Thread 1LT John W. Holmes
Make your 'ip' column UNIQUE in your table and ignore errors. Or, set a flag in a session or cookie when you save the IP and if that flag is present on other pages, then don't save the IP. Or I believe you can use REPLACE INTO... True. I don't think all databases implement REPLACE,

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

2003-01-30 Thread 1LT John W. Holmes
$sql = SELECT * FROM accessnums WHERE areacode=$_POST[areacode]' and city='$_POST[cityselected]' ORDER BY network LIMIT 1; It can't execute the query. Any suggestions? Unless it's a typo, you're missing a single quote around $_POST[areacode]... ---John Holmes... -- PHP Database Mailing

Re: [PHP-DB] what does % mean?

2003-01-31 Thread 1LT John W. Holmes
I am trying to decipher some code written by someone else. In it there is a query: $query = select description from $prodtable where description like '%' or type like '%' group by description; I've seen it used as mathematical modulos, but not sure how it's used here. It is a wildcard,

Re: [PHP-DB] VFP 6 via ODBC and data integrity questions

2003-02-03 Thread 1LT John W. Holmes
I have just began work on a project to let users subscribe to a service and place orders into a database that is VFP 6 based. Using PHP4, I am able to interface with their program (that also uses ODBC locally) in all aspects (INSERT, UPDATE, DELETE, and SELECT). My worries come when

Re: [PHP-DB] date: reverse order

2003-02-04 Thread 1LT John W. Holmes
when retrieving data from the db and displaying it on the page by creation date how can i reverse the order so that the most recent entry appears first? here's what i have now: ? require(config.php); $obj = mysql_db_query($dbname,select * from ads order by createdate); ? You

Re: [PHP-DB] print_r($row);

2003-02-04 Thread 1LT John W. Holmes
i do print_r($row); and all my data is printing properly from my db. however, with the below code only one row is not printing: {$row-property_type} thank you for your time. addison ? // Begin Ad Block $count = 0; $id = 45; $obj = mysql_db_query($dbname,select

Re: [PHP-DB] Date Range Question...

2003-02-04 Thread 1LT John W. Holmes
I am working on an app that needs to post information to a website based on date. The tricky part for me is that the date is a range that spans either 2 or 3 days. I want the web page to dynamically populate this information based on a query. The query will look something like this:

Re: [PHP-DB] A little JOIN help please...

2003-02-04 Thread 1LT John W. Holmes
SELECT 'A.Title' FROM `phpCalendar_Daily` AS 'B' JOIN 'phpCalendar_Details' AS 'A' ON 'A.CalendarDetailsID' = 'B.CalendarDetailsID' WHERE CURDATE( ) BETWEEN 'B.StartDate' AND 'B.StopDate' Take out all of those quotes! You're making strings out of everything. WHERE CURDATE() BETWEEN

Re: [PHP-DB] TimeStamp format to date

2003-02-20 Thread 1LT John W. Holmes
Is like this i have a field in MySql TIME_STAMP int(11) and he has a time stamp value (ex: 1045738710) and i want to make show it like a date format in the web. Can anyone help me on this...? Just SELECT it out and run it through the PHP date() function to format it. www.php.net/date

Re: [PHP-DB] Receiving ARRAY from Forms

2003-02-20 Thread 1LT John W. Holmes
I tried the following code but all I get back is Array. I'm trying to pass a huge array. You need to serialize the array... ? if( isset( $submit ) ) { echo array list:br; print_r( $eList ); $submit = ; } else { $mList = array(); $mList[0] = 1. hello; $mList[1] = 2. there;

Re: [PHP-DB] Checkboxes to gather rows to delete

2003-02-24 Thread 1LT John W. Holmes
I have a mysql database with a table using one column as a primary key. (rowID). On a php page I use a query to list all of the rows of the table and have a checkbox beside each row that should be used to check if you would like to delete this row. Can someone give me an example using post

Re: [PHP-DB] Checkboxes to gather rows to delete

2003-02-24 Thread 1LT John W. Holmes
I appreciate all of the quick replies. I do have globals off. Currently, I have the values for each ID being returned in a array Array ( [0] = 101 [1] = 201 ) where 101 and 201 were the id's of the rows I checked. I have to say I like the way of doing it that Mathieu has shown using the

Re: [PHP-DB] Checkboxes to gather rows to delete

2003-02-24 Thread 1LT John W. Holmes
Holmes... - Original Message - From: 1LT John W. Holmes [EMAIL PROTECTED] To: Lewis Watson [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, February 24, 2003 10:13 AM Subject: Re: [PHP-DB] Checkboxes to gather rows to delete I appreciate all of the quick replies. I do have

Re: [PHP-DB] Checkboxes to gather rows to delete

2003-02-24 Thread 1LT John W. Holmes
Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ - Original Message - From: 1LT John W. Holmes [EMAIL PROTECTED] To: Lewis Watson [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, February 24, 2003 10:36 AM Subject: Re: [PHP-DB

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

2003-02-28 Thread 1LT John W. Holmes
How would I store an array in the database? I want to store 2 things. One array of shirt sizes and one array of which holds other arrays. $safe = addslashes(serialize($array)); and store $safe into a text column. Use $array = unserialize($database_data); to get the array back. ---John

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

2003-02-28 Thread 1LT John W. Holmes
How would I store an array in the database? I want to store 2 things. One array of shirt sizes and one array of which holds other arrays. [snip] $query = INSERT INTO table ( field1, field2 ) VALUES ( \ . serialize( $singleDimArray ) .

Re: [PHP-DB] Help with MySQL Logic

2003-03-03 Thread 1LT John W. Holmes
A client of mine, a rail car storage company, has asked that I create a PHP/MySQL application in which they will maintain and track rail cars. I am having a bit of trouble however working through one of thier requirements. They need to know in what position the rail car is on each track. For

Re: [PHP-DB] Confusing Date...

2003-03-03 Thread 1LT John W. Holmes
I have a MySQL column that was set to date. In my PHP page, I have a form and a field called 'Sch_StartDate'. I'm having difficultes understanding how to write to the date column in MySQL. If I send 03/04/02for March 4, 2002, the value that gets stored in the MySQL database is

Re: [PHP-DB] date functions

2003-03-04 Thread 1LT John W. Holmes
I am looking for a way to take a date stored in a mysql database... and find out the date seven days later. how would i do this?! too easy... SELECT date_column + INTERVAL 7 DAY FROM your_table ... ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe,

Re: [PHP-DB] date functions

2003-03-04 Thread 1LT John W. Holmes
I want to use it in this function that i am creating (it's for a resteraunt automated tips system, to work out how much tips each staff member is entitled to. function tips($weekstart){ /* JUST BELOW HERE IS WHERE I

Re: [PHP-DB] Mysql compress text field?

2003-03-04 Thread 1LT John W. Holmes
I have a new project where i need show pages of report on demmand. That reports are created in the batch process, and the whole file size is about 5 Gb. (thats includes all the reports in a month, I need save about 12 month). I think in two alternatives : 1. I save the links in

Re: [PHP-DB] date functions (generates parse error)

2003-03-04 Thread 1LT John W. Holmes
Here is the whole code of my function Whenever i run it, it say's there is a parse error on line 6, can't see what is the problem the format of $weekstart (as it is stored in the Database) is -MM-DD = ? function

Re: [PHP-DB] Problem with php and mysql

2003-03-05 Thread 1LT John W. Holmes
One of our customers has written a php application that we are hosting. Basically, there is a province/state table which populates a combo box. When the form containing this combo box is submitted, the information is added into the database. The problem is that when nothing is selected from

Re: [PHP-DB] Subtraction of two units of time.

2003-03-06 Thread 1LT John W. Holmes
I want to take away two times stored in the format 00:00:00 in a mysql database, i retrieve the times and take them away by using the following $total = $time1 - $time2 ; when i echo the total it is a whole number of the hours.. and does not take the minutes into account, anyone have an

  1   2   >