[PHP-DB] Re: SQL syntax

2013-01-15 Thread Frank Flynn
Or is there a better way to check multiple options against an enum inside your select statement? IN for example: orderstatus IN ( 'Cancelled', 'New', 'Denied', 'Expired') However this is not exactly what you are doing. You want different orderdate $yesterday depending on the orderstatus.

[PHP-DB] Re: mysqldump

2013-01-01 Thread Frank Flynn
mysqldump is a separate program (it runs outside of the mysql shell). I noticed you have ; at the end and perhaps you are trying to run it inside MySQL client. The ; by itself is not a problem for the OS shell (bash or whatever) but you don't need it unless you are running multiple commands

[PHP-DB] Re: php-db foreign key

2011-08-09 Thread Frank Flynn
You already have a foreign key, that is stores.store_by references users.user_id. You might not have declared it (which is OK) but if that is the key you want that is fine. I suspect you are seeing an inadvertent Cartesian product. The way you have written this query you will get one row

Re: [PHP-DB] db privileges

2009-01-06 Thread Frank Flynn
On Jan 6, 2009, at 7:41 AM, php-db-digest-h...@lists.php.net wrote: I was wondering if there is a php function and/or mysql function that can be run from php to find out the privileges for a particular db connection. Any ideas? Just to get you started try: select * from mysql.user

[PHP-DB] Re: php-db Digest 7 Oct 2006 03:29:53 -0000 Issue 3503

2006-10-06 Thread Frank Flynn
If you only have Wednesdays in you table - that is select the next 12 records after today it's easy: SELECT * FROM christian_discipleship WHERE created_for_date now() ORDER BY created_for_date ASC LIMIT 12 Good luck, Frank On Oct 6, 2006, at 8:29 PM, [EMAIL PROTECTED] wrote: I am

[PHP-DB] Re: retaining and displaying line returns in a text field

2006-01-06 Thread Frank Flynn
This is an HTML issue (not PHP or MySQL) that is HTML ignores carriage returns (and most other white spaces). There are two simple solutions: use pre tags: echo pre $rmks/pre; Or replace the \n with br $newRmks = str_replace ( \n, br, $rmks ); echo $newRmks; You can do this going

[PHP-DB] Re: SELECT

2005-12-11 Thread Frank Flynn
Ron You want SELECT DISTINCT ... or SELECT column list FROM table GROUP BY column list In either case you probably can't use SELECT * - you have to specify the columns you're after. This is because these commands will look for any differences and if they see one they'll give you a new

Re: [PHP-DB] Login Auth help? | Handling pages help? (2 questions)

2005-11-13 Thread Frank Flynn
On Nov 10, 2005, at 7:21 AM, [EMAIL PROTECTED] wrote: Need some ideas/opinions on a project I have. The project is for a Radio Station (online one) where DJ's can login to the site and do stuff and listeners can listen in live to the live feeds. Now I downloaded a password protected

[PHP-DB] Re: insert error for mysql

2005-09-22 Thread Frank Flynn
What is causing this is a single quote in the string you're trying to insert. You should use: $yourString = mysql_real_escape_string ( $yourString ); before you try to insert it. Also it looks like you have named your table 'view' and I suggest you don't do this, in the new version of

[PHP-DB] Re: Highlighting data selected from one table that appear in another

2005-09-01 Thread Frank Flynn
I'm thinking that you need a LEFT JOIN (see the mysql documentation) to do this. Basically LEFT JOIN (or RIGHT JOIN) allow you to select all the rows from the table on the left side even if they have no corresponding row on the right side (the values of the columns in the select that

RE: [PHP-DB] multiple queries, one transaction - REWORDED

2005-05-22 Thread Frank Flynn
A few ideas occur to me. You don't have enough information about your schema for me to say for sure which of these would be best. 1 - put all the inserts into one statement: $myQuery = INSERT INTO purchaseItems (orderID, itemIDs, itemQty) VALUES (; $i = 1; foreach ($order as

