Re: [PHP-DB] Database visible via mysql CLI but not MOD_PHP withsame username

2005-02-16 Thread Elliot Mackenzie
OK I will look further and try these ideas today.

Cheers,
M.

Bastien Koert wrote:

 sounds like a mysql account user permissions problem to me, too
 
 bastien
 
From: Martin Norland [EMAIL PROTECTED]
Reply-To: php-db@lists.php.net
To: php-db@lists.php.net
Subject: Re: [PHP-DB] Database visible via mysql CLI but not MOD_PHP
withsame username
Date: Tue, 15 Feb 2005 15:59:09 -0600

Elliot Mackenzie wrote:
I have encountered a hidden database issue with mod_php, apache2 and
mySQL that I have thus far been unable to resolve.

I am able to connect to the mysql socket using mysql_connect, but then
find that mysql_list_dbs only returns the test database.  This
*sounded* like an issue with the SHOW DATABASES privilege until I found
I was able to log in to the same MySQL server *as the same user* with
the provided command-line client (mysql) and SHOW DATABASES would
display all the other databases on this system.

Furthermore, I tried connecting as root, and again found only the test
database was visible to PHP.  If I dropped the test database, no
databases were visible to PHP (regardless of how many databases were
visible using SHOW DATABASES).  If I created test, tester,
testing, hello etc, then the test database would reappear to PHP,
but no other databases were visible.

I also tried to connect PHP to MySQL as a super-user, and encountered
the exact same issue.

Steps to confirm question:
1) Connect using php, drop 'test' database.

2) Confirm php no longer sees 'test' database.

3) Connect using mysql client, confirm test database is missing.

4) -\
4a) if so, check mysql database to confirm permissions for root include
'%' databases and not just 'test'.

4b) if not, change php code to connect to correct mysql server.

Apologies that this may not be very useful, but your problem is extremely
odd - if it's *not* a permissions / database error.

Cheers,

--
- Martin Norland, Sys Admin / Database / Web Developer, International
Outreach x3257
The opinion(s) contained within this email do not necessarily represent
those of St. Jude Children's Research Hospital.

--
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] checkbox into mysql using php input type=checkbox name=list[] value=x

2005-02-16 Thread moses Woldeselassie
hi all
I need a simple php script to use for html

form action=checkbox.php method=post
  Select from the list br / (check all that apply):br /
  input type=checkbox name=list[] value=x
 input type=checkbox name=list[] value=y
input type=submit name=submit value=Go! /
/form
kind regards
meberat
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Database visible via mysql CLI but not MOD_PHP with

2005-02-16 Thread Elliot Mackenzie
Agh!  GLOBALS GLOBALS GLOBALS.  For a future suckers' reference, 
the variable was not available in its scope, and was thus passing null as 
the username to mysql_connect, which in turn was connecting to the 
database as @localhost.

Thanks for your help, pardon my stupidity :)
Kind regards,
Elliot.
On Wed, 16 Feb 2005, Elliot Mackenzie wrote:
I have an update for this.
I used mysql_connect to connect to the database and then ran the query 
select current_user().  I discovered that despite using mysql_connect 
specifying a username and password, it still insisted on connecting as 
@localhost, but with no user.

The @localhost user does not have the permissions it needs to show databases 
other than test, and this explains 100% why I am seeing the results I am 
seeing.  I can login to the command-line client and see exactly what PHP is 
seeing now (which is a relief).

The question is now: why would I be connecting as @localhost instead of 
[EMAIL PROTECTED] when I specify both a username and password along with 
mysql_connect?

There are no mysql-related defaults set in php.ini other than a path to the 
socket.

