[PHP-DB] Join Multiply

2009-11-13 Thread iwan sutadi (via Multiply)
Check out my Multiply site I set up a Multiply site with my pictures, videos and blog and I want to add you as my friend so you can see it. First, you need to join Multiply! Once you join, you can also create your own site and share anything you want, with anyone you want. Here's the link: ht

Re: [PHP-DB] Join on single table

2005-02-12 Thread Matthew Weier O'Phinney
* Micah Stevens <[EMAIL PROTECTED]>: > What kind of speed do you need? I was aiming at something that would run in 2 hours or so. Currently, it takes around 3 - 4. > I had to go to temp tables for a logging application, but not until my > table got upwards of a million records or so.. For the n

Re: [PHP-DB] Join on single table

2005-02-11 Thread Micah Stevens
What kind of speed do you need? I had to go to temp tables for a logging application, but not until my table got upwards of a million records or so.. For the numbers your quoting, it should be pretty quick unless your engine needs optimization.. On Friday 11 February 2005 11:56 am, Matthew

Re: [PHP-DB] Join on single table

2005-02-11 Thread Matthew Weier O'Phinney
* Micah Stevens <[EMAIL PROTECTED]>: > Sounds like a self join should work wonders. > > I didn't test this, but the idea should work: > > > select t1.app_id as a1, t2.app_id as a2, t2.word, t2.score > from tablename as t1 > left join tablename as t2 > on t1.resource_id = t2.resource_id and t1.ap

Re: [PHP-DB] Join on single table

2005-02-11 Thread Micah Stevens
Sounds like a self join should work wonders. I didn't test this, but the idea should work: select t1.app_id as a1, t2.app_id as a2, t2.word, t2.score from tablename as t1 left join tablename as t2 on t1.resource_id = t2.resource_id and t1.app_id != t2.app_id group by word order by word voila

Re: [PHP-DB] Join on single table

2005-02-11 Thread Matthew Weier O'Phinney
* Martin Norland <[EMAIL PROTECTED]>: > Matthew Weier O'Phinney wrote: > > I have a table which contains the following: > > id (primary key, auto incrementing) > > app_id (integer, foreign key) > > resource_id (integer, foreign key) > > word > > score > > > > (This is a search

Re: [PHP-DB] Join on single table

2005-02-11 Thread Martin Norland
Matthew Weier O'Phinney wrote: I have a table which contains the following: id (primary key, auto incrementing) app_id (integer, foreign key) resource_id (integer, foreign key) word score (This is a search index.) I want to find all resource_ids from one app_id that match resour

[PHP-DB] Join on single table

2005-02-10 Thread Matthew Weier O'Phinney
I have a table which contains the following: id (primary key, auto incrementing) app_id (integer, foreign key) resource_id (integer, foreign key) word score (This is a search index.) I want to find all resource_ids from one app_id that match resource_ids in another app_id by wo

Re: [PHP-DB] JOIN problem

2005-02-08 Thread Jochem Maas
Zouari Fourat wrote: am using mysql 3 so i can't do that subquery, how can we do that in mysql 3 ? and neither can anyone else ;-)... rather a pain, but mysql.com have been kind enough to give a detailed explaination on how to rewrite subselect queries as join queries: If you put your brain in ge

Re: [PHP-DB] JOIN problem

2005-02-08 Thread Zouari Fourat
am using mysql 3 so i can't do that subquery, how can we do that in mysql 3 ? On Mon, 7 Feb 2005 19:47:08 +, Simon Rees <[EMAIL PROTECTED]> wrote: > On Monday 07 February 2005 18:22, Zouari Fourat wrote: > > Hello > > I have 2 tables with two columns in each one (cloned tables) like this : >

Re: [PHP-DB] JOIN problem

2005-02-07 Thread Simon Rees
On Monday 07 February 2005 18:22, Zouari Fourat wrote: > Hello > I have 2 tables with two columns in each one (cloned tables) like this : > > ID int(6) > UserName varchar(25) > > and i would like to select usernames from table1 that doesnt appear in > table2 so i did this : Depending on which data

Re: [PHP-DB] JOIN problem

