Re: [PHP-DB] Unsubscribe (mailign lsits in general) question...

2004-01-20 Thread CPT John W. Holmes
What's this got to do with databases (PHP-DB list)? It's barely related to PHP to begin with. Think about where your sending your messages before you click the button. ---John Holmes... - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, January 20, 2004

Re: [PHP-DB] breaking apart data

2004-01-20 Thread CPT John W. Holmes
From: Larry R. Sieting [EMAIL PROTECTED] what would be the most efficient way to rework this data in to what I am after stored text: asdf asdf sadl jf lsakdjf a \r\n asdfierw aweiufasd asiuwr \r\n asdhfauiweuhrahsd \r\n displays text as: asdf asdf sadl jf lsakdjf a asdfierw

Re: [PHP-DB] SQL query...

2004-01-15 Thread CPT John W. Holmes
From: Muhammed Mamedov [EMAIL PROTECTED] Try this SELECT DISTINCT(file_name), Count(file_name) AS cnt FROM $table_name WHERE date BETWEEN '2003-10-01' AND '2003-12-31' group by file_name order by cnt; desc If you're GROUPing by file_name then you don't need DISTINCT(file_name)... it's

Re: [PHP-DB] date problem in MySQL DB

2004-01-13 Thread CPT John W. Holmes
From: Angelo Zanetti [EMAIL PROTECTED] This might be slightly off topic but hopefully someone can help. I have a field that is a varchar and I stored dates in it. But now I want to change the type of the column to date, but I have a problem that the formats differ: my format: mm/dd/

Re: [PHP-DB] inserting dynamic drop down menu data into mysql

2004-01-07 Thread CPT John W. Holmes
From: Duane Barnes [EMAIL PROTECTED] $output .= option value=$category$category/option; Put quotes around your values... If you have option value=This and ThatThis and That/option how do you expect HTML to know you mean This and That as you're entire value? It's not. It's going to take This

Re: [PHP-DB] Re: BINARY not recognized ??

2004-01-05 Thread CPT John W. Holmes
From: Monty [EMAIL PROTECTED] I now get an error from MySQL stating that BINARYuser_name is not a valid column. So, something seems to be broken. I looked through the MySQL online docs and BINARY is still there, but, it won't work for me. Maybe try putting a space between BINARY and the

Re: [PHP-DB] Remove all instances of a character....

2003-12-24 Thread CPT John W. Holmes
From: [EMAIL PROTECTED] I have a MySQL database, with around 500 entries in one table... I've noticed that many entries have an erroneous ';' in the one of the fields. What I need to do, is tell MySQL to go through the ENTIRE table and find any instances of ' ; ' and them delete

Re: [PHP-DB] Get Names of columns of a table

2003-12-17 Thread CPT John W. Holmes
From: [EMAIL PROTECTED] is there a PHP function that wil return the names of the columns for a given table? http://www.php.net/mysq_list_fields Note: The function mysql_list_fields() is deprecated. It is preferable to use mysql_query() to issue a SQL SHOW COLUMNS FROM table [LIKE 'name']

Re: [PHP-DB] Query Sum problem

2003-12-16 Thread CPT John W. Holmes
From: Larry Sandwick [EMAIL PROTECTED] I need to sum the field *COST* in this query where data in *STATUS* is equal to HELD and OPEN, so I will have 2 totals passed below and do not know where to begin . SELECT status, SUM(cost) FROM Table WHERE status IN ('HELD','OPEN') GROUP BY status

Re: [PHP-DB] Query Sum problem

2003-12-16 Thread CPT John W. Holmes
From: Larry Sandwick [EMAIL PROTECTED] I appreciate the quick response, but I should have been more clear. I understand the query below, but I would only have 2 total and it is not group by the companies. The query below gives me the main information without totals. How do I add the 2

Re: [PHP-DB] CREATE TABLE LIKE, error

2003-12-15 Thread CPT John W. Holmes
From: Adam i Agnieszka Gasiorowski FNORD [EMAIL PROTECTED] I cannot use this query CREATE TABLE table LIKE other_table; , which is supposed to create an empty clone of the other_table named table. Was it added in some later MySQL version? It's in the manual on mysql.com, bo no version

Re: [PHP-DB] CREATE TABLE LIKE, error

2003-12-15 Thread CPT John W. Holmes
From: Gary Every [EMAIL PROTECTED] Try: CREATE table new_table SELECT * from old_table limit 1; delete from new_table; This will give you the same structure in both tables, and the deletion will make the new_table empty. Not quite the same as it will not copy indexes/keys... ---John

