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
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
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
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
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
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
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
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 =