[PHP-DB] Re: Moving data from one MySQL table to another

2005-05-20 Thread Frank Flynn
First off - is this a solution in search of a problem? Databases are excellent at indexing and caching frequently used data. Though your table has millions of rows and you are only really interested in a few hundred you might find that performance is not noticeably any different than if

[PHP-DB] Re: MySQL backup software

2004-10-27 Thread Frank Flynn
There must be a dozen solutions here; mysqldump and cron come to mind but you haven't been very specific with your needs. Is your database server Windows or Unix? Can you write a simple script (or modify an example) to fit your needs? What are you going to back up to? Another server? Tape?

Re: [PHP-DB] Multi Page Form

2004-10-04 Thread Frank Flynn
Using hidden fields is not less secure than using visible fields - or session variables which were filled out by end user input. Hidden fields can be modified but so can any other field and you need to check that the values you receive are expected and proper before you process them. There

[PHP-DB] Re: spliting keywords by GET method and SQL query

2004-09-30 Thread Frank Flynn
The method doesn't matter, use whatever you like. Did this quick just for the fun, it seems to work. Set $search to whatever you'd like to try or to your GET or POST argument. ,,, eurpoe won't cause a problem but + + + europe will generate some odd SQL (although it will work as expected -

[PHP-DB] Re: Using Cursors

2004-06-01 Thread Frank Flynn
a SELECT statement and the results are put into this cursor and now you can run a loop of some kind on that cursor. Personally I can't remember the last time I used one, but I know I have used one - I remember looking it up. Frank -- Frank Flynn Poet, Artist Mystic -- PHP Database Mailing List

[PHP-DB] Re: Insterting date in an MySQL table

2004-05-06 Thread Frank Flynn
,email VARCHAR(30),answer TEXT, PRIMARY KEY(ID)); Is there any other date field that gets the date form as I want? Thanks in advance Charalambos Nicolaou -- Frank Flynn Poet, Artist Mystic -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net

[PHP-DB] Re: Looking for simpler way to do this...

2004-03-22 Thread Frank Flynn
the number of queries down, as it has to do join searches on a couple of these to handle the perms and other things on each page... TIA Rene -- Rene Brehmer aka Metalbunny http://metalbunny.net/ References, tools, and other useful stuff... -- Frank Flynn Poet, Artist Mystic -- PHP

[PHP-DB] Re: php-db Digest 8 Mar 2004 20:50:10 -0000 Issue 2294

2004-03-08 Thread Frank Flynn
... anyone have an idea?? THanks in advance... Aleks -- Frank Flynn Poet, Artist Mystic -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] how to do query on partial field contents ???

2004-02-24 Thread Frank Flynn
] how to do query on partial field contents ??? -- Frank Flynn Poet, Artist Mystic -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DB] Re: php-db Query

2004-02-24 Thread Frank Flynn
another query Any idea -- Frank Flynn Poet, Artist Mystic -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] how to do query on partial field contents ???

2004-02-24 Thread Frank Flynn
Too true - this is why a page that I promised would only take a few minutes winds up taking all week. But it makes steady employment for the QA team... Frank On 2/24/04 10:37 AM, Andy Armstrong [EMAIL PROTECTED] wrote: Frank Flynn wrote: And if you'd like to make wild carding optional

[PHP-DB] Re: Stored procedure with UNION---no unique id, how to page?

2004-02-19 Thread Frank Flynn
button only needs to store the web_user value and the number of the row you're on now. If you need some sample code I can send you some but really it's pretty straight forward in the PHP side. Good Luck, Frank -- Frank Flynn Poet, Artist Mystic -- PHP Database Mailing List (http

Re: [PHP-DB] sql, problem with join and presentation

2004-02-17 Thread Frank Flynn
must be missing something simple. (using mysql) thx for any clues Gil -- Frank Flynn Poet, Artist Mystic -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DB] Subscribe digest

2004-02-12 Thread Frank Flynn
Subscribe digest -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP-DB] arranging folders hiearchy

