[PHP-DB] php/mysql problem

2002-12-14 Thread Stefan Windt
hi,
i've a problem with php and mysql.
a mysql-server is running on my server on that i can access from 'outside'.
but, if i want to connect to the server with a 'local' php skript (running
on the same server), mysql refuses the login ('acces denied for user
[...]'). the problem is that the login i use in the php skript is exactly
the same as the one i use for connecting from 'outside'.
another strange thing is that the php skript can connect to other mysql-dbs
on other servers...
is it a config-problem ? i've no idea anymore...

Stefan



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




[PHP-DB] Make new linux user accounts with pjp /mysql

2002-12-14 Thread Dave Carrera
Hi All
I think this may be a bit of topic but here goes.
I would like to know what logic is needed to create a new user on a
Linux box
Once this user has completed a sign up.
I want to create my own php / mysql driven webhost control panel which
allows
 
Creation of vhost in http.conf
Creation of user account
Creation of a MySql db for that user
Creation of pops for that users
 
Just like some other Host CP's I have seen.
 
Maybe store info in a db for users to be able to edit / add services.
 
Any thoughts, examples, warnings, advice as always appreciated.
 
This will be running on a LINUX box if that make a difference.
 
Thank you in advance and again sorry if its slightly of topic.
 
Dave C



Re: [PHP-DB] php/mysql problem

2002-12-14 Thread DL Neil
Hi Stefan,

 i've a problem with php and mysql.
 a mysql-server is running on my server on that i can access from
'outside'.
 but, if i want to connect to the server with a 'local' php skript (running
 on the same server), mysql refuses the login ('acces denied for user
 [...]'). the problem is that the login i use in the php skript is exactly
 the same as the one i use for connecting from 'outside'.
 another strange thing is that the php skript can connect to other
mysql-dbs
 on other servers...
 is it a config-problem ? i've no idea anymore...


you@remotehost is not the same (MySQL user) as you@localhost!
Check out the MySQL manual's page on user privileges and access control.

Regards,
=dn


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




Re: [PHP-DB] little question from beginner

2002-12-14 Thread Brad Bonkoski
Well, I would look at 2 possible problems:
1). Submit is an HTML input type, and I would try to avoid using it as a
script variable just to make sure avoid confusion.
2). You may not have register_globals turn 'on' in your php.ini file.  So,
if the form method is POST, try: $_POST['submit'].  Or $_SERVER['submit']

HTH
-Brad

Hermanto Kurniawan wrote:

 Hi,
 I am having trouble with using PHP for submitting a form.

 I've defined all the inputs for the form. and the html for the button is
 like this :
 input type=submit name=submit value=send

 when I wanted to process the data of the form using :
 if($submit){
 ...//my script here
 }

 the browser tell the notice that variable submit isn't defined..

 why??? thanks for answering

 _
 The new MSN 8: advanced junk mail protection and 2 months FREE*
 http://join.msn.com/?page=features/junkmail

 --
 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] Selecting more than asked for

2002-12-14 Thread Ignatius Reilly
$SQL =  SELECT * FROM resources where unit_id='{$unit_id}' order by level
;

Ignatius

- Original Message -
From: Alex Francis [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, December 14, 2002 8:37 PM
Subject: [PHP-DB] Selecting more than asked for


 When using the statement below, as well as getting the data corresponding
to
 $unit_id, I also get any data where unit_id field is blank. I have tried
 various permutations of unit_id IS NOT NULL, but get syntax errors. Can
 someone help to get the syntax correct.

 $SQL =  SELECT * FROM resources where unit_id='$unit_id' order by level
;




 --
 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] Selecting more than asked for

2002-12-14 Thread Andre Gemünd
You shouldnt get any syntax errors i think
use $sql = SELECT * FROM resources WHERE unit_id='$unit_id' AND unit_id IS
NOT NULL ORDER BY level;
as far as your unit_id is DEFAULT NULL.
Otherwise try using WHERE unit_id0 AND unit_id'' or something like this,
depending on your type of variable.

If this isn't solving your problem, show us more source-code and the
table-columns definition.

greets
ag

