[PHP-DB] Re: [PHP] Re: ARRAY, IF & INSERT

2002-06-23 Thread Jesper Brunholm

César aracena wrote:
> The catch would be to make PHP to auto assign the relatives "level" by
> knowing it has to start from $i=1 and loop $i++ until no other kid is
> inserted. Now that I write it, it seems I could use a for loop, but what
> should be the structure of it using the $name <> 0 you told me?

the name <> 0 was a sql-query - it will return a ressource which will 
enable you to make something like

$i=0;
while($row = mysql_fetch_assoc($nameless_result){

#psuedo-code#
# mysql_query=("insert into table set relativenumber = 'jr$i' where 
ID=$row["ID"]");
}

regards

Jesper Brunholm

btw: please do not write to my private email

-- 
Phønix - Danish folk music from young musicians - http://www.phonixfolk.dk



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




Re: [PHP-DB] sql standard

2002-06-23 Thread Steve Farmer

Hi,

In Oracle they are all UPPERCASE !!

Rgds
Steve
At 11:15 PM -0400 23/6/02, Gerard Samuel wrote:
>Hope someone can confirm this.
>I was moving a mysql dump to postgresql, and I had 2 tables with 
>MiXeD upper/lower case letters, that
>got converted to lowercase.  I found a discussion that sql 
>column/table/database names should be lowercase.
>Just trying to keep in line with a standard.
>Thanks
>
>--
>Gerard Samuel
>http://www.trini0.org:81/
>http://dev.trini0.org:81/
>
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php

-- 
-
"Minds are like parachutes, they work best when open"
Support free speech; visit http://www.efa.org.au/

Heads Together Systems Pty Ltd http://www.hts.com.au
Email: [EMAIL PROTECTED] Tel: 612 9982 6767 Fax: 612 9981 3081 

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




[PHP-DB] Whats more efficient....?

2002-06-23 Thread Matthew Nock

Is it more efficient to run a SELECT query on a MySQL database that
retrieves maybe 100 records from approximately 6 tables (based on one
result - such as a product ID) and then process these results using PHP

or is it more efficient to run say 6 SELECT statements that get the exact
details we want, and in the process returning a smaller number of results
over all?

If its the first of the two, then is it possible to use the MySQL "Group by"
structure to group the results, and store the results of each "group" (for
example a product category) in separate arrays?

ie;  array_prodcat1, array_prodcat2 etc etc?



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




[PHP-DB] sql standard

2002-06-23 Thread Gerard Samuel

Hope someone can confirm this.
I was moving a mysql dump to postgresql, and I had 2 tables with MiXeD 
upper/lower case letters, that
got converted to lowercase.  I found a discussion that sql 
column/table/database names should be lowercase.
Just trying to keep in line with a standard.
Thanks

-- 
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/



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




RE: [PHP-DB] E-mail address verification

2002-06-23 Thread Beau Lebens

also, you might like to do some client-side validation before sending it to
the server, in which case you can use somehting like
http://www.dentedreality.com.au/jsvalidation/

HTH

Beau

// -Original Message-
// From: [EMAIL PROTECTED]
// [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 21 June 2002 12:00 AM
// To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
// Subject: RE: [PHP-DB] E-mail address verification
// 
// 
// 
// 
// 
// I do it like this:
// 
// 
// if 
// (eregi("^[a-z0-9]+([\.%!][_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*$",
// $email))
// {
//   list($user, $host) = explode("@", $email);
//   if ( !checkdnsrr($host, "MX") )
//   return TRUE;
// }
// else
// {
//   return FALSE;
// }
//   }
// 
// As you can see, the email can "look" right, but domain isn't 
// valid. So you
// can check DNS record for MX domain.
// Next step is to connect to mail server and verify user, but 
// usualy that
// takes time and it's better to send some kind of auth code to 
// that mail and
// if user conforms it, you can use it...
// 
// This worked very well. For any of you out there that are 
// looking for a
// simple verification with host dns lookup, here it is!!!
// 
// For a more comprehensive "class" check here, thanks to Manuel Lemos
// 
// http://www.phpclasses.org/emailvalidation
// 
// 

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




RE: [PHP-DB] Finding numbers in a string

2002-06-23 Thread Russ

Seth:

You should have another colon ' : ' after your alnum expression:


if(ereg("[[:alnum:]]+", $textandnumbers, $numbers)) {
 print("$numbers");
  }

I'm not sure but you also may want to lose the double quotes or maybe
escape them.

Good luck.
Russ


-Original Message-
From: Seth Yount [mailto:[EMAIL PROTECTED]]
Sent: Saturday, June 22, 2002 1:52 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Finding numbers in a string


Forgot my email on that last one ;)