Re: [PHP-DB] User defined function in a mysql query

2003-12-10 Thread CPT John W. Holmes
From: antonio bernabei [EMAIL PROTECTED] I need to make a join between two tables. And I can use the mysql_query function: this is ok. The problem arises because I need to apply a user defined function to a field of one of the two tables and the rule for the join is WHERE

Re: [PHP-DB] ordering output

2003-12-10 Thread CPT John W. Holmes
From: redhat [EMAIL PROTECTED] I have a page that I put together that pulls in data for the time in individual fields - hour, minute, am/pm, month, day. I am going to alter the db to add year as well. I want to order this list by multiple criteria - first by year, then by hour, am/pm,

Re: [PHP-DB] mysql + php

2003-12-08 Thread CPT John W. Holmes
From: "Will Contact" [EMAIL PROTECTED] Now I am programming php+mysql. I put word, excel, mpeg and any binaries into the mySQL database using php on linux server,But I can take out these binay from mySQL database. I would like to see the files and save my pc from

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

2003-11-26 Thread CPT John W. Holmes
From: Ruprecht Helms [EMAIL PROTECTED] how can I convert a date stored in a mysql-database for output in the german format (dd.mm.yy). I tried date (d.m.y,$row-from); but I still get the english-format stored in the database. The databasefield is type date. That's because date() wants a

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

2003-11-26 Thread CPT John W. Holmes
From: Hans Lellelid [EMAIL PROTECTED] Using MySQL DATE_FORMAT() would work, but it's a hack solution; if you ever wanted to create an English version of your site you would have to make changes to your data-layer queries -- and that's just not where that logic belongs. So use UNIX_TIMESTAMP

Re: [PHP-DB] Array question

2003-11-25 Thread CPT John W. Holmes
From: ShortStay [EMAIL PROTECTED] How do you delete a value and key from an array? I know the value. You need to know the key. unset($Array[$key]); There are various array functions that'll find the key for you if you know the value. Is it OK to post array questions to the db list? Not

Re: [PHP-DB] mysql table join

2003-11-20 Thread CPT John W. Holmes
From: Roger Miranda (Sumac) [EMAIL PROTECTED] Is there a way to permanently join/link two mysql tables? Not without creating another table. CREATE TABLE MyTable SELECT ... FROM Table1 JOIN Table2 ON ... WHERE ... Although I have to wonder about your schema if you need to do this. ---John

Re: [PHP-DB] Unsure of how to perform query and results..

2003-11-20 Thread CPT John W. Holmes
From: Aaron Wolski [EMAIL PROTECTED] I have data in a Db that looks something like: 14,[EMAIL PROTECTED],Andrew,Smith 1,[EMAIL PROTECTED],Andrew,Smith 14,[EMAIL PROTECTED],Barbara,Richardson 1,[EMAIL PROTECTED],Barbara,Richardson The number represents a product_id that was purchased by

Re: [PHP-DB] works on production server but not on localhost :: fix

2003-11-19 Thread CPT John W. Holmes
From: Paul Ihrig [EMAIL PROTECTED] how weird is this just had to uncheck allow anonymous access. and keep checked Integrated Windows authentication just seems a bit silly... every thing works fine now. Of course it works because you're now running the PHP scripts as yourself, and you

Re: [PHP-DB] Query Case In-sensitive

2003-11-17 Thread CPT John W. Holmes
From: Larry Sandwick [EMAIL PROTECTED] Is there a way to run a query so that it ignores the case, and the query is not case sensitive? What's this have to do with PHP and what database are you using? ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe,

Re: [PHP-DB] - ereg_replace -SOLVED

2003-11-14 Thread CPT John W. Holmes
From: [EMAIL PROTECTED] eregi_replace(a href=\(.+)\, a href=\\\1\ target=\_blank\ class=\down_txt\, $body); How is that any different than just doing a str_replace() on a, though? The str_replace() is going to be much faster than the eregi_replace() function and href doesn't _have_ to be the

Re: [PHP-DB] using code for multiple sites

2003-11-13 Thread CPT John W. Holmes
- Original Message - From: mike [EMAIL PROTECTED] I currently manage several websites that share the same code. create a directory called inc in /usr/local/apache and then add the following line to php.ini include_path = .:/usr/local/apache/inc I'd use a method like this, although