- Original Message -
From: Alex Francis [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, December 14, 2002 8:37 PM
Subject: [PHP-DB] Selecting more than asked for


When using the statement below, as well as getting the data corresponding to
$unit_id, I also get any data where unit_id field is blank. I have tried
various permutations of unit_id IS NOT NULL, but get syntax errors. Can
someone help to get the syntax correct.

$SQL =  SELECT * FROM resources where unit_id='$unit_id' order by level ;




--
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] OpenSSL, PHP and MySQL

2002-12-14 Thread Joshua Minnie
Hey all,
I was wondering if anyone could point me to a good tutorial to learn how
to use the OpenSSL functions to set access a MySQL db under a secure
connection.  I have tried reading the manual, looking at PHPClasses.org,
PHPBuilder.com, and Hotscripts.com and I haven't come accross anything as of
yet, and I still feel like I don't totally understand it.  I done my
googling as well.  I was just hoping that someone else knew of another
resource which I could utilize to help myself learn how to use the
functionality of the OpenSSL functions.

Joshua Minnie
[EMAIL PROTECTED]
Independent Web Consultant / Developer
Wild Web Technology
www.wildwebtech.com



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




Re: [PHP-DB] OpenSSL, PHP and MySQL

2002-12-14 Thread Marco Tabini
I usually build an SSH tunnel whenever I need to connect securely to a
remote MySQL server. There's a tutorial on how to do that here:

http://www.netsys.com/cgi-bin/display_article.cgi?908


Marco
-- 

php|architect - The Magazine for PHP Professionals
The monthly magazine dedicated to the world of PHP programming

Check us out on the web at http://www.phparch.com!

---BeginMessage---
Hey all,
I was wondering if anyone could point me to a good tutorial to learn how
to use the OpenSSL functions to set access a MySQL db under a secure
connection.  I have tried reading the manual, looking at PHPClasses.org,
PHPBuilder.com, and Hotscripts.com and I haven't come accross anything as of
yet, and I still feel like I don't totally understand it.  I done my
googling as well.  I was just hoping that someone else knew of another
resource which I could utilize to help myself learn how to use the
functionality of the OpenSSL functions.

Joshua Minnie
[EMAIL PROTECTED]
Independent Web Consultant / Developer
Wild Web Technology
www.wildwebtech.com



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



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


Re: [PHP-DB] OpenSSL, PHP and MySQL

2002-12-14 Thread Joshua Minnie
Unfortunately that doesn't answer my question because of what I need to do.
I probably should have included this in the first post, but here is the
scenario:

My client has a website in which a customer will be purchasing gift
certificates online.  They don't need a comprehensive e-commerce package,
just simple information passed across a secure connection, such as: user
names, passwords, credit cards and mailing addresses.  We already have a
MySQL db set up with the gift certificate package information.  I just
need to be able to store the customer information for retrieval later by the
owners of the site.

Joshua Minnie
[EMAIL PROTECTED]
Independent Web Consultant / Developer
Wild Web Technology
www.wildwebtech.com

Marco Tabini [EMAIL PROTECTED] wrote:
 I usually build an SSH tunnel whenever I need to connect securely to a
 remote MySQL server. There's a tutorial on how to do that here:

 http://www.netsys.com/cgi-bin/display_article.cgi?908



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




[PHP-DB] Querying two tables

2002-12-14 Thread Cesar Aracena

Hi all,

I have several tables from which I have to fetch certain products 
categories based on customer selection. The tables are as follows:

Table 1 - Categories
catid (autonum)
catname

Table 2 - Sub categories
subcatid (autonum)
subcatname

Table 3 - Products
prodid (autonum)
prodname

Table 4 - Relationships
Catid
Subcatid
Prodid

Now, the question is how to fetch all the sub-categories let's say that
are related to category 0001. I know it's as simple as relating two
tables in one query, but I don't remember how. Any help appreciated.


Cesar L. Aracena
[EMAIL PROTECTED]
[EMAIL PROTECTED]
(0299) 156-356688
Neuquén (8300) Capital
Argentina




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




RE: [PHP-DB] OpenSSL, PHP and MySQL

2002-12-14 Thread John W. Holmes
 Hey all,
 I was wondering if anyone could point me to a good tutorial to
learn
 how
 to use the OpenSSL functions to set access a MySQL db under a secure
 connection.  I have tried reading the manual, looking at