Hello all -

I am trying to seperate numberic characters from a string.  The book I 
was looking at described something like this:


if(ereg("[[:alnum]]+", $textandnumbers, $numbers)) {
 print("$numbers");
  }


When I run my script I receive this error:

Warning: REG_ECTYPE in ../mypage.php


Anyone have a solution / explanation to my problem

  - still reading


-- 
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] Question

2002-06-23 Thread Mike Tuller

That is where I am at. Which is better to use. Only need space for 4 drives
with the computers I currently use, but what if I purchase a server that
takes 16, and what other things might the future hold?

I think I will be better off having the drives separate and just match the
drives with the computer they are installed in. I know I am answering my own
question here, but it makes me feel more comfortable knowing that others
come up with the same solutions I do.

Thanks.

> From: "Peter Lovatt" <[EMAIL PROTECTED]>
> Date: Sun, 23 Jun 2002 22:24:32 +0100
> To: "Mike Tuller" <[EMAIL PROTECTED]>, "Chris Barnes"
> <[EMAIL PROTECTED]>, "Php-Db (E-mail)" <[EMAIL PROTECTED]>
> Subject: RE: [PHP-DB] Question
> 
> Hi
> 
> The correct way, IMHO, would be to consider the situation. The hard drives
> are a sub component of the computer. In which case the hard drive table
> should be a 'child' of the computer table.
> 
> However the hard drives could be an item in their own right too.
> 
> So if you want to consider the hard drive as an item, but to know which
> computer it is in then make HardDriveID the primary key of the hard drive
> table, and include ComputerID as a link field.
> 
> If it is basically a component of the computer then make
> (ComputerID,HardDriveID) the primary key.
> 
> In practice either will work as will
> 
> Computer table
> {
> ComputerID(primary)
> Hard_drive_1
> Hard_drive_2
> Hard_drive_3
> ..
> Hard_drive_n
> 
> }
> 
> which is simpler, not good design, but probably OK if you are sure you will
> never have more than 'n' drives
> 
> just my 2p worth
> 
> Peter
> ---
> Excellence in internet and open source software
> ---
> Sunmaia
> www.sunmaia.net
> [EMAIL PROTECTED]
> tel. 0121-242-1473
> ---
> 
>> -Original Message-
>> From: Mike Tuller [mailto:[EMAIL PROTECTED]]
>> Sent: 23 June 2002 21:07
>> To: Chris Barnes; Php-Db (E-mail)
>> Subject: Re: [PHP-DB] Question
>> 
>> 
>> That would probably work, but only for what I want right now. If I ever
>> wanted to create a report of all the hard drives I have, it would become
>> more difficult.
>> 
>> I know I need to have a separate table in the database for the drives, but
>> am not sure if the foreign key should be drives in the computer table, or
>> computer in the drive table. I could just go ahead and work with it, but I
>> am the type that wants to learn the right way in the beginning, not figure
>> out later that I was doing it wrong. As far as normalization,
> 
>> In reply to
>> Duncan's post) I have been reading up on that, and so far it
>> hasn't given me
>> the answer on this type of problem. Maybe what I am reading doesn't cover
>> that, so if you are talking about a particular document, let me know and I
>> will look at that.
>> 
>>> From: "Chris Barnes" <[EMAIL PROTECTED]>
>>> Date: Mon, 24 Jun 2002 05:03:53 +1000
>>> To: "Php-Db \(E-mail\)" <[EMAIL PROTECTED]>
>>> Subject: RE: [PHP-DB] Question
>>> 
>>> i dont know how will this will work, but you could try storing
>> the multiple
>>> hard disk details for each computer in an "array" in 1 field.
>>> then when you want to get the information from the db, use explode() to
>>> store the value in the field into an array again.
>>> 
>>> e.g.
>>> the field in the DB might look like this...
>>> HardDriveSize = "1.2Gb,25Gb,25Gb"
>>> 
>>> so get the field from the db and then use explode() to store it
>> in an array
>>> in php.
>>> e.g.
>>> $disk_size = explode("," , $field);
>>> 
>>> i dont know how well this will work for you...i'm only a newbie.
>>> 
>>> 
>>> -Original Message-
>>> From: Mike Tuller [mailto:[EMAIL PROTECTED]]
>>> Sent: Monday, 24 June 2002 3:43 AM
>>> To: [EMAIL PROTECTED]
>>> Subject: [PHP-DB] Question
>>> 
>>> 
>>> I am wanting to create a PHP frontend to a database that holds
>> information
>>> about the computers that I take care of. I have a problem though when it
>>> comes to storing hard drive information. In most cases, the
>> computers have
>>> one drive, but some have 2 or more, so I can't create the main
>> database with
>>> fields like this.
>>> 
>>> ComputerID
>>> HardDriveType
>>> HardDriveSize
>>> 
>>> I know I will need to create a separate table to hold
>> information about the
>>> drives, and connect them to the computer by attaching the
>> primary key of the
>>> drives table to the Computer table.
>>> 
>>> Computer Table
>>> 
>>> ComputerID
>>> DriveID
>>> 
>>> Drive Table
>>> 
>>> DriveID
>>> HardDriveType
>>> HardDriveSize
>>> 
>>> This is where I am unsure. If there is more than one drive,
>> then this would
>>> be incomplete because it would only show one drive. What is the
>> best way to
>>> make it so that all drives show for the computer, or am I doing this
>>> backwards? Should I tie the computer to the drive instead?
>>> 
>>> Thanks,
>>> Mike
>>> 
>>> 
>>> --
>>> PHP D