2002-06-09 Thread Frank Flynn
The problem is you're overloading your PATH field. An SQL engine cannot tell the different meanings between (other than they are different): ' 1 3 7' and ' 1 2 6' You can do this 'live' with only the ID, PID and the name SECTION and then a temporary

[PHP-DB] Re: Multi-table query slower than using array?

2002-05-31 Thread Frank Flynn
is up to 10 seconds! Was the array method the better way? -- Frank Flynn Poet, Artist Mystic -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DB] Re: newbie:What database can I use with php4 ?

2002-05-31 Thread Frank Flynn
Craig, You can use just about any modern DBMS. If you're concerned about support why not ask your hosting company up front - I've never had any problems finding support for MySQL (although my Oracle, MS and IBM sales reps have all claimed I would). The cost is stunning - Oracle list price is

[PHP-DB] Re: Mutiple inserts with one query?

2002-05-31 Thread Frank Flynn
Yes there is, it's kind of a hack... If you insert using values you can only insert 1 row: INSERT foo (col1, col2, col3) VALUES(Moe, Larry, Curley) But if you use a select statement it will insert as many rows as the select returns: INSERT foo (col1, col2, col3) SELECT col1, col2, col3

[PHP-DB] Re: Adding totals

2002-05-21 Thread Frank Flynn
) of a cartain column whithin a row and show up the result? I have several time inputs and need to show the total. Thanx. Cesar Aracena [EMAIL PROTECTED] Neuquen, Argentina -- Frank Flynn Poet, Artist Mystic -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http

[PHP-DB] Re: php-db Digest 1 May 2002 19:24:34 -0000 Issue 1181

2002-05-01 Thread Frank Flynn
Hi Dave, The easiest, most direct, ANSI - SQL way to do what you ask is: SELECT count(*) as num_posts, Admin_id FROM your_table_Name WHERE optional but you could narrow the results here GROUP BY Admin_id ORDER BY Admin_id This will give you: num_posts Admin_id - 3

[PHP-DB] Re: Newbie and having to convert from idc/htx format

2002-04-27 Thread Frank Flynn
On 4/27/02 1:52 AM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I'm not too familiar with idc/htx but I have used PHP, IIS, MS SQL and Linux and had great results. Here are some ideas that might help you: -Try installing PHP on your current server (IIS) now you can convert sections of your web

[PHP-DB] Re: php-db Digest 23 Apr 2002 18:14:40 -0000 Issue 1168

2002-04-23 Thread Frank Flynn
and .htpasswd files but I'm not sure yet... Can anyone suggest the best way to protect my database? If it is to complicated to be explained in an email please suggest just the functions names and I'll try to find the way... Thanx Achilles -- Frank Flynn Poet, Artist Mystic -- PHP Database

[PHP-DB] Re: mssql problems

2002-04-19 Thread Frank Flynn
development one, out of date maybe but you should see my clothes but PHP was test downloaded a month ago - any ideas from a white knight? best regards Rob -- Frank Flynn Poet, Artist Mystic -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net

Re: [PHP-DB] Delete from mysql table is there a way to....

2002-04-16 Thread Frank Flynn
. if ($quantity == 0) { $gone = mysql_query(DELETE FROM {$config[prefix]}_my_items WHERE uid={$session[uid]} AND id = '$item'); } -- Frank Flynn Poet, Artist

Re: [PHP-DB] Delete from mysql table is there a way to....

2002-04-16 Thread Frank Flynn
but for MySQL it's: SHOW TABLE STATUS FROM ... LIKE ... In MS SQL it's: sp_spaceused ... In Informix it's: onstat (-something I forget which but there help in onstat) I forget Oracle but it's somewhere in the Enterprise manager... Good Luck, Frank -- Frank Flynn Poet, Artist Mystic

[PHP-DB] Re: Making a txt file from db data, is it possible?