Re: [PHP-DB] using code for multiple sites

2003-11-13 Thread CPT John W. Holmes
From: Chris Boget [EMAIL PROTECTED] create a directory called inc in /usr/local/apache and then add the following line to php.ini include_path = .:/usr/local/apache/inc I'd use a method like this, although I'd probably just use an absolute path instead of adjusting the include_path.

Re: [PHP-DB] keyword searching

2003-11-12 Thread CPT John W. Holmes
From: Adam Williams [EMAIL PROTECTED] This is my SQL query: SELECT seriesno, governor, descr, boxno, year, eyear, docno from rg2 WHERE seriesno = '$_POST[seriesno]' and governor matches '*$searchterm*' or descr matches '*$searchterm*'; Looks like you're doing the equivilent to a MySQL LIKE

[PHP-DB] Re: [PHP] Changing case

2003-11-12 Thread CPT John W. Holmes
From: Robert Sossomon [EMAIL PROTECTED] I have a form that allows for an item to be entered, the other pieces have been fixed so far that were bogging me down, but now I am looking for a way to convert any entry in the form to be UPPER case so that when the quote is listed, they are

[PHP-DB] Re: [PHP] keyword searching

2003-11-12 Thread CPT John W. Holmes
From: Adam Williams [EMAIL PROTECTED] I'm using Informix SQL. Could have saved some bandwidth by mentioning that in the first place and only posting to either php-general or php-db (which is more appropriate), not both. :) Ignore what my other posts said, as I don't know how Informix works.

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

2003-11-06 Thread CPT John W. Holmes
From: pete M [EMAIL PROTECTED] do not quite understand your problem.. pls post some code? heres a small snippet that should work well... $qry = 'SELECT `customer` FROM `customerList` ORDER BY `customer`'; $res = mysql_query($qry); while($customer = mysql_fetch_object($res)) {

Re: [PHP-DB] SELECT COUNT - result from two tables

2003-11-06 Thread CPT John W. Holmes
From: Boyan Nedkov [EMAIL PROTECTED] Putting more than one table in the FROM clause means tables are joined, then at least following problems could arise: - using WHERE clause you can have empty recordset returned and then COUNT conflicts with it because there is actually no any data to be

Re: [PHP-DB] Apostrophe problem on Firebird

2003-11-06 Thread CPT John W. Holmes
From: Evan Morris [EMAIL PROTECTED] I have data in a database that may contain apostrophes. Some databases use the backslash character as an escape character for single quotes, while others use another single quote. Try your query such as: SELECT * FROM Table WHERE name = 'o''mallery' Instead

Re: [PHP-DB] RE: Problem

2003-11-06 Thread CPT John W. Holmes
From: Jeremy Shovan [EMAIL PROTECTED] All I did was rewrite it exactly the same as it was and the parse error disappeared. I have never seen anything quite like this before. Seen this before. It's either the editor or a copy and paste operation adding weird invisible characters. Major pain in

Re: [PHP-DB] Query or code?

2003-11-06 Thread CPT John W. Holmes
From: Peter Beckman [EMAIL PROTECTED] I have this data: Table Log: appid userid points datetype Table Score: appid userid score I want to verify that the last entry in table log of type x is equal to the sum of the scores in table score for the same appid and userid. Can

Re: [PHP-DB] number_format problem

2003-11-05 Thread CPT John W. Holmes
From: Dillon, John [EMAIL PROTECTED] I want to show a number from a database in the format x,xxx.00 in a textfield, then if it is changed by the user I want to post the value of the number to a decimal field. However, once you number_format the number it becomes a string, and numbers like

Re: [PHP-DB] number_format problem

2003-11-05 Thread CPT John W. Holmes
From: [EMAIL PROTECTED] could you cast as a float/double before inserting? $number = (double) $string; don't know what would happen to the comma, but i assume it would just get removed?? Everything after and including the first non-number character would be dropped. So $12,000.34 would end

Re: [PHP-DB] number_format problem

2003-11-05 Thread CPT John W. Holmes
From: Peter Beckman [EMAIL PROTECTED] On Wed, 5 Nov 2003, Dillon, John wrote: I use this: $x['funds'] = (int)preg_replace(/[\$,]/,,$x['funds']); where $x['funds'] contains something like $3,249,555.32, and the end result is an int of 3249555. I drop the cents... you want to keep

Re: [PHP-DB] Unsuscribe

2003-11-05 Thread CPT John W. Holmes
From: [EMAIL PROTECTED] Unsubscribe No thanks. I like it here. ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] number_format problem