PHPClasses.org,
 PHPBuilder.com, and Hotscripts.com and I haven't come accross anything
as
 of
 yet, and I still feel like I don't totally understand it.  I done my
 googling as well.  I was just hoping that someone else knew of another
 resource which I could utilize to help myself learn how to use the
 functionality of the OpenSSL functions.

Not sure if this answers your question or not, but MySQL 4.0 supports
connections under SSL and in PHP 4.3 you can set a flag in the
mysql_connect() function to make it connect over SSL. That's assuming
you've already got them set up, though. If it's the setup part you're
after, I can't help you there. :)

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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




RE: [PHP-DB] OpenSSL, PHP and MySQL

2002-12-14 Thread John W. Holmes
 My client has a website in which a customer will be purchasing gift
 certificates online.  They don't need a comprehensive e-commerce
package,
 just simple information passed across a secure connection, such as:
user
 names, passwords, credit cards and mailing addresses.  We already have
a
 MySQL db set up with the gift certificate package information.  I
just
 need to be able to store the customer information for retrieval later
by
 the
 owners of the site.

So is the MySQL database on a different machine? If it is, and you're
talking about sending data securely to it, then using MySQL4/PHP4.3 or
an SSH tunnel like Marco said are your options. If it's on the same
machine, then you don't have to worry about this. Or are you talking
about storing it securely, i.e. encrypting it within the database?

Don't take this the wrong way, but unless you really, really know what
you're doing, please don't store credit card numbers anywhere in your
system. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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




[PHP-DB] UPDATE tbl problem...

2002-12-14 Thread Hartleigh Burton
Hi,

I am having a small problem when it comes to updating some tables that I
have. tblmembers and tbloptions are both linked together with the exact
same userid #. here is the code i have been using...

mysql_query(UPDATE tbloptions SET
strColorPref='$tmpColorPref' strTextPref='$tmpTextPref'
strLinkPref='$tmpLinkPref' strALinkPref='$tmpALinkPref' WHERE
strIDent='$_SESSION[strIDent]');
mysql_query(UPDATE tblmembers SET
strAction='Successfully updated user settings on $logdate.' WHERE
strIDent='$_SESSION[strIDent]');

Now, heres where i am confused, the second update statement for
tblmembers, works fine, no problems. The variables listed in both
statements work, i have tested them.

The second statement however does not seem to insert the data into the
table at all. no errors are returned, all seems good, but the data isn't
there. i have privileges set for both tables properly. i can't figure it
out, if anyone can help, please reply. :)



Hartleigh Burton
www.channel-x.org



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




Re: [PHP-DB] UPDATE tbl problem...

2002-12-14 Thread Jason Wong
On Sunday 15 December 2002 09:24, Hartleigh Burton wrote:
 Hi,

 I am having a small problem when it comes to updating some tables that I
 have. tblmembers and tbloptions are both linked together with the exact
 same userid #. here is the code i have been using...

   mysql_query(UPDATE tbloptions SET
 strColorPref='$tmpColorPref' strTextPref='$tmpTextPref'
 strLinkPref='$tmpLinkPref' strALinkPref='$tmpALinkPref' WHERE
 strIDent='$_SESSION[strIDent]');
   mysql_query(UPDATE tblmembers SET
 strAction='Successfully updated user settings on $logdate.' WHERE
 strIDent='$_SESSION[strIDent]');

 Now, heres where i am confused, the second update statement for
 tblmembers, works fine, no problems. The variables listed in both
 statements work, i have tested them.

 The second statement however does not seem to insert the data into the
 table at all. no errors are returned, all seems good, but the data isn't
 there. i have privileges set for both tables properly. i can't figure it
 out, if anyone can help, please reply. :)

I'm assuming that in your last paragraph you mean the FIRST statement doesn't 
work. 

First, no errors are returned because you're not testing for it? You should 
_always_ use something like:

  mysql_query('...') or die(mysql_error());

Second, the reason why it fails is because you need commas between the items 
in your SET clause:

  UPDATE table SET col1 = 'val1', col2 = 'val2' ...

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *


/*
Carson's Consolation:
Nothing is ever a complete failure.
It can always be used as a bad example.
*/


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