[PHP-DB] Can you SUM(IF) from two different tables at the same time?

2002-05-27 Thread Richard Davey
Hi all, I'm using the following two queries: 1. SELECT SUM(IF(boardid='2',1,0)) AS b2, SUM(IF(boardid='1',1,0)) AS b1, COUNT(*) AS total FROM thread 2. SELECT SUM(IF(boardid='2',1,0)) AS b2, SUM(IF(boardid='1',1,0)) AS b1, COUNT(*) AS total FROM message This literally brings back a total

[PHP-DB] Re: Can you SUM(IF) from two different tables at the same time?

2002-05-28 Thread Richard Davey
Hugh Bothwell [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Instead, you want a query which returns a record with thread count and message count for each group. SELECT COUNT(DISTINCT threadid) AS threads, COUNT(*) AS messages FROM thread LEFT

Re: [PHP-DB] multiple queries

2003-12-01 Thread Richard Davey
Hello Cameron, Tuesday, December 2, 2003, 1:08:19 AM, you wrote: CS $sql = SELECT * from dates where store=$store and date=$date; CS ultimately I would like to display data for 3 days on either side of CS this. The following is un-tested, but a quick look over the MySQL manual should firm

Re: [PHP-DB] Redirect.

2003-12-02 Thread Richard Davey
Hello gfmb, Tuesday, December 2, 2003, 11:18:40 AM, you wrote: gli I have a problem.How can I redirect from a PHP script to gli another script in asp, php or a HTML page? gli This script redirect to another script in function of the values of a variable. This isn't really a database related

Re: [PHP-DB] Annoying Server Responses

2003-12-02 Thread Richard Davey
Hello Richard, Tuesday, December 2, 2003, 6:51:40 PM, you wrote: HR Sorry to bother all of you with this, but are any of you still getting HR either of these responses each time you post to this list? Yes (he says waiting for another to arrive). -- Best regards, Richard

[PHP-DB] Selecting every 50th row

2003-12-02 Thread Richard Davey
Hi php-db, I have a table with approx. 250,000 rows in it. The primary key is an ID field. All I am wondering is - is there any way at all from MySQL to directly select every 50th row in this table? I.e. row 1, 50, 100, 150, etc and return the ID of each row, ideally with some kind of limit.

Re: [PHP-DB] Remote DB Connection

2003-12-03 Thread Richard Davey
Hello Omelin, Wednesday, December 3, 2003, 6:05:52 PM, you wrote: OM @mysql_connect ('ipaddres-server2', 'DBName', 'DBPwd') ; OM Is their anything else I need to consider to connect ? , The server must allow it :) other than that, not really. -- Best regards, Richard

Re: [PHP-DB] Dumping database/restoring

2003-12-04 Thread Richard Davey
Hello John, Thursday, December 4, 2003, 11:01:20 AM, you wrote: DJ The question is how do people out there DJ back up their database residing on a server to a local file? Ideally I would DJ download the database and save on a CD, and be able to restore from this if DJ the worst happened.

Re: [PHP-DB] cookies

2003-12-04 Thread Richard Davey
Hello Maris, Thursday, December 4, 2003, 10:40:33 AM, you wrote: MK Could you share with your experience and point out where MK is the problem here. I tried different variations for MK domain parameter in setcookie command but it didnt help It's a security mechanism built into cookies. They

Re[2]: [PHP-DB] cookies

2003-12-04 Thread Richard Davey
Hello Maris, Thursday, December 4, 2003, 12:24:10 PM, you wrote: MK img nocache border=0 width=2 height=1 MK src=http://www.cookiedomain.com/cookies/cookies.php MK isnt it refering and setting cookie for www.cookiedomain.com MK even if this HTML file is on another domain? No, because by that

Re: Fw: [PHP-DB] PhpmyAdmin from external computers

2003-12-04 Thread Richard Davey
Hello Andy, Thursday, December 4, 2003, 3:27:11 PM, you wrote: AL Im afraid ive already tried that. Are you sure your MySQL server is actually configured to ALLOW someone to login remotely? I know most of the ones I work with aren't. This isn't a setting you'll find in phpMyAdmin btw. Most

Re[2]: [PHP-DB] Planetside

2003-12-19 Thread Richard Davey
Hello Cal, Friday, December 19, 2003, 10:28:19 PM, you wrote: CE What is the Planetside database? It's a pay-to-play on-line multi-player FPS game run by Sony. I don't think you could interface with it directly, at least I'd be pretty surprised if you can. -- Best regards, Richard

Re: [PHP-DB] PHP/DB speed

2003-12-21 Thread Richard Davey
Hello Robin, Sunday, December 21, 2003, 10:15:35 PM, you wrote: RK The code I am using is thus and is retrieving around 2,500 records: RK $result = mysql_query($sql) RK while ($row = mysql_fetch_array($result)) RK { RK build OPTION stmt RK } You're building a

Re: [PHP-DB] Re: SQL WHERE datetime NOW