RE: [PHP-DB] Question

2002-06-23 Thread Peter Lovatt

Hi

The correct way, IMHO, would be to consider the situation. The hard drives
are a sub component of the computer. In which case the hard drive table
should be a 'child' of the computer table.

However the hard drives could be an item in their own right too.

So if you want to consider the hard drive as an item, but to know which
computer it is in then make HardDriveID the primary key of the hard drive
table, and include ComputerID as a link field.

If it is basically a component of the computer then make
(ComputerID,HardDriveID) the primary key.

In practice either will work as will

Computer table
{
ComputerID(primary)
Hard_drive_1
Hard_drive_2
Hard_drive_3
..
Hard_drive_n

}

 which is simpler, not good design, but probably OK if you are sure you will
never have more than 'n' drives

just my 2p worth

Peter
---
Excellence in internet and open source software
---
Sunmaia
www.sunmaia.net
[EMAIL PROTECTED]
tel. 0121-242-1473
---

> -Original Message-
> From: Mike Tuller [mailto:[EMAIL PROTECTED]]
> Sent: 23 June 2002 21:07
> To: Chris Barnes; Php-Db (E-mail)
> Subject: Re: [PHP-DB] Question
>
>
> That would probably work, but only for what I want right now. If I ever
> wanted to create a report of all the hard drives I have, it would become
> more difficult.
>
> I know I need to have a separate table in the database for the drives, but
> am not sure if the foreign key should be drives in the computer table, or
> computer in the drive table. I could just go ahead and work with it, but I
> am the type that wants to learn the right way in the beginning, not figure
> out later that I was doing it wrong. As far as normalization,