2002-04-06 Thread Frank Flynn
On 4/6/02 4:12 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: From: Raymond Lilleodegard [EMAIL PROTECTED] Date: Sat, 6 Apr 2002 17:18:07 +0200 To: [EMAIL PROTECTED] Subject: Re: Making a txt file from db data, is it possible? May I use this dump method with a query too? Or is this only

[PHP-DB] IP address datatype - any ideas or pointers?

2002-04-06 Thread Frank Flynn
Hi All, I'm just starting on a database to track IP addresses. I'm thinking about how best to store the IP address - 4 tinyints, varchar or char; as one big varchar or 4 chunks? We will eventually want to look at things by net or subnet and being able to search on the various parts of the

[PHP-DB] Re: php-db Digest 23 Mar 2002 22:20:08 -0000 Issue 1113

2002-03-23 Thread Frank Flynn
See below... On 3/23/02 2:20 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: From: Ljungan [EMAIL PROTECTED] Date: Sat, 23 Mar 2002 11:17:15 +0100 To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] marking DB entries... Thanks Frank! Just to be certain, cant I If two users enter the same

Re: [PHP-DB] marking DB entries...

2002-03-22 Thread Frank Flynn
OK so you have 2 tables one for users login and one for the addresses a user may store and retrieve. Your users will login, you will validate their name and password combination and have either a userID or the name is fine too (an integer ID is smaller to store and possibly more efficient). Now

Re: [PHP-DB] SQL statement - PHP/mySQL - brain fart

2002-03-18 Thread Frank Flynn
Well it's sorta' simple once you get your mind around this - you need two tables but you've only got one. And there's no OR, you need both to be true for a site_id ... The query would be easy if you actually had two tables so we'll search off of the same table twice giving it different names

Re: [PHP-DB] Hosting - what's needed to handle 650K queries?

2002-03-10 Thread Frank Flynn
You actually have several options here and some things could complicate the issue too. A previous poster suggested that 36 page views a second would be satisfactory - this sounds reasonable but it's also my experience that in the Windows world the way the systems tend to fail is to become

[PHP-DB] Re: counting of values in one field possible with one sqlstatement?

2002-03-07 Thread Frank Flynn
-- Frank Flynn Poet, Artist Mystic -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DB] Re: php-db Digest 5 Mar 2002 01:49:55 -0000 Issue 1083

2002-03-04 Thread Frank Flynn
Without knowing what you are trying to do I get the impression you might be better off doing this via SQL rather than PHP. You say: ...very large result sets, which are transferred to arrays, and that does some extremely heavy lifting in terms of calculations on those arrays. By design, it

[PHP-DB] Re: Difficult count statement. Need some sql advice

2002-03-02 Thread Frank Flynn
Well off the top I'd say your forgot the join condition between the fo_topics and the fo_forums tables. Right now you're counting the Cartesian product of the two tables. Also you can't select an aggregate function (like count) and regular columns without a group by on the same columns. F on

[PHP-DB] Re: php-db Finding records with NULL values

2002-02-26 Thread Frank Flynn
, with the question number, member id and response. I wish to produce a SELECT query that will find the questions that haven't been answered by a particular member, i.e. a query that finds the questions that DO NOT have an entry in responses. How can I do this? Regards, Robin -- Frank Flynn Poet

[PHP-DB] Re: The Debacle

2002-02-25 Thread Frank Flynn
Interesting question... Libraries traditionally use Distillers, The but really this is a hold over from the card catalogues where if they didn't do it that way the T section would be over half of the catalogue. Also it's easier for people to notice that the library puts the the second but

[PHP-DB] Re:Instest of add, subtract

2002-02-23 Thread Frank Flynn
I (too often) find that odd behavior like this is because one of the variables is set incorrectly (not what I expected) even if it sometimes works. A very useful debugging technique is to print out $query just before you send it to the DB. You might be surprised at what you're sending.

[PHP-DB] Re: php-db Digest 21 Feb 2002 02:46:40 -0000 Issue 1062