2004-01-06 Thread Richard Davey
Hello John, Tuesday, January 6, 2004, 5:20:22 PM, you wrote: J On further reading, it appears LIMIT stops the query running once x number J of records are retrieved without sorting the whole table first. Where did you read this? If you profile your query you'll notice that in say a 10,000

Re: [PHP-DB] (PHP-DB) Re: Using PHP with Vb6 to display Spatial Data.

2004-01-12 Thread Richard Davey
Hello jonah, Monday, January 12, 2004, 9:48:35 AM, you wrote: jm data and process information from the data. The issue is how to jm access the data through the worldwide web. I want to know whether jm PHP can be used to interface with VB and the data accessed using a jm browser. Depends

Re[2]: [PHP-DB] multi-language site

2004-01-15 Thread Richard Davey
Hello Ignatius, Thursday, January 15, 2004, 6:41:44 PM, you wrote: IR Gettext is NOT an automated translation service. What you do is mark strings IR to translate in the original application, then have them translated by a IR human. When confronted with a marked string to echo, the application

Re: [PHP-DB] db php question

2004-01-15 Thread Richard Davey
Hello, Thursday, January 15, 2004, 7:09:25 PM, you wrote: r I have a very crude script set up that I am using to keep track of IP r addresses, MAC addresses, etc and it dumps into mysql. I am using a r column called id which is my primary key and auto-increments. My r question is that I want

[PHP-DB] Re: [PHP] Re: [PEAR] Re: PEAR DB 1.6.0 has been released

2004-02-23 Thread Richard Davey
different syntax. What I'm trying to say is that abstracting the connection to the database is the easy part, writing an application that will support them all is another matter. -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP Database Mailing List (http

[PHP-DB] Re[2]: [PHP] Re: [PEAR] Re: PEAR DB 1.6.0 has been released

2004-02-23 Thread Richard Davey
the environment it lessens the value somewhat. -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] global variables

2004-03-01 Thread Richard Davey
in my TL #variables.php as TL $v_dec[page_no] = $page_no. You don't check $v_dec in your manage.php script though, you check to see if $page_no is set which it never will be, because no-where do you give it a value. -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html

[PHP-DB] Optimising LIMITs

2004-03-01 Thread Richard Davey
that does something like: SELECT * FROM thread WHERE threadid IN (...) (where ... = all of the IDs previously selected). Would the fact that threadid is my primary key make the original LIMIT/sort faster? Any thoughts appreciated. -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296

Re[2]: [PHP-DB] global variables

2004-03-01 Thread Richard Davey
to solve it? I _have_ to store some variables anywhere. Yes agreed - but you cannot store them in a variable because they will be lost each time the page reloads. Why not store them in a cookie? -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP Database Mailing

Re[2]: [PHP-DB] Optimising LIMITs

2004-03-01 Thread Richard Davey
to look into it. Thanks. -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DB] Optimising LIMITs - alter table order by...

2004-03-02 Thread Richard Davey
of the thread (associated messages are held elsewhere) but in making a smaller table I'd just have to join the data back in again, surely? -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http

Re[2]: [PHP-DB] Optimising LIMITs - alter table order by...

2004-03-02 Thread Richard Davey
regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Re: Alterations

2004-03-02 Thread Richard Davey
) - it holds an MD5 key, for some reason MySQL-Front exported the description as a varchar, sorry for the confusion! -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Re: Alterations + all numeric tables

2004-03-03 Thread Richard Davey
? If it does then maybe I would see some more performance increases. -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] only showing partial info of a field in mysql...

2004-03-04 Thread Richard Davey
in it). -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] SELECT

2004-03-04 Thread Richard Davey
SELECT * FROM users WHERE access=2 -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re[2]: [PHP-DB] SELECT

2004-03-04 Thread Richard Davey
Hello peppe, Thursday, March 4, 2004, 12:02:40 PM, you wrote: p The problem is in access values are like string 1,2,3,4,5 Sorry, I didn't realise that. In this case FIND_IN_SET (which I think Ignatius suggested too). -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html

[PHP-DB] How do you make an IN span multiple tables?

2004-03-04 Thread Richard Davey
of the tables will contain all of the thread_ref's in question. Does anyone have any ideas or is it just not possible using this method? I'm not using MySQL 4 otherwise I would have looked at using a UNION. -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP Database

Re: [PHP-DB] working with ' in SQL

2004-03-04 Thread Richard Davey
(in this instance $_POST) if you want: ? function addslash ($item1, $key) { $item1 = addslashes($item1); } array_walk($_POST, 'addslash'); ? -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit

[PHP-DB] How to calculate size of INT(x) field

2004-03-05 Thread Richard Davey
. what is the difference in possible maximum values held between an INT(10) and an INT(4)? I know MySQL will create an INT(10) as standard but I'm not sure I need it to be able to hold a number that high. -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP Database

Re: [PHP-DB] Forum Script

2004-03-07 Thread Richard Davey
can see the relationship between them and see what fields you have, etc. -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php