> In reply to
> Duncan's post) I have been reading up on that, and so far it
> hasn't given me
> the answer on this type of problem. Maybe what I am reading doesn't cover
> that, so if you are talking about a particular document, let me know and I
> will look at that.
>
> > From: "Chris Barnes" <[EMAIL PROTECTED]>
> > Date: Mon, 24 Jun 2002 05:03:53 +1000
> > To: "Php-Db \(E-mail\)" <[EMAIL PROTECTED]>
> > Subject: RE: [PHP-DB] Question
> >
> > i dont know how will this will work, but you could try storing
> the multiple
> > hard disk details for each computer in an "array" in 1 field.
> > then when you want to get the information from the db, use explode() to
> > store the value in the field into an array again.
> >
> > e.g.
> > the field in the DB might look like this...
> > HardDriveSize = "1.2Gb,25Gb,25Gb"
> >
> > so get the field from the db and then use explode() to store it
> in an array
> > in php.
> > e.g.
> > $disk_size = explode("," , $field);
> >
> > i dont know how well this will work for you...i'm only a newbie.
> >
> >
> > -Original Message-
> > From: Mike Tuller [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, 24 June 2002 3:43 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP-DB] Question
> >
> >
> > I am wanting to create a PHP frontend to a database that holds
> information
> > about the computers that I take care of. I have a problem though when it
> > comes to storing hard drive information. In most cases, the
> computers have
> > one drive, but some have 2 or more, so I can't create the main
> database with
> > fields like this.
> >
> > ComputerID
> > HardDriveType
> > HardDriveSize
> >
> > I know I will need to create a separate table to hold
> information about the
> > drives, and connect them to the computer by attaching the
> primary key of the
> > drives table to the Computer table.
> >
> > Computer Table
> >
> > ComputerID
> > DriveID
> > 
> > Drive Table
> >
> > DriveID
> > HardDriveType
> > HardDriveSize
> >
> > This is where I am unsure. If there is more than one drive,
> then this would
> > be incomplete because it would only show one drive. What is the
> best way to
> > make it so that all drives show for the computer, or am I doing this
> > backwards? Should I tie the computer to the drive instead?
> >
> > Thanks,
> > Mike
> >
> >
> > --
> > 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 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] Question

2002-06-23 Thread Mike Tuller

That would probably work, but only for what I want right now. If I ever
wanted to create a report of all the hard drives I have, it would become
more difficult.

I know I need to have a separate table in the database for the drives, but
am not sure if the foreign key should be drives in the computer table, or
computer in the drive table. I could just go ahead and work with it, but I
am the type that wants to learn the right way in the beginning, not figure
out later that I was doing it wrong. As far as normalization, ( In reply to
Duncan's post) I have been reading up on that, and so far it hasn't given me
the answer on this type of problem. Maybe what I am reading doesn't cover
that, so if you are talking about a particular document, let me know and I
will look at that.

> From: "Chris Barnes" <[EMAIL PROTECTED]>
> Date: Mon, 24 Jun 2002 05:03:53 +1000
> To: "Php-Db \(E-mail\)" <[EMAIL PROTECTED]>
> Subject: RE: [PHP-DB] Question
> 
> i dont know how will this will work, but you could try storing the multiple
> hard disk details for each computer in an "array" in 1 field.
> then when you want to get the information from the db, use explode() to
> store the value in the field into an array again.
> 
> e.g.
> the field in the DB might look like this...
> HardDriveSize = "1.2Gb,25Gb,25Gb"
> 
> so get the field from the db and then use explode() to store it in an array
> in php.
> e.g.
> $disk_size = explode("," , $field);
> 
> i dont know how well this will work for you...i'm only a newbie.
> 
> 
> -Original Message-
> From: Mike Tuller [mailto:[EMAIL PROTECTED]]
> Sent: Monday, 24 June 2002 3:43 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Question
> 
> 
> I am wanting to create a PHP frontend to a database that holds information
> about the computers that I take care of. I have a problem though when it
> comes to storing hard drive information. In most cases, the computers have
> one drive, but some have 2 or more, so I can't create the main database with
> fields like this.
> 
> ComputerID
> HardDriveType
> HardDriveSize
> 
> I know I will need to create a separate table to hold information about the
> drives, and connect them to the computer by attaching the primary key of the
> drives table to the Computer table.
> 
> Computer Table
> 
> ComputerID
> DriveID
> 
> Drive Table
> 
> DriveID
> HardDriveType
> HardDriveSize
> 
> This is where I am unsure. If there is more than one drive, then this would
> be incomplete because it would only show one drive. What is the best way to
> make it so that all drives show for the computer, or am I doing this
> backwards? Should I tie the computer to the drive instead?
> 
> Thanks,
> Mike
> 
> 
> --
> 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 Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] Problem whith mysql_connect()