2002-02-20 Thread Frank Flynn
Beau, I've got two words for you - NOT IN - I'll even show you where those 2 words go: SELECT students.studentID, students.title, students.fname, students.lname, students.studentNo FROM students, theses WHERE theses.studentID=students.studentID AND theses.thesisID NOT IN (SELECT thesisID

Re: [PHP-DB] SQL

2002-02-19 Thread Frank Flynn
Jonathan, You didn't mention which DBMS you're using (Oracle, MySQL, MS SQL, ...) and the are each a little different but I'll try to solve with fairly generic SQL: My personal preference is keep it simple, break up the SQL if it helps (and I think it would help here). I'd use a third table,

[PHP-DB] Re: Problems with creating a report

2002-02-19 Thread Frank Flynn
Rod, I hope I've got what you're trying to do. You have a table with a record for each day and columns rate1 and rate2 - You are trying to collapse the single days into a range where the rates are the same? So if I added column titles to your sample report: Start Endrate1

[PHP-DB] Re: php-db Digest 11 Feb 2002 20:12:53 -0000 Issue 1046

2002-02-12 Thread Frank Flynn
On 2/11/02 12:12 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: It sounds to me like you are blowing away name in the URL when you submit a new form. ../index.php?name=My Name Is just like clicking the submit button on a form with: action = ../index.php method = get When you users use a

[PHP-DB] RE: Combined sql statement

2002-02-04 Thread Frank Flynn
Miles is correct, this the standard way (without knowing your application and if I could figure out another trick). But if you absolutely don't want to use two SQL blocks you can set your SQL block to something like this: $sql = DELETE FROM $table_name WHERE our_serv = \$our_serv\ INSERT

[PHP-DB] Re: php-db Digest 5 Feb 2002 02:30:20 -0000 Issue 1034

2002-02-04 Thread Frank Flynn
Hans, On 2/4/02 6:30 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: From: hz11 [EMAIL PROTECTED] Date: Mon, 04 Feb 2002 21:17:15 -0500 To: [EMAIL PROTECTED] Subject: Dealing with One-to-Many SELECTS (MySQL) to get a single event. This all works fine, however this is the result

[PHP-DB] Re: php-db Digest 1 Feb 2002 07:48:33 -0000 Issue 1027

2002-02-01 Thread Frank Flynn
On 1/31/02 11:48 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: From: DL Neil [EMAIL PROTECTED] Reply-To: DL Neil [EMAIL PROTECTED] Date: Fri, 1 Feb 2002 16:28:16 - To: Frank Flynn [EMAIL PROTECTED], [EMAIL PROTECTED], Garry Optland [EMAIL PROTECTED] Subject: Re: [PHP-DB] Re: Date

Re: [PHP-DB] Ensuring users don't overwrite each other (NOT a newbiequestion)

2002-02-01 Thread Frank Flynn
Are you guys interested in yet another solution? It simular but I think it's even easier if that's an incentive... -In your table do put a datetime field, I'll call it lastMod. This will be the last updated date and time (you need time here) -In your form have this as a hidden field so it

[PHP-DB] Re: Date operations.

2002-01-29 Thread Frank Flynn
, and then average that on a monthly basis. I can't see that scaling very well, as there might be several hundred breeding records for a given year, multiplied by 365 days. Has anyone any hints/pointers for an efficient way to do this? Regards, Garry. -- Frank Flynn Poet, Artist

RE: [PHP-DB] Re: Moving from MySQL to MSSQL Server 2000

2002-01-16 Thread Frank Flynn
There are few things you should consider; perhaps you already have. You may not be replacing the OS of your Web server but you will be adding a new OS for the database since MS SQL only runs on Windows. So now your site will have a Solaris / Apache piece and Windows cluster running MS SQL. I

[PHP-DB] MSSQL - PHP4 on Win 2K - will not run a query.

2002-01-16 Thread Frank Flynn
Hello all, I'm having a problem getting PHP to run a query against a MSSQL 7 database. I have installed PHP, the MSSQL client tools and the php_mssql.dll all according to the documentation. PHP will connect to the database just fine. But if I send the query to execute it will never return, no