[PHP-DB] Re: boooking: get available dates

2004-02-12 Thread Frank M Flynn
Right idea but I think this will be more efficient (who knows try both - you have a lot of ORs which can force another query to run): I'm assuming your Unit table is called unit and the primary key is id and this joins to bookings.unit_id SELECT id FROM bookings left join unit ON id =

[PHP-DB] Re: mssql query

2004-03-16 Thread Frank M Flynn
On Mar 16, 2004, at 5:17 PM, [EMAIL PROTECTED] wrote: From: Adam Williams [EMAIL PROTECTED] Date: March 16, 2004 7:32:57 AM PST To: [EMAIL PROTECTED] Subject: mssql query I've used mysql a little, but now I'm working with a MS SQL SERVER 2000 database. We have a proprietary application/hardware

[PHP-DB] Re: Where Error

2004-05-29 Thread Frank M Flynn
You don't say which DBMS your using or what the specific error message (sometimes they are helpful - although sometimes useless) is but I think what your after is: where status = 'i' Notice that you must quote the values for string or characters. Try this on your DBMS's command line (no

Re: [PHP-DB] Complicated Question (maybe)?

2005-01-11 Thread Frank M Flynn
Turning off 'Update' privileges in the DB will work but it's ugly. REVOKE UPDATE ON your table.column - or - * for all FROM the web user http://dev.mysql.com/doc/mysql/en/GRANT.html for documentation Now when someone tries to update this they will get an error and unless you have different

[PHP-DB] Re: MySQL query problems...

2005-03-24 Thread Frank M Flynn
The error message and when I have problems I find it's very helpful to print the actual value of the $query variable. In your case it looks like AND acct_db.key1 LIKE \%\.AllMid_Data.CPU_Hostname is adding AND acct_db.key1 LIKE %.AllMid_Data.CPU_Hostname and you can't join two strings

[PHP-DB] Re: php and tables

2005-04-18 Thread Frank M Flynn
There are two places you can figure out the average: in MySQL or in PHP. Then you want to sort the results by this Average: in MySql use ORDER BY and in php use array_multisort in MySQL your SQL might look like: SELECT TEAM, PLAYED, WIN, LOSS, DRAW, POINTS, POINTS / PLAYED as AVERAGE

[PHP-DB] Re: SQL or array ?

2005-04-23 Thread Frank M Flynn
Paul, Interesting - I don't know which would give better performance, there are too many things I don't know about your set up but here are some general rules I think would apply: How many files are we talking about? If it's many I think a database is the only way to go. What happens when

[PHP-DB] RE: What's the PHP equivallent of mysql mydb somefile.sql

2006-11-07 Thread Frank M Flynn
You can put any valid SQL command into the mysql_query command so you could write a PHP file that had a bunch of lines like these (after your connect and such) mysql_query ( ALTER TABLE foo ADD COLUMN bar int... ); mysql_query ( CREATE TABLE foo2 (foo2ID int) ); Better still to check