2005-02-07 Thread Zouari Fourat
:( nothing On Mon, 7 Feb 2005 14:10:10 -0500, Joseph Crawford <[EMAIL PROTECTED]> wrote: > try INNER JOIN? > > > On Mon, 7 Feb 2005 19:47:29 +0100, Zouari Fourat <[EMAIL PROTECTED]> wrote: > > that wont work :( > > and either when changing RIGHT to LEFT JOIN that wont work > > > > > > On Mon, 7

Re: [PHP-DB] JOIN problem

2005-02-07 Thread Zouari Fourat
that wont work :( and either when changing RIGHT to LEFT JOIN that wont work On Mon, 7 Feb 2005 13:41:01 -0500, Joseph Crawford <[EMAIL PROTECTED]> wrote: > try doing this > > SELECT a.UserName FROM table1 a RIGHT OUTER JOIN table2 b ON > (a.UserName != b.username) > > On Mon, 7 Feb 2005 19:22:

[PHP-DB] JOIN problem

2005-02-07 Thread Zouari Fourat
Hello I have 2 tables with two columns in each one (cloned tables) like this : ID int(6) UserName varchar(25) and i would like to select usernames from table1 that doesnt appear in table2 so i did this : SELECT a.UserName FROM table1 a RIGHT OUTER JOIN table2 b ON (a.UserName = b.username) and

[PHP-DB] JOIN question

2004-07-27 Thread Chris Payne
Hi there everyone, I'm transferring a client's product from a Visual Basic .NET ACCESS 2000 application to run on a custom install of Apache/MySQL/PHP which I created (With a custom installer which sets everything up for them). My question though, is on looking through their ACCESS database

Re: [PHP-DB] JOIN across db's in MySQL

2003-09-18 Thread Micah Stevens
l=php-db > > > > but in short, mysql does support this using . db.table.field > > > > hth > > Jeff > > > > > > > > "Mike Tallroth" > > <[EMAIL PROTECTED]To: > > [EMAIL PRO

Re: [PHP-DB] JOIN across db's in MySQL

2003-09-18 Thread Mike Tallroth
lroth" > <[EMAIL PROTECTED]To: [EMAIL PROTECTED] > exus.com>cc: >Subject: [PHP-DB] JOIN across db's in MySQL > 09/18/2003 10:47 >

Re: [PHP-DB] JOIN across db's in MySQL

2003-09-18 Thread jeffrey_n_Dyke
Subject: [PHP-DB] JOIN across db's in MySQL 09/18/2003 10:47

[PHP-DB] JOIN across db's in MySQL

2003-09-18 Thread Mike Tallroth
In the big scheme of things, I need several functions to be performed by a web interface / database system. In an attempt to maintain some sense of order, I'm hoping to divide common data into a seperate MySQL database away from the function specific data. For example, I need to do project alloca

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

2003-08-22 Thread Moshe Weitzman
I assume something like the following would work, regardless of whether/how you've called mysql_select_db() SELECT t1.column FROM database1.table1 t1 JOIN database2.table2 t2 ON t1.id = t2.id If you have something working from the MySQL command line, then it's going to work from mysql_query() with

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 * f

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 jeffrey_n_Dyke
[EMAIL PROTECTED] ourmet.org> cc: Subject: [PHP-DB] join across data

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

2003-08-22 Thread Moshe Weitzman
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 question is about how many calls to mysql_select

[PHP-DB] Join Cursors

2003-03-24 Thread Chris Berlioz
Does anyone know how to join cursors after having successfull query ie: I have multiple queries that get data from different sources and now I need to join the results, how can I achieve this in PHP (Do I need to write into a temporary table and then requery? is that the only way? I am using MyS

Re: [PHP-DB] join query/relational database question

2003-01-06 Thread Rick Widmer
At 04:09 PM 1/6/03 -0500, Doug Parker wrote: I have a relational database issue that I'll simplify for the sake of this post. I have one table, called clients, that has an id and the company name. For example: id | company --- 46 Jones Inc. 54 Baker Inc. etc.

Re: [PHP-DB] join query/relational database question

2003-01-06 Thread Paolo Bonavoglia
At 16:09 06/01/2003 06/01/2003, Doug Parker wrote: I have a relational database issue that I'll simplify for the sake of this post. [...] So it would be like this: id | company_id | status| company 1 46

[PHP-DB] join query/relational database question

2003-01-06 Thread Doug Parker
I have a relational database issue that I'll simplify for the sake of this post. I have one table, called clients, that has an id and the company name. For example: id | company --- 46 Jones Inc. 54 Baker Inc. etc. I have another table called projects, that looks

Re: [PHP-DB] JOIN in embedded query

2002-08-08 Thread leo g. divinagracia iii
since you didnt list what type DB you are using, i assumed MYSQL. and MYSQL doesnt have sub SELECTs... :( http://www.mysql.com/doc/en/UPDATE.html the syntax lists "...WHERE where_condition..." Michael Hendsbee wrote: > UPDATE Emails SET Sent = 'T' WHERE ID = (SELECT Emails.ID FROM Emails

[PHP-DB] Join on insert???

2002-07-03 Thread Jefferson Cowart
I am writing scripts to load user data into a MySQL database. I have tables in the DB called People and PeopleEmail. The PeopleEmail table stores one email address per record with one of the columns corresponding to the PID of the people table. Is there a way to run a single query that will insert

Re: [PHP-DB] JOIN statement not producing expected output

2002-05-20 Thread szii
me basic info on SELECTs. http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#SELECT 'Luck -Szii - Original Message - From: "admin" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, May 20, 2002 5:48 PM Subject: [PHP-DB] JOIN statement not pro

Re: [PHP-DB] JOIN statement not producing expected output

2002-05-20 Thread Bogdan Stancescu
Well, the first question is "what's the expected output"? If you're trying to get, say, title from table1 and rating from table2 and identify the books in table1 by the unique field "id" and in table2 by the field "book_id", then this is what you should have to end up with: SELECT t1.title, t2

[PHP-DB] JOIN statement not producing expected output

2002-05-20 Thread admin
Okay, now this is my first try on fetching data from two tables, and frankly I'm starting to pull my hair out ;) All I want is to fetch some data from two seperate tables in my database. So far I have tried different approches, and below is what I think should work, but doesn't :( SELECT * FROM

[PHP-DB] JOIN statement not producing expected output

2002-05-20 Thread admin
Okay, now this is my first try on fetching data from two tables, and frankly I'm starting to pull my hair out ;) All I want is to fetch some data from two seperate tables in my database. So far I have tried different approches, and below is what I think should work, but doesn't :( SELECT * FROM

[PHP-DB] Join?

2002-04-09 Thread Volker Hartmann
Hi, I've got a problem with database abstraction. There are two tables. One with articles (id,content,author,time) and one with comments on those articles (id,article_id,content,author,time). My script looks like this: function show_news($limit){ /* get db parameters and connect to db */ requir

Re: [PHP-DB] Join tables

2002-02-28 Thread Aron Pilhofer
Microsoft Access: light-duty relational database with a world-class (in my opinion) GUI interface, but I don't think it's going to help you in this case. > > > id in image_data has the same value as id in wt_users do you mean uid in wt_users? So, $id=session ID? I might set that ahead of time ju

Re: [PHP-DB] Join tables

2002-02-28 Thread Jennifer Downey
Ok thanks for that info, but I guess I am ignorant to what MS Access is. Please enlighten me. Thanks Jennifer Downey "Marius Ursache" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED].; > the best tool for building "join" queries is MS Access . > > make a db same as that you use in m

Re: [PHP-DB] Join tables

2002-02-28 Thread Marius Ursache
the best tool for building "join" queries is MS Access . make a db same as that you use in mysql and build the query with access. then copy/paste queries from there. to build queries in access is very simple . drag/drop and other visual ways. Jennifer Downey a écrit : > Hi all, > > Ok first

[PHP-DB] Join tables

2002-02-28 Thread Jennifer Downey
Hi all, Ok first I have figured out my question on storing an image path. my question now is on joining data from two tables. wt_users has two fields (cols) called uid and pid, uid refers to the user pid refers to the users pet image_data has a field called id which refers to the image path

Re: [PHP-DB] Join

2002-02-21 Thread Jennifer Downey
h help :) > > JOIN is an SQL command, so check out the manual of your RDBMS (ie. > http://www.mysql.com/doc/J/O/JOIN.html for MySQL) > > good luck :) > > Beau > > // -Original Message- > // From: Jennifer Downey [mailto:[EMAIL PROTECTED]] > // Sent: Thursday, 2

RE: [PHP-DB] Join

2002-02-20 Thread Beau Lebens
: Jennifer Downey [mailto:[EMAIL PROTECTED]] // Sent: Thursday, 21 February 2002 10:47 AM // To: [EMAIL PROTECTED] // Subject: [PHP-DB] Join // // // Could someone point me in the right direction for joining // tables? I have // searched the php manual for it but only found info on joining arrays.

[PHP-DB] Join

2002-02-20 Thread Jennifer Downey
Could someone point me in the right direction for joining tables? I have searched the php manual for it but only found info on joining arrays. If someone could point me to a code snip or a tutorial I would much appreciate it. Thanks in advance Jen Downey -- PHP Database Mailing List (http:/

Re: [PHP-DB] JOIN - Not working.

2001-11-28 Thread Daniel Barton
orld example may have explained it better. > All the repeated 'whatever' kind of makes it a bit unexplained. > > Martin. > > -----Original Message- > From: Daniel Barton [mailto:[EMAIL PROTECTED]] > Sent: 28 November 2001 4:14 PM > To: Martin E. Koss > Subject: Re: [PHP-DB] J

[Fwd: [PHP-DB] JOIN - Not working.]

2001-11-28 Thread Daniel Barton
-- -- Dan Barton Terrestrial Program Biologist Asst. Data Manager Point Reyes Bird Observatory http://www.prbo.org [EMAIL PROTECTED] [EMAIL PROTECTED] --- Begin Message --- Try: select sum(if(whatever=whatever,1,0)) as whatever from wherever where whatever=whatever; This is a pretty

Re: [PHP-DB] JOIN Very SLOW...

2001-11-28 Thread Andrey Hristov
of mysql. Regards, Andrey Hristov - Original Message - From: "Martin E. Koss" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, November 28, 2001 12:09 PM Subject: [PHP-DB] JOIN Very SLOW... > The following does work but it extremely slow. > > $phse

Re: [PHP-DB] JOIN Very SLOW...

2001-11-28 Thread Jon Farmer
t; <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, November 28, 2001 10:09 AM Subject: [PHP-DB] JOIN Very SLOW... The following does work but it extremely slow. $phselect = "select COUNT(*) AS phTotal from properties LEFT JOIN propertydetails ON properties.PropertyID=prope

[PHP-DB] JOIN Very SLOW...

2001-11-28 Thread Martin E. Koss
The following does work but it extremely slow. $phselect = "select COUNT(*) AS phTotal from properties LEFT JOIN propertydetails ON properties.PropertyID=propertydetails.PropertyID where ((propertydetails.Image1Desc='') AND (properties.PropertyType='$PropertyType'))"; $phresult = mysql_q

[PHP-DB] JOIN - Not working.

2001-11-28 Thread Martin E. Koss
I have read the parts of the manual(s) but am just not grasping something... I have 2 tables, one holds the Property ID etc., and the other holds all the Property Details. They are connected by a field called 'PropertyID' which is a unique ID that appears in both records. I want to count the num

RE: [PHP-DB] JOIN operations

2001-11-12 Thread Rick Emery
> There isn't the field table_name.ID_city!!! because you didn't ask for it. You asked for: table_name.name table_city.ID table_city.city -Original Message- From: Carlo Loiudice [mailto:[EMAIL PROTECTED]] Sent: Friday, November 09, 2001 4:02 PM To: PHP DB Subject:

RE: [PHP-DB] JOIN operations

2001-11-09 Thread Gonzalez, Lorenzo
select n.name, c.city, c.ID from table_name n, table_city c where c.ID = n.ID_city No sweat. -Lorenzo -Original Message- From: Carlo Loiudice Sent: Fri 11/9/2001 5:01 PM To: PHP DB Cc: Subject: [PHP-DB] JOIN

[PHP-DB] JOIN operations

2001-11-09 Thread Carlo Loiudice
Hi, I'm preforming a join between 2 Mysql tables in this way: table_name: ID,name,ID_city table_city: ID,city when I query this: "SELECT table_name.name,table_city.ID,table_city.city FROM table_name,table_city WHERE table_name.ID_city=table_city.ID" The result is a new table with this fields: r

[PHP-DB] join 2 db

2001-09-19 Thread Sommai Fongnamthip
Hello, I have been use PHP connect to mssql 6.5 with FreeTDS. I'd like to select data from 2 table with separate in 2 database name. How could I do this? here is some example. DB#1 DB#2 |--> Table#1-in-DB#1 |--

[PHP-DB] join 2 db

2001-09-11 Thread Sommai Fongnamthip
Hi, I'd like to retrieve data which contain in 2 db. How could I do? db1->table-in-db1->field-in-table-in-db1 db2->table-in-db2->field-in-table-in-db2 I'd not extract data to new table because I'd like to retrieve data only. thanks SF -- PHP Database Mailing L

Re: [PHP-DB] Join statement and output

2001-03-04 Thread Cody Caughlan
Use column-aliasing. To rename a column use the SQL "AS" syntax. Ie. SELECT first_name AS fname .. now "fname" is column name in the result set...Do this for each of your first_name's, obviously using different names and you are set. /cody caughlan Norman Tan wrote: > No actual code, but

[PHP-DB] Join statement and output

2001-03-03 Thread Norman Tan
No actual code, but hopefully, someone can help me through the theory here. I have 2 tables: members - first_name, last_name schedule - member1, member2, date The SQL statement is this: select s.first_name, t.first_name, f.date from members s, members t, schedule f where s.first_name=f.member1

RE: [PHP-DB] Join causing Error?

2001-02-25 Thread Scott Bernard
PROTECTED] Asunto: [PHP-DB] Join causing Error? Can anyone tell me why this: Line 282mysql_select_db("centraldb",$db); Line 283$qorder++; Line 284$result = mysql_query("SELECT q.questid, q.question, q.answer, q.qorder, q.depart, q.catid, q.active, q.

Re: [PHP-DB] Join causing Error?

2001-02-25 Thread Bob Hall
Sir, I don't see anything wrong with the syntax in your query. If I haven't over looked something, and if you haven't misspelled anything, then you have a data problem. Since your first query returns a Cartesian product, you should get something if the WHERE clause returns >= 1 row for each ta

[PHP-DB] Join causing Error?

2001-02-25 Thread Keith Spiller
Can anyone tell me why this: Line 282mysql_select_db("centraldb",$db); Line 283$qorder++; Line 284$result = mysql_query("SELECT q.questid, q.question, q.answer, q.qorder, q.depart, q.catid, q.active, q.global, q.adate, q.author, q.authoremail, q.askemail, c.

[PHP-DB] JOIN Help

2001-02-10 Thread nick
Hi All, I have a JOIN statement: SELECT d.*, b.invoice_id FROM domain_info d LEFT JOIN billing_info b ON d.domain_id=b.domain_id WHERE billing_cycle = '12' OR billing_cycle = 'Z' OR billing_cycle = 'C' GROUP BY domain_name In addition to the fields this statement returns, I would also like

RE: [PHP-DB] Join Sentences

2001-02-09 Thread Fabio Ottolini (EDB)
L PROTECTED]] > Sent: Friday, February 09, 2001 11:17 AM > To: Gaby > Cc: PHP-DB > Subject: Re: [PHP-DB] Join Sentences > > > Hi Gaby, > > Your best bet is to probably place the statements you want > into a function. > Then, when the function is called if any one sta

RES: [PHP-DB] Join Sentences

2001-02-09 Thread portasio
:[EMAIL PROTECTED]] # Enviada em: Friday, February 09, 2001 10:34 AM # Para: Jorge Santos # Cc: [EMAIL PROTECTED] # Assunto: RE: [PHP-DB] Join Sentences # # # No, I know how manage the functions I said for exemple : # # If I need insert or delete data in two tables, and one of them returns

RE: [PHP-DB] Join Sentences

2001-02-09 Thread Gaby
Gaby http://www.atrivia.com - Original Message - From: Jorge Santos <[EMAIL PROTECTED]> To: Gaby <[EMAIL PROTECTED]> Cc: PHP-DB <[EMAIL PROTECTED]> Sent: Friday, February 09, 2001 2:17 PM Subject: Re: [PHP-DB] Join Sentences > Hi Gaby, > > Your best bet is to p

Re: [PHP-DB] Join Sentences

2001-02-09 Thread Jorge Santos
lt;[EMAIL PROTECTED]> Sent: Friday, February 09, 2001 7:59 AM Subject: [PHP-DB] Join Sentences Hi, ( Excuse me for my english ) I wish execute in PHP some consecutives sentences , but if one of them returns un error, the program must'n execute anyone. I need one set of sentences that execu

[PHP-DB] Join Sentences

2001-02-09 Thread Gaby
Hi, ( Excuse me for my english ) I wish execute in PHP some consecutives sentences , but if one of them returns un error, the program must'n execute anyone. I need one set of sentences that executes the code like one. I don't know if I explain ... Thanks a lot. --- Por si acaso alguien me ent