Re: [PHP-DB] Multiple instances of mysql_connect() in single PHP document.

2009-11-12 Thread Richard Quadling
2009/11/11 Chris dmag...@gmail.com: Andy Shellam (Mailing Lists) wrote: Hi, If the databases are in the same mysql server, then you could qualify the table select with the database name and simply re-use the connection select db_name.table_name.field from db_name.table_name [where] No

Re: [PHP-DB] Multiple instances of mysql_connect() in single PHP document.

2009-11-12 Thread Richard Quadling
2009/11/11 Chris dmag...@gmail.com: Plus the assumption that they are on the same server and that the user you're connecting with has access to both databases.. See the initial post. $db_material = mysql_connect(localhost, root, secret); $db_labor = mysql_connect(localhost, root, secret); 2

Re: [PHP-DB] Multiple instances of mysql_connect() in single PHP document.

2009-11-12 Thread Chris
Richard Quadling wrote: 2009/11/11 Chris dmag...@gmail.com: Plus the assumption that they are on the same server and that the user you're connecting with has access to both databases.. See the initial post. $db_material = mysql_connect(localhost, root, secret); $db_labor =

Re: [PHP-DB] Multiple instances of mysql_connect() in single PHP document.

2009-11-11 Thread Richard Quadling
2009/11/11 Bastien Koert phps...@gmail.com: On Tue, Nov 10, 2009 at 4:14 PM, Timothy Legg php_l...@timothylegg.com wrote: Hello, Is it wrong to have mysql_connect() called twice within a single PHP document, such as this?  I have been running into some fairly annoying query failures that

Re: [PHP-DB] Multiple instances of mysql_connect() in single PHP document.

2009-11-11 Thread Andy Shellam (Mailing Lists)
Hi, If the databases are in the same mysql server, then you could qualify the table select with the database name and simply re-use the connection select db_name.table_name.field from db_name.table_name [where] No offence, but if I saw this in an application's source code, I'd run a mile.

Re: [PHP-DB] Multiple instances of mysql_connect() in single PHP document.

2009-11-11 Thread Chris
Andy Shellam (Mailing Lists) wrote: Hi, If the databases are in the same mysql server, then you could qualify the table select with the database name and simply re-use the connection select db_name.table_name.field from db_name.table_name [where] No offence, but if I saw this in an

Re: [PHP-DB] Multiple instances of mysql_connect() in single PHP document.

2009-11-10 Thread Chris
Timothy Legg wrote: Hello, Is it wrong to have mysql_connect() called twice within a single PHP document, such as this? I have been running into some fairly annoying query failures that commute when I change the order of these two blocks of code. I am currently working around this by

RE: [PHP-DB] Multiple instances of mysql_connect() in single PHP document.

2009-11-10 Thread Nehemias Duarte
Message- From: Chris [mailto:dmag...@gmail.com] Sent: Tuesday, November 10, 2009 4:51 PM To: php_l...@timothylegg.com Cc: php-db@lists.php.net Subject: Re: [PHP-DB] Multiple instances of mysql_connect() in single PHP document. Timothy Legg wrote: Hello, Is it wrong to have mysql_connect

Re: [PHP-DB] Multiple instances of mysql_connect() in single PHP document.

2009-11-10 Thread Chris
Nehemias Duarte wrote: That is great for me to keep in mind for future reference. However, is it ever appropriate to connect to the database twice in a single script. Two ways I can think of doing this would be: CASE 1 //Connect to server (materials) $db_material = mysql_connect(localhost,

Re: [PHP-DB] Multiple instances of mysql_connect() in single PHP document.

2009-11-10 Thread Bastien Koert
On Tue, Nov 10, 2009 at 4:14 PM, Timothy Legg php_l...@timothylegg.com wrote: Hello, Is it wrong to have mysql_connect() called twice within a single PHP document, such as this?  I have been running into some fairly annoying query failures that commute when I change the order of these two