2002-06-23 Thread Jason Wong

On Monday 11 June 2001 23:46, Fernando Gonzalez wrote:
> When I try to connect to mysql on a linux server It gives me the following
> message:
>
> "Fatal error: Call to undefined function: mysql_connect() in
> /home/web/media/conection.inc on line 2"

The error means that your version of PHP was not compiled with MySQL support. 
How did you install PHP? From source or RPM or whatever?

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


/*
Sic Transit Gloria Thursdi.
*/


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




RE: [PHP-DB] Question

2002-06-23 Thread Chris Barnes

i dont know how will this will work, but you could try storing the multiple
hard disk details for each computer in an "array" in 1 field.
then when you want to get the information from the db, use explode() to
store the value in the field into an array again.

e.g.
the field in the DB might look like this...
HardDriveSize = "1.2Gb,25Gb,25Gb"

so get the field from the db and then use explode() to store it in an array
in php.
e.g.
$disk_size = explode("," , $field);

i dont know how well this will work for you...i'm only a newbie.


-Original Message-
From: Mike Tuller [mailto:[EMAIL PROTECTED]]
Sent: Monday, 24 June 2002 3:43 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Question


I am wanting to create a PHP frontend to a database that holds information
about the computers that I take care of. I have a problem though when it
comes to storing hard drive information. In most cases, the computers have
one drive, but some have 2 or more, so I can't create the main database with
fields like this.

ComputerID
HardDriveType
HardDriveSize

I know I will need to create a separate table to hold information about the
drives, and connect them to the computer by attaching the primary key of the
drives table to the Computer table.

Computer Table

ComputerID
DriveID

Drive Table

DriveID
HardDriveType
HardDriveSize

This is where I am unsure. If there is more than one drive, then this would
be incomplete because it would only show one drive. What is the best way to
make it so that all drives show for the computer, or am I doing this
backwards? Should I tie the computer to the drive instead?

Thanks,
Mike


--
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] Question

2002-06-23 Thread Duncan Hill

On Sun, 23 Jun 2002, Mike Tuller wrote:

> I know I will need to create a separate table to hold information about
> the drives, and connect them to the computer by attaching the primary key
> of the drives table to the Computer table.

Good, you know a bit about normalisation.  But, not enough.  Look it up :)

> Computer Table
> 
> ComputerID
> DriveID
> 
> Drive Table
> 
> DriveID

Nope.

Computer table:
computer id
computer model
computer location

Drive table
computer id
drive id
drive model
drive size

Then use SQL to join the tables on computer id to get the appropriate info.

Probably something like select computer.model, computer.location, drive.size 
from computer, drive where drive.computerid = computer.computerid and 
computer.computerid = blah

Or something so.


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




[PHP-DB] Question

2002-06-23 Thread Mike Tuller

I am wanting to create a PHP frontend to a database that holds information
about the computers that I take care of. I have a problem though when it
comes to storing hard drive information. In most cases, the computers have
one drive, but some have 2 or more, so I can't create the main database with
fields like this.

ComputerID
HardDriveType
HardDriveSize

I know I will need to create a separate table to hold information about the
drives, and connect them to the computer by attaching the primary key of the
drives table to the Computer table.

Computer Table

ComputerID
DriveID

Drive Table

DriveID
HardDriveType
HardDriveSize

