Re: [PHP-DB] PHP-MySQL connection for particular module

2008-06-20 Thread Evert Lammerts
I should've checked the assumption. A little strange though for a scripting language. I'd say, since default behaviour of mysql_* functions is to assume the last opened link when a parameter is not passed, and since default behaviour is to evaluate null, false and 0 the same, mysql_* functions sho

Re: [PHP-DB] PHP-MySQL connection for particular module

2008-06-19 Thread Chris
> [new code] > if (!mysql_connect($a, $b, $c)) return; > > if (!mysql_select_db($dbname)) return; > > $res = mysql_query("SELECT * FROM manual;", $link); > [/new code] Isn't going to work because $link is not defined and definitely not a resource like mysql_query expects. > OR, optionally, to

Re: [PHP-DB] PHP-MySQL connection for particular module

2008-06-19 Thread bateivan
Eric, You gessed right. Both of the files are in my "docroot" directory. I tried this. Unfortunely, it did not work ( perhaps, I did not use it right), although, I followed your instructions. Isaak gave me an idea which solved my problem (see his replies). Thank you Eric-275 wrote: > > > --

Re: [PHP-DB] PHP-MySQL connection for particular module

2008-06-19 Thread Isaak Malik
It's great that you got your problem solved :). On Thu, Jun 19, 2008 at 12:30 PM, bateivan <[EMAIL PROTECTED]> wrote: > > Hello Isaak, > > You've scored the bulleye! It works! > Also, I tested by including "common.php" instead of "database.php" and it > worked too. > This solution is perfect for

Re: [PHP-DB] PHP-MySQL connection for particular module

2008-06-19 Thread bateivan
Hello Isaak, You've scored the bulleye! It works! Also, I tested by including "common.php" instead of "database.php" and it worked too. This solution is perfect for me as I can keep my code compact and tidy. I would, definetely, recommend this site to my fellow developers. Thank you very much,

Re: [PHP-DB] PHP-MySQL connection for particular module

2008-06-19 Thread Evert Lammerts
What you said wasn't wrong - you'd just produce a couple of warnings. By taking away the assignment of the $link variable you're unsetting it, meaning it will have a value equal to NULL. All of the following should work. [old code] if (!($link = mysql_connect($a, $b, $c))) return; if (!mysql_sele

Re: [PHP-DB] PHP-MySQL connection for particular module

2008-06-19 Thread Isaak Malik
My mistake then, it's been a while that I used it that way so some things do fade away from my mind. On Thu, Jun 19, 2008 at 1:57 AM, Chris <[EMAIL PROTECTED]> wrote: > Isaak Malik wrote: > > Because then the connection resource isn't stored in the $link variable > > and you will be able to use t

Re: [PHP-DB] PHP-MySQL connection for particular module

2008-06-18 Thread Chris
Isaak Malik wrote: > Because then the connection resource isn't stored in the $link variable > and you will be able to use the mysql functions without passing that > variable to each function. RTM again. The link parameter is completely optional. If you don't specify it, it uses the last connect

Re: [PHP-DB] PHP-MySQL connection for particular module

2008-06-18 Thread Isaak Malik
To Evert: 4. I am posting some of my code to compare. Module "carmade.php" works v.s. "login.php" which does not. Also, I am posting my "database.php" which is establishing the connection and is included in every page through "layout.php"->"common.php"->"database.php". To bateivan: I can only gu

Re: [PHP-DB] PHP-MySQL connection for particular module

2008-06-18 Thread Evert Lammerts
Pastebin works lots better when you're posting code: www.pastebin.com I don't see your database.php included in both of these modules. Where do you include it? EVert On Wed, Jun 18, 2008 at 9:38 PM, bateivan <[EMAIL PROTECTED]> wrote: > > Hello, > > To answer these qwestions: > 1. I am using "in

Re: [PHP-DB] PHP-MySQL connection for particular module

2008-06-18 Thread bateivan
Hello, To answer these qwestions: 1. I am using "include" in my code. 2. About the "$link = mysql_connect('localhost', 'root', 'testing');" variable. I can just include this line before mysql_query function and it works even without entering into mysql_query the "$link" variable. (Like the connec

Re: [PHP-DB] PHP-MySQL connection for particular module

2008-06-18 Thread bateivan
Thank you, Chris, I tried your suggestion using regular connection. Unfortunately, I got the same result. See my reply to Isaak,s reply where I am going to post portion of my code to visualize what I am talking about. Thanx again chris smith-9 wrote: > > >> It means that either your mysql co

Re: [PHP-DB] PHP-MySQL connection for particular module

2008-06-18 Thread Isaak Malik
Because then the connection resource isn't stored in the $link variable and you will be able to use the mysql functions without passing that variable to each function. On Wed, Jun 18, 2008 at 1:51 AM, Chris <[EMAIL PROTECTED]> wrote: > > > It means that either your mysql conenction details are no

Re: [PHP-DB] PHP-MySQL connection for particular module

2008-06-17 Thread Roberto Carlos García Luís
excuseme but, you can access by terminal? [shell] ODBC is the user? or is a ODBC database? Please answer me and i can help you. **Excuse me my english is bad. :( El 17/06/2008, a las 06:51 p.m., Chris escribió: It means that either your mysql conenction details are not correctly set or th

Re: [PHP-DB] PHP-MySQL connection for particular module

2008-06-17 Thread Chris
> It means that either your mysql conenction details are not correctly set or > the connection resource isn't accessible for your mysql functions. I suggest > you first try by replacing: > > $link = mysql_pconnect('localhost', 'root', 'testing'); > > into: > > mysql_pconnect('localhost', 'root'

Re: [PHP-DB] PHP-MySQL connection for particular module

2008-06-17 Thread Eric
http://myprojects.srhost.info eric{at}myprojects{dot}srhost{dot}info - Original Message - From: "bateivan" <[EMAIL PROTECTED]> To: Sent: Tuesday, June 17, 2008 11:19 PM Subject: [PHP-DB] PHP-MySQL connection for particular module :

Re: [PHP-DB] PHP-MySQL connection for particular module

2008-06-17 Thread Isaak Malik
If you get an error of this kind: "Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in D:\Program Files\Apache Software Foundation\Apache2.2\htdocs\login.php on line 17 Warning: mysql_query() [function.mysql-query]: A link to the server