2003-11-05 Thread CPT John W. Holmes
From: [EMAIL PROTECTED] sweet. thanks for hte correction. i try, sometimes i fail. :) But trying is half the battle. GI JOE! ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Help: do ... while, reverse data query

2003-11-05 Thread CPT John W. Holmes
From: Douglas Freake [EMAIL PROTECTED] I need to do a loop where the mysql query starts at the bottom and goes up, as if the data was in reverse order. This is for building a category/ sub_category menu. Data structure: (cat_id, cat_sub, cat_name) sample routine: do { $sql = SELECT *

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

2003-11-05 Thread CPT John W. Holmes
From: Aleks @ USA.net [EMAIL PROTECTED] First I build my select list: SELECT NAME=Cid size=1 OPTION Selected VALUE=All Customers/OPTION ? While ($Site = mysql_fetch_array($S)) { $Sid = $Site[CID]; $SName = htmlspecialchars($Site[Customer]); echo(option

[PHP-DB] Re: [PHP] php|cruise - do unto others...

2003-11-05 Thread CPT John W. Holmes
From: Becoming Digital [EMAIL PROTECTED] php|cruise is coming this March. Final word on this, I promise! :) I'll be on the cruise, so I'm looking forward to meeting anyone else that'll be there. Contact me offline if you want. I wanted to say think you to all of those that contributed to the

Re: [PHP-DB] Query Error

2003-11-04 Thread CPT John W. Holmes
From: Robert Sossomon [EMAIL PROTECTED] And here is the additem.php file where it check for the info in the field and it is erroring out. It would be rather useful to know the error... $get_iteminfo = select * from GCN_items where 'item_num' LIKE '%$_POST[sel_item_id]%'; Take away the

Re: [PHP-DB] Query Error

2003-11-04 Thread CPT John W. Holmes
From: Robert Sossomon [EMAIL PROTECTED] The errors as it prints are: The query I just ran was: select * from GCN_items where `item_num` = '%fm-a294%' The query I just ran was: Resource id #2 0 Those aren't errors; it's just what you asked the script to display. Your query simply isn't

Re: [PHP-DB] removing space ?

2003-10-28 Thread CPT John W. Holmes
From: Larry Sandwick [EMAIL PROTECTED] When I select data from my data base I have spaces on the lead side for example the data that is stored is 33.jpg. Spaces included, exclude the quotes, quotes are example only to show the spaces. I would like to remove these spaces. Is there a

Re: [PHP-DB] Unique Format

2003-10-22 Thread CPT John W. Holmes
Use htmlentities() or htmlspecialchars()... ---John Holmes... - Original Message - From: Tonya [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 22, 2003 1:07 PM Subject: [PHP-DB] Unique Format PHP 4.3.3 and MYSQL I am constructing a site for gamers that has a member

Re: [PHP-DB] Load MySQL from a variable

2003-10-21 Thread CPT John W. Holmes
From: Kim Kohen [EMAIL PROTECTED] I have some data from Filemaker Pro which needs to have a lot of search/replacing done before importing into MySQL. I have used ereg_replace in PHP and end up with a variable holding the correct data. (there are several hundred rows of data in the variable)

Re: [PHP-DB] Load MySQL from a variable

2003-10-21 Thread CPT John W. Holmes
From: Rory McKinley [EMAIL PROTECTED] AFAIK, LOAD DATA INFILE will only work off a file. So you would have to create a temp file. Another option is to create a multiple value insert query e.g. INSERT INTO arb_table (arb_column_1...arb_column_n) VALUES (arb_value_1..arb_value_n),

Re: [PHP-DB] Error settings

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

Re: [PHP-DB] Multiple adds?

2003-10-21 Thread CPT John W. Holmes
From: Robert Sossomon [EMAIL PROTECTED] I am working on a quote system and have been trying to figure out how to make them system automatically add an entire vendor or category at one time. I can make the system display all of them and give the sales folks in my office a chance to change the

Re: [PHP-DB] Error settings

2003-10-21 Thread CPT John W. Holmes
From: Dillon, John [EMAIL PROTECTED] Hm. Adjusted error_reporting to none. Why would I still get: Forbidden You don't have permission to access /method=post on this server. -- -- Apache/1.3.28 Server at

Re: [PHP-DB] Multiple adds?

2003-10-21 Thread CPT John W. Holmes
From: Robert Sossomon [EMAIL PROTECTED] An example is: http://www.garlandcnorris.com/quotes/seestore.php I have a session tracker installed on it already, but the modifying the information (instead of remove and readding it) and adding an entire group are pieces I am stumbling on. So you

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

2003-10-20 Thread CPT John W. Holmes
From: Devon [EMAIL PROTECTED] I have been scouring the online documentation and experimenting for hours trying to find a solution. I just can't do it. I have two colomns of data that I am retrieving from MySQL: SELECT id, name FROM a_table; I just cannot figure out how to get that

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

2003-10-20 Thread CPT John W. Holmes
From: Chris Boget [EMAIL PROTECTED] My bad. If MySQL had crosstab functionality, that *might* be able to help. A crosstab is just a specifically formatted query, of which MySQL is certainly capable of handling. I've done them in the past, but maybe you're thinking of something more complex.

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

2003-10-20 Thread CPT John W. Holmes
From: David T-G [EMAIL PROTECTED] [Actually, maybe I'm just too new at this, but I can't think of a practical example for which I would loop over $row... Care to help me out?] How about a dynamic query where you do not know the number of columns that'll be returned? You would not want to use

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

2003-10-20 Thread CPT John W. Holmes
From: Chris Boget [EMAIL PROTECTED] From: Chris Boget [EMAIL PROTECTED] My bad. If MySQL had crosstab functionality, that *might* be able to help. A crosstab is just a specifically formatted query, of which MySQL is certainly capable of handling. I've done them in the past, but maybe

Re: [PHP-DB] Re: looping over $row (was Re: [PHP-DB] Using two colomns ...)

2003-10-20 Thread CPT John W. Holmes
From: David T-G [EMAIL PROTECTED] Hmmm... I suppose so, but I can't picture it. Shouldn't you always know the DB schema and format of what you're going to get back? I can see not knowing how many RECORDS you'll get back but I should think you would know how many FIELDS will be in each.

Re: [PHP-DB] Sessions and MySQL?

2003-10-16 Thread CPT John W. Holmes
From: [EMAIL PROTECTED] And I'm trying to add a session variable to a MySQL database. I've done this page that takes the results from a previous form... But I get this error: Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' On line 83 Which is the

Re: [PHP-DB] problem - query inside a function

2003-10-16 Thread CPT John W. Holmes
From: Luis M Morales C [EMAIL PROTECTED] My Comment bellow: On Wednesday 15 October 2003 14:38, Kirk Babb wrote: Hi, I'm having trouble with a query inside a function. I thought I'd written this so that the function would fail if email and zipcode supplied were not in the same row

Re: [PHP-DB] inserting date from text file

2003-10-15 Thread CPT John W. Holmes
From: Aleks @ USA.net [EMAIL PROTECTED] I have a large text file that I am inserting into a mysql db and seem to have a problem with the date format. The data is currently in the mm/dd/ format. MySQL expects a MMDD or -MM-DD format (the delimiter for the string version can be any

Re: [PHP-DB] mySQL field structure question

2003-10-01 Thread CPT John W. Holmes
From: Susan Ator [EMAIL PROTECTED] If I have a field in mySQL consisting of a number with 8 digits a decimal point and 4 more digits what is the field type it needs to be to sort it numerically? I've tried decimal(8,4) but it converts everything to .. I've also tried float but

Re: [PHP-DB] ereg_replace

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

Re: [PHP-DB] Replacing + with question

2003-09-30 Thread CPT John W. Holmes
From: Graeme McLaren [EMAIL PROTECTED] Jason, thank you for reply. I tried switching the 1st 2 parameters in the str_replace function so that it now looks like this: $AddressLine1 = urlencode($AddressLine1); $AddressLine1 = str_replace(+, , $AddressLine1); Unfortunately as I am now

Re: [PHP-DB] Storing Session Variables

2003-09-24 Thread CPT John W. Holmes
From: [EMAIL PROTECTED] Is there a limit to the number of session variables one can create/store ? Or is the limit imposed by the size of the file ? Size of file is only limit, although you should impose a practical limit yourself. If you need to ask this question, you're probably relying on

Re: [PHP-DB] update db with variables

2003-09-24 Thread CPT John W. Holmes
From: Robbie Staufer [EMAIL PROTECTED] I'm writing an application that will display the contents of a db in the browser, including the db-assigned id number. The user can then enter the id number in a form and the browser will display the record corresponding to that id number, with the data

Re: [PHP-DB] Storing Session Variables

2003-09-24 Thread CPT John W. Holmes
From: [EMAIL PROTECTED] CPT John W. Holmes [EMAIL PROTECTED] From: [EMAIL PROTECTED] Is there a limit to the number of session variables one can create/store ? Or is the limit imposed by the size of the file ? Size of file is only limit, although you should impose a practical

Re: [PHP-DB] Query Filter in GUI

2003-09-22 Thread CPT John W. Holmes
From: [EMAIL PROTECTED] I have a PHP GUI in which a select box gets populated by a query of a MySQL DB for all CD's by all artists when the page is first opened. I am now trying to implement the same query but with a WHERE clause that filters the returned CD's to be displayed in the same

Re: [PHP-DB] Working query not able to run with PHP script.

2003-09-19 Thread CPT John W. Holmes
From: Jonathan Villa [EMAIL PROTECTED] I have several tables I want to delete as well as their reference in another database The query produced is this: === DROP TABLE xxx.zorder_47629403705b7e7f0c97387559d8c811;

Re: [PHP-DB] sql optimizing assistance

2003-09-19 Thread CPT John W. Holmes
From: [EMAIL PROTECTED] I have two tables and am running a simple join between them to get questions and their repsective response averages from a survey. The question table has 49 rows and the Response table has 126,732. I'd like to cut down on the time its taking to run this specific

Re: [PHP-DB] Need to Run a PHP script using CRON or ?

2003-09-15 Thread CPT John W. Holmes
From: Jonathan Villa [EMAIL PROTECTED] I have an application which creates temporary tables. My plan is to remove them after a 24 hour period and only those which are have a created time greater than 24 hours. That part I can do, my question is how will I be able to run this script which

Re: [PHP-DB] Need to Run a PHP script using CRON or ?

2003-09-15 Thread CPT John W. Holmes
From: Jonathan Villa [EMAIL PROTECTED] wget -q -O - www.domain.com/cron.php /dev/null Interesting... how does this fair concerning security? So I'll have to have this file located in my document root, is this a good thing? My current directory structure consists of several files located

Re: [PHP-DB] Need to Run a PHP script using CRON or ?

2003-09-15 Thread CPT John W. Holmes
From: Ryan Marks [EMAIL PROTECTED] Not necessarily. You can wget /path/to/file.php or my personal preference is not to use wget, but php directly /path/to/php/executable /path/to/file.php Are you sure about that? I thought wget had to go through HTTP? This didn't work for me, am I doing it

Re: [PHP-DB] Need to Run a PHP script using CRON or ?

2003-09-15 Thread CPT John W. Holmes
- Original Message - From: Pat Lashley [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, September 15, 2003 5:12 PM Subject: Re: [PHP-DB] Need to Run a PHP script using CRON or ? --On Monday, September 15, 2003 15:27:45 -0500 Jonathan Villa [EMAIL PROTECTED]

Re: [PHP-DB] how to recognize user login name?

2003-09-04 Thread CPT John W. Holmes
From: David Smith [EMAIL PROTECTED] Spychaa Wojciech wrote: I have to do user recognizing in m php project. Simplest method i know is to recognize for example login name (when user is logging into his local PC) I've tried to use $USERNAME variable but it isnt what i want because it

Re: [PHP-DB] Heop someone can help with this.. involves sessions.

2003-09-02 Thread CPT John W. Holmes
From: Aaron Wolski [EMAIL PROTECTED] I really hope you don't mind the OT post but I've looked everywhere and can't seem to find a solution to my problem. I am passing a var in a session (not in the URL) to my secure checkout area and it's not capturing the variable. I know there is a

Re: [PHP-DB] looking for a .exe file

2003-08-28 Thread CPT John W. Holmes
From: blond al [EMAIL PROTECTED] I need a php editor file thanks for help! file:///WINNT/system32/notepad.exe You're welcome. ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Populating an array from mysql db

2003-08-28 Thread CPT John W. Holmes
From: mike karthauser [EMAIL PROTECTED] I have a course booking system that allows the client to add courses and then specify how long they run for. The admin system I have built allows the client to add up to 30 dates for each instance of the course and these are adding to a database row in

Re: [PHP-DB] Populating an array from mysql db

2003-08-28 Thread CPT John W. Holmes
From: mike karthauser [EMAIL PROTECTED] Thanks for this - I ended up rehashing my query to this: ? $result = mysql_query(SELECT * FROM dates WHERE bookcode = '$bookcode' ORDER BY date1,$db); // loop to populate array $myrow = mysql_fetch_array($result); $i = 1; while ($i = '30') {

Re: [PHP-DB] SESSION SID Question

2003-08-28 Thread CPT John W. Holmes
From: [EMAIL PROTECTED] Can someone explain to me the mechanism by which SID acquires a value? For example, $FOO = SID; echo $FOO; produces something like PHPSESSID=ade4055eef947f1a00cdb280470e859b when IE is first opened and the page is loaded, whereas reloading of the page produces an

Re: [PHP-DB] changing datatypes in the query

2003-08-27 Thread CPT John W. Holmes
From: Matt Babineau [EMAIL PROTECTED] On Tue, 2003-08-26 at 11:21, Matt Babineau wrote: Tough question (I think). I am pulling some numbers out of a data base, currently they are stored in a blob. When I try to order by user_hits desc it does a text ordering, not a numerical ordering. Is

Re: [PHP-DB] timestamp formatting on display?

2003-08-27 Thread CPT John W. Holmes
From: Aaron Wolski [EMAIL PROTECTED] Having a brain laps and not sure where in the manual to look and sadly I need a QUICK solution. I have a date formatted in a table like: 20030826132457 Now.. I went to MySQL timestamp from UNIX timestamps because I like the readability of them when just

Re: [PHP-DB] Problem in executing linux command from PHP

2003-08-27 Thread CPT John W. Holmes
From: Gnanavel [EMAIL PROTECTED] I have problem in executing linux command $output=exec(ls -a); echo pre$output/pre; the above coding works, but $output=exec(cp file1 file2); echo pre$output/pre; does not works. can any one help me out of this problem Riddle me this... exec()

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

2003-08-27 Thread CPT John W. Holmes
From: Dillon, John [EMAIL PROTECTED] How do I avoid the problem in the subject hereto? SELECT query uses variable in the WHERE clause. Fails on the following query: SELECT Tbl.fld FROM Tbl WHERE Tbl.fld2='11301201 0603A HKA 3902 #3708_JD's AE Exp' AND ... Escape the single quote with a

Re: [PHP-DB] Logic Help...

2003-08-27 Thread CPT John W. Holmes
From: NIPP, SCOTT V (SBCSI) [EMAIL PROTECTED] Thanks for the feedback. This seems to have helped, but something is still not working with the logic. Here is the updated code: ?php while($cntr != 0) { $cntr--; if (($shell[$cntr] == ) || ($grp[$cntr] == )) { echo p

Re: [PHP-DB] Logic Help...

2003-08-26 Thread CPT John W. Holmes
From: NIPP, SCOTT V (SBCSI) [EMAIL PROTECTED] This isn't specifically a DB related question, but... The following code snippet is not functioning for me. I keep receiving a parse error on the if line. Basically I want to stop execution of this page if either of the conditions in the if

Re: [PHP-DB] MYSQL 4.1 derived tables and PHP

2003-08-22 Thread CPT John W. Holmes
From: Jack van Zanen [EMAIL PROTECTED] I have installed MYSQL 4.1 with support for derived tables. If I query Mysql with a query that has a subquery in the from clause it works fine. If I now load this query in PHP I get invalid resource error. If I change the select for another select w/o the

Re: [PHP-DB] join across databases - how to select databases?

2003-08-22 Thread CPT John W. Holmes
From: Moshe Weitzman [EMAIL PROTECTED] I have looked all over the web but can't find an example *in php* for connecting to a mysql server, selecting database(s), and issueing a query which joins across databases. I already know the SQL required to achieve a multiple database query. My

Re: [PHP-DB] join across databases - how to select databases?

2003-08-22 Thread CPT John W. Holmes
From: [EMAIL PROTECTED] to my knowledge this is not possible in MySQL. There are only joins at the table level. I've been curious about this in the past myself, so if i'm incorrect, i'm hoping to hear it via this post. You can stop hoping now. It is indeed possible. :) mysql select * from

Re: [PHP-DB] WHERE mydatestamp '2003-08-22 13:13:13'

2003-08-22 Thread CPT John W. Holmes
From: Matt Babineau [EMAIL PROTECTED] I'm trying to find things in my database that are greater then Now(), but the date is stored in a blob (don't ask, I know :-0). Is there a way I can do that comparison to find things that are in the future? Option 1: Make a second column of DATETIME and

Re: [PHP-DB] It\'s wierd when I\'ve used forms...

2003-08-22 Thread CPT John W. Holmes
From: Jacob A. van Zanen [EMAIL PROTECTED] You'll have to look into stripslashes function (of the top of my head) PHP automatically puts slashes around variables PHP automatically escapes quotes in incoming form data when magic_quotes_gpc is enabled. If you do not want then, then either

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

2003-08-14 Thread CPT John W. Holmes
From: Dillon, John [EMAIL PROTECTED] While doing a cross tabulation, I've got a query which gives me a variable number of fields: Maybe mysql_num_fields() and mysql_field_name() will be of use, here? Check the manual.. ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To

Re: [PHP-DB] Table Field type

2003-08-14 Thread CPT John W. Holmes
From: Michelle Whelan [EMAIL PROTECTED] Does anyone know what field type to use for inserting a webpage name into a database? Example pagename.html When I fill in the form information everything seems to insert fine, then I do a search to see the result and nothing is there, so I check the

Re: [PHP-DB] Database Design Issue

2003-08-14 Thread CPT John W. Holmes
From: Jason Lange [EMAIL PROTECTED] Here's my question. I'm creating a website for a weekly radio show. One of the items I would like to store in the database is the list of songs played in each show (there's normally between 20-25 songs per show), and the songs will be displayed by show.

Re: [PHP-DB] Query Cache not Working? MySQL 4.0.14-standard

2003-08-14 Thread CPT John W. Holmes
From: Matt Babineau [EMAIL PROTECTED] For some reason my MySQL doesn't seem to be caching queries! And you expect PHP to solve this how? Do you want PHP to cache the queries? You must say please... You need to set the four variables mentioned at the following URL in your my.cnf file.

Re: [PHP-DB] Pulling an ID list from a DB, then filtering that list againstanother list of ID's

2003-08-14 Thread CPT John W. Holmes
From: Matt Babineau [EMAIL PROTECTED] Got an interesting problem! I have a list of ID's, basically things people have viewed on my website. When I pull the viewable items from my database, I need to be able to filter out all the ID's people have already viewed, so that they only get a list of

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

2003-08-14 Thread CPT John W. Holmes
From: Dillon, John [EMAIL PROTECTED] Thanks to both responses. In fact, it decided to work once I put 0 in the cell that 1 was to be added to! It seems it got it started.. 1+NULL=? 1 + NULL = NULL Any math statement with NULLs in it will equal NULL. (DB wise) ---John Holmes... -- PHP

Re: [PHP-DB] RE: Pivot tables

2003-08-14 Thread CPT John W. Holmes
All of the work is in the queries, so it doesn't matter that the example at the end is in Perl. The whole concept is that you're using SUM(IF(column=value,1,0)) to sum up your values. To get each of the values you can run a query and use the results of that query to build your second query with

Re: [PHP-DB] Maximum execution time of 30 seconds exceeded

2003-08-12 Thread CPT John W. Holmes
I'd agree with what someone else said about keeping a separate table full of possible pin numbers. Fill it with all of the pin numbers to begin with, add in a building or department row so you know what sequences go with what building, etc. Then, to get a pin number for someone, you can just:

Re: [PHP-DB] displaying result across 3 cells - where did I go wrong?

2003-08-05 Thread CPT John W. Holmes
From: Aaron Wolski [EMAIL PROTECTED] So.. do I need to use 2 different incrementors? $z and say $x for each part? I basically pieced this code together from several examples I found so forgive forgive the fact I don't know a whole lot about the code even though I've tried to understand it as

Re: [PHP-DB] displaying result across 3 cells - where did I go wrong?

2003-08-05 Thread CPT John W. Holmes
From: Aaron Wolski [EMAIL PROTECTED] while($z++ %3 !==0) [snip] echo (++$z %3 == 0) ? '/tr' : ''; The first time through your code, $z is zero. Since the thread titles don't match, your going to get to your while loop above. $z is

Re: [PHP-DB] Limit

2003-08-04 Thread CPT John W. Holmes
From: Marie Osypian [EMAIL PROTECTED] I don't want to use the limit on this query anymore. What I want is to display all that are dated within the last 3 months. What would be the easy way to do that? SELECT federal_development_id, UNIX_TIMESTAMP(date) AS date, topic, body

  1   2   >