Kind regards,
Elliot.
Martin Norland wrote:
Elliot Mackenzie wrote:
I have encountered a hidden database issue with mod_php, apache2 and
mySQL that I have thus far been unable to resolve.
I am able to connect to the mysql socket using mysql_connect, but then
find that mysql_list_dbs only returns the test database.  This
*sounded* like an issue with the SHOW DATABASES privilege until I found
I was able to log in to the same MySQL server *as the same user* with
the provided command-line client (mysql) and SHOW DATABASES would
display all the other databases on this system.
Furthermore, I tried connecting as root, and again found only the 
test
database was visible to PHP.  If I dropped the test database, no
databases were visible to PHP (regardless of how many databases were
visible using SHOW DATABASES).  If I created test, tester,
testing, hello etc, then the test database would reappear to PHP,
but no other databases were visible.
I also tried to connect PHP to MySQL as a super-user, and encountered
the exact same issue.

Steps to confirm question:
1) Connect using php, drop 'test' database.
2) Confirm php no longer sees 'test' database.
3) Connect using mysql client, confirm test database is missing.
4) -\
   4a) if so, check mysql database to confirm permissions for root
include '%' databases and not just 'test'.
4b) if not, change php code to connect to correct mysql server.
Apologies that this may not be very useful, but your problem is
extremely odd - if it's *not* a permissions / database error.
Cheers,


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP-DB] checkbox into mysql using php input type=checkbox name=list[] value=x

2005-02-16 Thread Bastien Koert
to do what?
bastien
From: moses Woldeselassie [EMAIL PROTECTED]
To: php-db@lists.php.net
Subject: [PHP-DB] checkbox into mysql using php  input type=checkbox 
name=list[] value=x
Date: Wed, 16 Feb 2005 11:28:17 +

hi all
I need a simple php script to use for html

form action=checkbox.php method=post
  Select from the list br / (check all that apply):br /
  input type=checkbox name=list[] value=x
 input type=checkbox name=list[] value=y
input type=submit name=submit value=Go! /
/form
kind regards
meberat
--
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


Re: [PHP-DB] Database visible via mysql CLI but not MOD_PHP with

2005-02-16 Thread Elliot Mackenzie
I have an update for this.
I used mysql_connect to connect to the database and then ran the query 
select current_user().  I discovered that despite using mysql_connect 
specifying a username and password, it still insisted on connecting as 
@localhost, but with no user.

The @localhost user does not have the permissions it needs to show 
databases other than test, and this explains 100% why I am seeing the 
results I am seeing.  I can login to the command-line client and see 
exactly what PHP is seeing now (which is a relief).

The question is now: why would I be connecting as @localhost instead of 
[EMAIL PROTECTED] when I specify both a username and password along with 
mysql_connect?

There are no mysql-related defaults set in php.ini other than a path to 
the socket.

Kind regards,
Elliot.
Martin Norland wrote:
Elliot Mackenzie wrote:
I have encountered a hidden database issue with mod_php, apache2 and
mySQL that I have thus far been unable to resolve.
I am able to connect to the mysql socket using mysql_connect, but then
find that mysql_list_dbs only returns the test database.  This
*sounded* like an issue with the SHOW DATABASES privilege until I found
I was able to log in to the same MySQL server *as the same user* with
the provided command-line client (mysql) and SHOW DATABASES would
display all the other databases on this system.
Furthermore, I tried connecting as root, and again found only the 
test
database was visible to PHP.  If I dropped the test database, no
databases were visible to PHP (regardless of how many databases were
visible using SHOW DATABASES).  If I created test, tester,
testing, hello etc, then the test database would reappear to PHP,
but no other databases were visible.
I also tried to connect PHP to MySQL as a super-user, and encountered
the exact same issue.

Steps to confirm question:
1) Connect using php, drop 'test' database.
2) Confirm php no longer sees 'test' database.
3) Connect using mysql client, confirm test database is missing.
4) -\
4a) if so, check mysql database to confirm permissions for root
include '%' databases and not just 'test'.
4b) if not, change php code to connect to correct mysql server.
Apologies that this may not be very useful, but your problem is
extremely odd - if it's *not* a permissions / database error.
Cheers,
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: checkbox into mysql using php input type=checkbox name=list[] value=x

