[PHP-DB] re: PHP4
Does anyone know if PHP 4 on the Red Hat distro is only available on RHL8 or better? Thanks Jon L. Miller, MCNE, CNS Director/Sr Systems Consultant MMT Networks Pty Ltd http://www.mmtnetworks.com.au I don't know the key to success, but the key to failure is trying to please everybody. -Bill Cosby -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Header, Directory, and SESSIONs
Hi all, wish u all a good weekend.. Guys I have a question as the following: 1- In my wwwroot I have two folders : folder1 and folder2 (actually I have 14 folders) 2- In the same two folders there are same PHP files do the same job, as db jobs with different databases.. 3- I log in the users by register a session, lab lab lab ... etc 4- the logging files in the two folders are different by registering a different session value. 4- I want if any user jumped to the other directory and logged in with the correct requested password TO HAVE THE FIRST SESSION UNREGISTERED automatically, so he can't be logged in in both at same time.. and keep only the new.. and ofcourse have to re logging if he jumped back to the first one... (the reason that every folder has different DB connection, and the interface of the two section are identical.. so I need to split it .to avoid any problems with many users ) 5- what I m trying to do is , if there is a possibility to control the header.. by if { /folder1 go } else { unregister session whatever} if {/ folder2 .. } else {.} etc 6- IS IT A GOOD WAY TO DO IT , OR NOT? of cource I need a security in the first place.. I HOPE I WAS CLEAR, and thanks for your patient again... :)) (sorry because it might be shouldn't in db list) Regards Nabil -- open source world, open mind for all -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: test
:-)) David Robley [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... login test Login/Password mismatch Connection failed -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] connect to db with php?
Warning - beginner :-) I'm new at Linux, php and mysql, so please go slowly. I have a test database with a couple of tables, etc., that I can connect to and run simple queries against, etc., all from the command line. I do most things as root, probably because I didn't set it up right and haven't fixed it. I'm trying to put together a simple php script to connect to the database and learn about both at the same time. At the moment I have something like this: ?php $conn = mysql_connect(127.0.0.1,root,password,databasename); if (!$conn) die (Could not connect); blah blah ? which gives this result: Warning: Access denied for user: '[EMAIL PROTECTED]' (Using password: YES) in /var/www/html/php/script1.php on line 9 (line 9 is the $conn line, above) I've tried a few variations but I'm not sure where to go from here. Can anyone help out? thanks David -- The arm folds in at the elbow, not out -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] How can I get the number of entries retrieved by a SELECT - FROM Thanks!
Dell 4500, mem 1g, disk 45g, mhz 2g, Mysql-3.23.54a-linux-i686, PHP-4.30, httpd_2.0.44 Thanks to Paul DuBois, Roger Davis, Helen Sallee, Ronan Chilvers, and Edward Dudlik for thier response to my question. I've included the a (one of many?) snippit of code that I've decided to use as a pattern for a (class) to be developed. Thanks again: Ed anderson htmlheadtitlesample.php/title/head body sample.php BR see page 405 msql cookbook for code used to develop $h_nrows BR ?php # $mysql_connect = mysql_connect(localhost, root) or die (mysql_connect $mysql_connect\n); mysql_select_db(mysql, $mysql_connect) or die (mysql_select_db $mysql_connect\n); # $h_id1 = 3; $h_id2 = 4; $h_id3 = 5; $t = td; $tn = /td; $r = tr; $rn = /tr; # $h_query = SELECT * FROM employees WHERE id=$h_id1 OR id=$h_id2 OR id=$h_id3; printf(mysql_query: $h_querybr\n); # $h_result_id = mysql_query($h_query, $mysql_connect); if(! $h_result_id) die ( mysql_query h $mysql_connect\n); $h_nrows = @mysql_num_rows ($h_result_id); # if ($h_nrows == 0) print (Note: h query has no result set\n); $dat_h_id = mysql_result($h_result_id,$i,id); $dat_first = mysql_result($h_result_id,$i,first); $dat_last = mysql_result($h_result_id,$i,last); # # # echo table border=1 cellspacing=0; for ($i = 0; $i $h_nrows; $i++) { echo $r; $dat_h_id = mysql_result($h_result_id,$i,id); echo $t $dat_h_id$tn; $dat_first = mysql_result($h_result_id,$i,first); echo $t $dat_first$tn; $dat_last = mysql_result($h_result_id,$i,last); echo $t $dat_last $tn; echo $t $i$tn; echo $t $h_nrows $tn; echo $rn; } echo /table; # ? BR sample.php end BRBR /body /html using mozilla browser -http://127.0.0.1/sample.php sample.php see page 405 msql cookbook code used to develop $h_nrows mysql_query: SELECT * FROM employees WHERE id=3 OR id=4 OR id=5 3 Brad Johnson 0 3 4 aa bb 1 3 5 WW EE 2 3 sample.php end -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: test
Are we 'testing' something here? Seems to be working, but I guess I really don't know because I have NFI what is being tested here. Nor do I expect anyone to care to explain! ;) To: [EMAIL PROTECTED] From: fazla [EMAIL PROTECTED] Date: Sat, 21 Jun 2003 16:30:09 +0200 Subject: Re: test :-)) David Robley [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... login test Login/Password mismatch Connection failed -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php http://mobile.yahoo.com.au - Yahoo! Mobile - Check compose your email via SMS on your Telstra or Vodafone mobile. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] connect to db with php?
1. The default user table sets up root with no password. Leave out the password and it will probably connect OK. You really need to fix the user table, but as long as the system isn't accessible from outside, you can get by. 2. You don't need to use host, in this case 127.0.0.1, when connecting from the same machine. It doesn't hurt, but it may add confusion at some future point in your troubleshooting. 3. All of this is really mysql specific and you would do better using that list, too. Doug On Sun, 22 Jun 2003 00:45:12 +1000, David wrote: Warning - beginner :-) I'm new at Linux, php and mysql, so please go slowly. I have a test database with a couple of tables, etc., that I can connect to and run simple queries against, etc., all from the command line. I do most things as root, probably because I didn't set it up right and haven't fixed it. I'm trying to put together a simple php script to connect to the database and learn about both at the same time. At the moment I have something like this: ?php $conn = mysql_connect(127.0.0.1,root,password,databasename); if (!$conn) die (Could not connect); blah blah ? which gives this result: Warning: Access denied for user: '[EMAIL PROTECTED]' (Using password: YES) in /var/www/html/php/script1.php on line 9 (line 9 is the $conn line, above) I've tried a few variations but I'm not sure where to go from here. Can anyone help out? thanks David -- The arm folds in at the elbow, not out -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php