This is where I am unsure. If there is more than one drive, then this would
be incomplete because it would only show one drive. What is the best way to
make it so that all drives show for the computer, or am I doing this
backwards? Should I tie the computer to the drive instead?

Thanks,
Mike 


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




[PHP-DB] Re: question from newbie

2002-06-23 Thread Andy

Hi Chris,

if you have your keywords already in an array all you have to do is to
create the statement:

foreach($arrayname AS $value)
$where_stmt .= OR $value;

$stmt = "SELECT ...
WHERE ".$where_stmt
";

you might have to include an if stmt in the foreach loop because you are not
allowed to start with an OR.
But you get the idea?

Hope this helps,

Andy

--

http://www.globosapiens.net
Global Travellers Network!



"Chris Barnes" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
000201c21ace$65e66ba0$[EMAIL PROTECTED]">news:000201c21ace$65e66ba0$[EMAIL PROTECTED]...
> Hi people,
> Im quite new to the list.
>
> I am trying to construct a php script that will take a string submitted
from
> a web site, break it up into keywords and add to an array, then perform a
> query to a mysql db for each keyword in the array. It will then send the
> result to the browser.
>
> the script is complete so far as I have added the functions to get the
> string from the web site, explode it and add it to an array, but i'm
having
> trouble putting together a loop that will do a new query for every keyword
> in the array.
>
> is anyone able to help me with an example of a loop which could work for
me?
>
> any help very much apreciated :)
>
> Chris Barnes
>



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




[PHP-DB] question from newbie

2002-06-23 Thread Chris Barnes

Hi people,
Im quite new to the list.

I am trying to construct a php script that will take a string submitted from
a web site, break it up into keywords and add to an array, then perform a
query to a mysql db for each keyword in the array. It will then send the
result to the browser.

the script is complete so far as I have added the functions to get the
string from the web site, explode it and add it to an array, but i'm having
trouble putting together a loop that will do a new query for every keyword
in the array.

is anyone able to help me with an example of a loop which could work for me?

any help very much apreciated :)

Chris Barnes


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




[PHP-DB] Re: Problem w/ mysql_pconnect

2002-06-23 Thread Paul D

Guys,

I appreciate your input very much. This machine is a standalone unit. 
That's why I'm using "localhost". The user account has already been 
set-up in MySQL with the correct privileges, and I'm able to login at 
the console command prompt using "mysql -h localhost -u pauld -p 
my_pwd", with no problem at all. That's why I'm assuming that the 
problem lies somewhere else.

Paul D wrote:
> I'm using PHP 4.2.0 with MYSQL 3.23. When I try to use either the 
> mysql_connect or mysql_pconnect to access the database, I get the 
> following error message:
> 
> Access denied for user: '[EMAIL PROTECTED]' (Using password: YES)
> 
> I have tried different user names and nothing seems to work. If I use 
> the functions without any parameters, it'll work just fine, and when I 
> try access directly from the console, it'll work fine also. The problem 
> seems to lie with the function parameters, which is written as follows:
> 
>  $db = mysql_pconnect("localhost", "pauld", "any_pwd") or
> die($php_errormsg);
> 
> Any suggestions would be very much appreciated.
> 


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




[PHP-DB] Problem whith mysql_connect()

2002-06-23 Thread Fernando Gonzalez

When I try to connect to mysql on a linux server It gives me the following message:

"Fatal error: Call to undefined function: mysql_connect() in 
/home/web/media/conection.inc on line 2"

It seems there is a problem in the php configuration, however I am not an expert so 
need help to fix this.


I have another server Linux where there is no problem conecting. I have checked the 
php.inf  file in both of the servers and they are exactly the same. However when I 
call a page with the phpinfo() function, in the server with the mysql_connect() 
problem I willl not retrieve the Mysql Information that I retrieve in the correct 
server, that is:

  MySQL Support enabled 
  Active Persistent Links 0 
  Active Links 0 
  Client API version 3.23.36 
  MYSQL_INCLUDE   
  MYSQL_LFLAGS   
  MYSQL_LIBS   

  Directive Local Value Master Value 
  mysql.allow_persistent
 On On 
  mysql.default_host
 no value no value 
  mysql.default_password
 no value no value 
  mysql.default_port
 no value no value 
  mysql.default_socket
 no value no value 
  mysql.default_user
 no value no value 
  mysql.max_links
 Unlimited Unlimited 
  mysql.max_persistent
 Unlimited Unlimited 