2005-02-16 Thread pete M
foreach($_POST['name'] as $k = $v){
}
moses Woldeselassie wrote:
hi all
I need a simple php script to use for html

form action=checkbox.php method=post
  Select from the list br / (check all that apply):br /
  input type=checkbox name=list[] value=x
 input type=checkbox name=list[] value=y
input type=submit name=submit value=Go! /
/form
kind regards
meberat
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP-DB] Re: checkbox into mysql using php input type=checkbox name=list

2005-02-16 Thread moses Woldeselassie
Thank you,
i don't have any problem using that syntax:
if (isset($_POST['submit'])) {
 echo You chose the following games:br /;
 foreach($_POST['games'] AS $game = $value)
	  	  	  $sql = mysql_query(insert into interest(username) 
values('$value'));

but the problem is with the following:
$valuecount = count($value)
for($i =0; $i  $valuecount; $i++) {
$sql = mysql_query(insert into interest values('$value', '$value[$i]'));
I don't get any input into mysql.
kind regards
m
gt;From: pete M lt;[EMAIL PROTECTED]gt;
gt;To: php-db@lists.php.net
gt;Subject: [PHP-DB] Re: checkbox into mysql using php  lt;input 
type=quot;checkboxquot; name=quot;list[]quot;value=quot;xquot;gt;
gt;Date: Wed, 16 Feb 2005 18:22:14 +
gt;
gt;foreach($_POST['name'] as $k =gt; $v){
gt;
gt;}
gt;
gt;moses Woldeselassie wrote:
gt;gt;hi all
gt;gt;
gt;gt;
gt;gt;I need a simple php script to use for html
gt;gt;
gt;gt;
gt;gt;
gt;gt;lt;form action=quot;checkbox.phpquot; method=quot;postquot;gt;
gt;gt;   Select from the list lt;br /gt; (check all that apply):lt;br 
/gt;
gt;gt;   lt;input type=quot;checkboxquot; name=quot;list[]quot; 
value=quot;xquot;gt;
gt;gt;  lt;input type=quot;checkboxquot; name=quot;list[]quot; 
value=quot;yquot;gt;
gt;gt;lt;input type=quot;submitquot; name=quot;submitquot; 
value=quot;Go!quot; /gt;
gt;gt;lt;/formgt;
gt;gt;
gt;gt;kind regards
gt;gt;meberat
gt;
gt;--
gt;PHP Database Mailing List (http://www.php.net/)
gt;To unsubscribe, visit: http://www.php.net/unsub.php
gt;

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP-DB] Re: checkbox into mysql using php input type=checkbox name=list

2005-02-16 Thread Bastien Koert
$value is not an array...wont run
try
$valuecount = count($_POST['games']);
bastien
From: moses Woldeselassie [EMAIL PROTECTED]
To: php-db@lists.php.net
Subject: RE: [PHP-DB] Re: checkbox into mysql using php input 
type=checkbox name=list
Date: Wed, 16 Feb 2005 22:09:09 +

Thank you,
i don't have any problem using that syntax:
if (isset($_POST['submit'])) {
 echo You chose the following games:br /;
 foreach($_POST['games'] AS $game = $value)
	  	  	  $sql = mysql_query(insert into interest(username) 
values('$value'));

but the problem is with the following:
$valuecount = count($value)
for($i =0; $i  $valuecount; $i++) {
$sql = mysql_query(insert into interest values('$value', '$value[$i]'));
I don't get any input into mysql.
kind regards
m
gt;From: pete M lt;[EMAIL PROTECTED]gt;
gt;To: php-db@lists.php.net
gt;Subject: [PHP-DB] Re: checkbox into mysql using php  lt;input 
type=quot;checkboxquot; name=quot;list[]quot;value=quot;xquot;gt;
gt;Date: Wed, 16 Feb 2005 18:22:14 +
gt;
gt;foreach($_POST['name'] as $k =gt; $v){
gt;
gt;}
gt;
gt;moses Woldeselassie wrote:
gt;gt;hi all
gt;gt;
gt;gt;
gt;gt;I need a simple php script to use for html
gt;gt;
gt;gt;
gt;gt;
gt;gt;lt;form action=quot;checkbox.phpquot; 
method=quot;postquot;gt;
gt;gt;   Select from the list lt;br /gt; (check all that apply):lt;br 
/gt;
gt;gt;   lt;input type=quot;checkboxquot; name=quot;list[]quot; 
value=quot;xquot;gt;
gt;gt;  lt;input type=quot;checkboxquot; name=quot;list[]quot; 
value=quot;yquot;gt;
gt;gt;lt;input type=quot;submitquot; name=quot;submitquot; 
value=quot;Go!quot; /gt;
gt;gt;lt;/formgt;
gt;gt;
gt;gt;kind regards
gt;gt;meberat
gt;
gt;--
gt;PHP Database Mailing List (http://www.php.net/)
gt;To unsubscribe, visit: http://www.php.net/unsub.php
gt;

--
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] Intermittent odbc_connect() problem with iodbc/openlink

2005-02-16 Thread Crone, James
I'm having intermittent problems with odbc_connect().  Here's the
situation

 

I'm trying to connect to a Sybase Adaptive Server Anywhere database
running on Win2K from my web server using Solaris, Apache, PHP, iODBC,
and OpenLink's ODBC universal data access driver for MSSQL/Sybase.
About 75% of the time, my php scripts talk to the Sybase system fine.
However, the other 25% of the time nothing really happens.  IE reports a
Page cannot be displayed error, while Firefox acts like it may do
something for a fraction of a second, but then just stays on the
currently loaded page.

 

I have tracing turned on in iODBC.  When things work fine, a lengthy
trace file is generated and everything seems to be in order.  When
things don't work, all I get is the following:

--

 

** iODBC Trace file **

** started on Wed Feb 16, 20:29 **

 

 

Application 0001 ENTER SQLAllocEnv

SQLHENV * 2f3158

 

Application 0001 EXIT  SQLAllocEnv with return code 0
(SQL_SUCCESS)

SQLHENV * 2f3158 (30af78)

 

Application 0001 ENTER SQLAllocConnect

SQLHENV   30af78

SQLHDBC * 2f315c

 

Application 0001 EXIT  SQLAllocConnect with return code 0
(SQL_SUCCESS)

SQLHENV   30af78

SQLHDBC * 2f315c (2dbbc8)

 

Application 0001 ENTER SQLConnect

SQLHDBC   2dbbc8

SQLCHAR * 30c7e0

  | PF32
|

SQLSMALLINT   -3 (SQL_NTS)

SQLCHAR * 2f5b10

  | viewaward
|

SQLSMALLINT   -3 (SQL_NTS)

SQLCHAR * ff0c4a28

  | 
|

SQLSMALLINT   -3 (SQL_NTS)

 

--

 

No connect errors are generated either in the trace file or in the
browser's display.  It's almost as if the process just dies without
saying anything about why it happened.

 

Any ideas?

 

Thanks,

Jim

__
Jim Crone
Electronic Communications Manager

Bradley University
E-mail: [EMAIL PROTECTED]
Phone: 1-800-447-6460
Fax: 309-677-2797

Discover a university experience that will prepare you for a lifetime of
personal and professional achievement at:
http://admissions.bradley.edu/ http://admissions.bradley.edu/ 

 



[PHP-DB] Re: donwload listed dir

2005-02-16 Thread Nadim Attari
http://www.chrispederick.com/work/php/source/file/file.php


It Clown [EMAIL PROTECTED] a écrit dans le message de
news:[EMAIL PROTECTED]
 Hi All,

 How would i create links dynamicaly for each file that has
 been listed in a dir?

 Regards
 __
 http://www.webmail.co.za the South African FREE email service

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php