Can anyone help me at this please



THanks a lot


Fernando





Re: [PHP-DB] Problem w/ mysql_pconnect

2002-06-23 Thread Tony

You must create an account in MySQL with root user first, and grant the
account with the privileges you want it to have.

Tony S. Wu

Chris Barnes at [EMAIL PROTECTED] wrote:

> Hi Paul,
> I'm no MySQL expert and i'm only very new to this list but i have had the
> same problem before.
> What i did to fix the problem was replace "localhost" with the ip address of
> the machine...so on my network i my MySQL server is 10.3.2.1 so i used
> "10.3.2.1" instead of "localhost" and it worked for me.
> 
> the real solution i guess would be to grant access for that username from
> the "localhost.localdomain" address in your MySQL server.
> 
> see how u go.
> 
> -Original Message-
> From: Paul D [mailto:[EMAIL PROTECTED]]
> Sent: Monday, 24 June 2002 12:07 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Problem w/ mysql_pconnect
> 
> 
> I'm using PHP 4.2.0 with MYSQL 3.23. When I try to use either the
> mysql_connect or mysql_pconnect to access the database, I get the
> following error message:
> 
> Access denied for user: '[EMAIL PROTECTED]' (Using password: YES)
> 
> I have tried different user names and nothing seems to work. If I use
> the functions without any parameters, it'll work just fine, and when I
> try access directly from the console, it'll work fine also. The problem
> seems to lie with the function parameters, which is written as follows:
> 
> $db = mysql_pconnect("localhost", "pauld", "any_pwd") or
> die($php_errormsg);
> 
> Any suggestions would be very much appreciated.
> 
> 
> --
> 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] Problem w/ mysql_pconnect

2002-06-23 Thread Chris Barnes

Hi Paul,
I'm no MySQL expert and i'm only very new to this list but i have had the
same problem before.
What i did to fix the problem was replace "localhost" with the ip address of
the machine...so on my network i my MySQL server is 10.3.2.1 so i used
"10.3.2.1" instead of "localhost" and it worked for me.

the real solution i guess would be to grant access for that username from
the "localhost.localdomain" address in your MySQL server.

see how u go.

-Original Message-
From: Paul D [mailto:[EMAIL PROTECTED]]
Sent: Monday, 24 June 2002 12:07 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Problem w/ mysql_pconnect


I'm using PHP 4.2.0 with MYSQL 3.23. When I try to use either the
mysql_connect or mysql_pconnect to access the database, I get the
following error message:

Access denied for user: '[EMAIL PROTECTED]' (Using password: YES)

I have tried different user names and nothing seems to work. If I use
the functions without any parameters, it'll work just fine, and when I
try access directly from the console, it'll work fine also. The problem
seems to lie with the function parameters, which is written as follows:

  $db = mysql_pconnect("localhost", "pauld", "any_pwd") or
die($php_errormsg);

Any suggestions would be very much appreciated.


--
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] Problem w/ mysql_pconnect

2002-06-23 Thread Paul D

I'm using PHP 4.2.0 with MYSQL 3.23. When I try to use either the 
mysql_connect or mysql_pconnect to access the database, I get the 
following error message:

Access denied for user: '[EMAIL PROTECTED]' (Using password: YES)

I have tried different user names and nothing seems to work. If I use 
the functions without any parameters, it'll work just fine, and when I 
try access directly from the console, it'll work fine also. The problem 
seems to lie with the function parameters, which is written as follows:

  $db = mysql_pconnect("localhost", "pauld", "any_pwd") or   
die($php_errormsg);

Any suggestions would be very much appreciated.


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