[PHP] to holmes Re: [PHP] mysql trouble

2003-02-26 Thread Luis A
how is that ??
- Original Message -
From: John W. Holmes [EMAIL PROTECTED]
To: 'Luis A' [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 8:07 PM
Subject: RE: [PHP] mysql trouble


  take a look at this
  ?php
  // process form
  $link = mysql_connect(localhost, root);
  mysql_select_db(mydb,$db);
  $sql = INSERT INTO agenda (nombre, direccion, telefono, email)  +
VALUES ('$nombre', '$direccion', '$telefono', '$email');
  $result = mysql_query($sql);

 You use a period (.) to concatenate strings, not a plus (+) symbol.

 If you displayed $sql, like you should when you're debugging your
 script, you'd of realized this a long time ago.

 ---John W. Holmes...

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



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




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



[PHP] to holmes Re: [PHP] mysql trouble

2003-02-26 Thread Luis A
you mean  i do not need to put the pus on the end of the function

(+)   i dont need to put there that?


- Original Message -
From: John W. Holmes [EMAIL PROTECTED]
To: 'Richard Whitney' [EMAIL PROTECTED]; 'Luis A'
[EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 8:21 PM
Subject: RE: [PHP] mysql trouble


  ### ?php
  ### // process form
  ### $link = mysql_connect(localhost, root);
  you need to have the password as the third argument
  $link = mysql_connect(localhost, root, password);
 
  Also, why is it in a variable?
  Just make it:
  mysql_connect(localhost, root, password);

 Sometime there are users that do not have a password. Every parameter to
 mysql_connect() is optional, by the way.

 Also, you want to assign the result of mysql_connect() to a variable so
 you can tell the connections apart. If you only have one connection per
 script, then it's not a big deal. But, if you connect to several
 databases, then you need that result to tell them apart when you do
 queries later so PHP knows what connection to send your query through.

  ### mysql_select_db(mydb,$db);
  ### $sql = INSERT INTO agenda (nombre, direccion, telefono, email) 
 +

 Problem is the plus (+) sign at the end of this line.

 ---John W. Holmes...

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



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




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



RE: [PHP] to holmes Re: [PHP] mysql trouble

2003-02-26 Thread Niklas Lampén
No, he doesn't mean that.

You are doing:
$String = text  + more text;
while you should be doing:
$String = text  . more text;


Niklas

-Original Message-
From: Luis A [mailto:[EMAIL PROTECTED] 
Sent: 26. helmikuuta 2003 16:09
To: [EMAIL PROTECTED]
Subject: [PHP] to holmes Re: [PHP] mysql trouble


you mean  i do not need to put the pus on the end of the function

(+)   i dont need to put there that?


- Original Message -
From: John W. Holmes [EMAIL PROTECTED]
To: 'Richard Whitney' [EMAIL PROTECTED]; 'Luis A'
[EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 8:21 PM
Subject: RE: [PHP] mysql trouble


  ### ?php
  ### // process form
  ### $link = mysql_connect(localhost, root);
  you need to have the password as the third argument
  $link = mysql_connect(localhost, root, password);
 
  Also, why is it in a variable?
  Just make it:
  mysql_connect(localhost, root, password);

 Sometime there are users that do not have a password. Every parameter 
 to
 mysql_connect() is optional, by the way.

 Also, you want to assign the result of mysql_connect() to a variable 
 so you can tell the connections apart. If you only have one connection 
 per script, then it's not a big deal. But, if you connect to several 
 databases, then you need that result to tell them apart when you do 
 queries later so PHP knows what connection to send your query through.

  ### mysql_select_db(mydb,$db);
  ### $sql = INSERT INTO agenda (nombre, direccion, telefono, email) 
  
 +

 Problem is the plus (+) sign at the end of this line.

 ---John W. Holmes...

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



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




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

###
This message has been scanned by F-Secure Anti-Virus for Internet Mail. For
more information, connect to http://www.F-Secure.com/

###
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/

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



Re: [PHP] to paulm Re: [PHP] mysql trouble

2003-02-26 Thread Luis A
i know

the sql server in default does not have password


- Original Message -
From: paulm [EMAIL PROTECTED]
To: Luis A [EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 8:06 PM
Subject: Re: [PHP] to paulm Re: [PHP] mysql trouble


 k but you still need to do  insted of password, and see if you have a
sql
 password for root, it's not system password
 - Original Message -
 From: Luis A [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, February 26, 2003 2:21 AM
 Subject: [PHP] to paulm Re: [PHP] mysql trouble


 hey i think the root does not need password to connect to mysql

 or yes 

 on my server the root user does not have password
 thats why i dont know why he does not update the database?

 - Original Message -
 From: paulm [EMAIL PROTECTED]
 To: Luis A [EMAIL PROTECTED]
 Sent: Tuesday, February 25, 2003 6:48 PM
 Subject: Re: [PHP] mysql trouble


  you don't have a password for root in mysql_connect
  - Original Message -
  From: Luis A [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Wednesday, February 26, 2003 1:04 AM
  Subject: [PHP] mysql trouble
 
 
  hi pasl i got a troblem here
 
 
  if some one can help me ?
 
  take a look at this
  ?php
  // process form
  $link = mysql_connect(localhost, root);
  mysql_select_db(mydb,$db);
  $sql = INSERT INTO agenda (nombre, direccion, telefono, email)  +
VALUES ('$nombre', '$direccion', '$telefono', '$email');
  $result = mysql_query($sql);
  echo ¡Gracias! Hemos recibido sus datos.\n;
 
  ?
 
 
 
  HE DOES NOT WORKING
 
  any subjest ?
 
 



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




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



[PHP] to Bryan Lipscy Re: [PHP] mysql trouble

2003-02-26 Thread Luis A
the mysql server guives  to me this error now

tk a look


¡Gracias! Hemos recibido sus datos.
Warning: mysql_free_result(): supplied argument is not a valid MySQL result
resource in c:\apache group\apache\htdocs\1\2\registered.php3 on line 39

Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource
in c:\apache group\apache\htdocs\1\2\registered.php3 on line 42

the error is on here

line 39 mysql_free_result($result);

line 42 mysql_close($db);




- Original Message -
From: Bryan Lipscy [EMAIL PROTECTED]
To: 'Luis A' [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 8:25 PM
Subject: RE: [PHP] mysql trouble


 Create a user with appropriate privledges for the database.  DO NOT use
 root.


 ?php

 $DB_HOST = localhost;
 $DB_USER = root;  // Do not do this.  Make a different user.
 $DB_PASS = ;
 $DB_DB = mydb;

 // connect to the database server
 $db= @mysql_pconnect ( $DB_HOST , $DB_USER , $DB_PASS );

 // use the database
 @mysql_select_db ( $DB_DB )  or die ( [ERROR] .mysql_error()
 );

 // process form

 $sql = INSERT INTO agenda (nombre, direccion, telefono, email)
 VALUES ('.$nombre.', '.$direccion.', '.$telefono.',
 '.$email.');

 $result = mysql_query($sql);

 echo ¡Gracias! Hemos recibido sus datos.\n;

 /* Free resultset */
 mysql_free_result($result);

 /* Closing connection */
 mysql_close($db);

 ?


 You did not mention where the $nombre, $direccion, $telefono, or $email
 variables are being initialized.
 To capture the values from a form use $_POST['name'] where name is the
 name of the field on the form.

 HTH

 -Original Message-
 From: Luis A [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, February 25, 2003 4:21 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] to paulm Re: [PHP] mysql trouble


 hey i think the root does not need password to connect to mysql

 or yes 

 on my server the root user does not have password
 thats why i dont know why he does not update the database?

 - Original Message -
 From: paulm [EMAIL PROTECTED]
 To: Luis A [EMAIL PROTECTED]
 Sent: Tuesday, February 25, 2003 6:48 PM
 Subject: Re: [PHP] mysql trouble


  you don't have a password for root in mysql_connect
  - Original Message -
  From: Luis A [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Wednesday, February 26, 2003 1:04 AM
  Subject: [PHP] mysql trouble
 
 
  hi pasl i got a troblem here
 
 
  if some one can help me ?
 
  take a look at this
  ?php
  // process form
  $link = mysql_connect(localhost, root);
  mysql_select_db(mydb,$db); $sql = INSERT INTO agenda (nombre,
  direccion, telefono, email)  +
VALUES ('$nombre', '$direccion', '$telefono', '$email'); $result =

  mysql_query($sql); echo ¡Gracias! Hemos recibido sus datos.\n;
 
  ?
 
 
 
  HE DOES NOT WORKING
 
  any subjest ?
 
 



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




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



[PHP] to Bryan Lipscy Re: [PHP] mysql trouble

2003-02-26 Thread Luis A
i dont know whyyy  he does not inser into the databse the values ??


take a look

?php

$DB_HOST = localhost;
$DB_USER = db;  // Do not do this.  Make a different user.
$DB_PASS = luisito;
$DB_DB = mydb;

// connect to the database server
$db= @mysql_pconnect ( $DB_HOST , $DB_USER , $DB_PASS );

// use the database
@mysql_select_db ( $DB_DB )  or die ( [ERROR] .mysql_error()
);

// process form

$sql = INSERT INTO opina (nombre, provincia, pais, url, title, email,
comentario)
VALUES ('.$nombre.', '.$provincia.', '.$pais.', '.$url.',
'.$title.', '.$email.', '.$comentario.');

$result = mysql_query($sql);

echo ¡Gracias! Hemos recibido sus datos.\n;


?

aparently hje works all rigth

but when i present this var


?php
$link = mysql_connect(localhost, nobody);
mysql_select_db(mydb, $link);
$result = mysql_query(SELECT * FROM opina, $link);
echo Nombre: .mysql_result($result, 0, nombre).br;
echo Pais: .mysql_result($result, 0, pais).br;
echo Provincia: .mysql_result($result, 0, provincia).br;
echo URL :.mysql_result($result, 0, url).br;
echo Titulo de La Web: .mysql_result($result, 0, title).br;
echo E-mail :.mysql_result($result, 0, email).br;
echo Comentario :.mysql_result($result, 0, comentario).br;
?

on the navigator he present onley that
empty with no results of the database
look

Nombre:
Pais:
Provincia:
URL :
Titulo de La Web:
E-mail :
Comentario :




i dont know



any subjest ???

please help me im newbabe

)



- Original Message -
From: Bryan Lipscy [EMAIL PROTECTED]
To: 'Luis A' [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 8:25 PM
Subject: RE: [PHP] mysql trouble


 Create a user with appropriate privledges for the database.  DO NOT use
 root.


 ?php

 $DB_HOST = localhost;
 $DB_USER = root;  // Do not do this.  Make a different user.
 $DB_PASS = ;
 $DB_DB = mydb;

 // connect to the database server
 $db= @mysql_pconnect ( $DB_HOST , $DB_USER , $DB_PASS );

 // use the database
 @mysql_select_db ( $DB_DB )  or die ( [ERROR] .mysql_error()
 );

 // process form

 $sql = INSERT INTO agenda (nombre, direccion, telefono, email)
 VALUES ('.$nombre.', '.$direccion.', '.$telefono.',
 '.$email.');

 $result = mysql_query($sql);

 echo ¡Gracias! Hemos recibido sus datos.\n;

 /* Free resultset */
 mysql_free_result($result);

 /* Closing connection */
 mysql_close($db);

 ?


 You did not mention where the $nombre, $direccion, $telefono, or $email
 variables are being initialized.
 To capture the values from a form use $_POST['name'] where name is the
 name of the field on the form.

 HTH

 -Original Message-
 From: Luis A [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, February 25, 2003 4:21 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] to paulm Re: [PHP] mysql trouble


 hey i think the root does not need password to connect to mysql

 or yes 

 on my server the root user does not have password
 thats why i dont know why he does not update the database?

 - Original Message -
 From: paulm [EMAIL PROTECTED]
 To: Luis A [EMAIL PROTECTED]
 Sent: Tuesday, February 25, 2003 6:48 PM
 Subject: Re: [PHP] mysql trouble


  you don't have a password for root in mysql_connect
  - Original Message -
  From: Luis A [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Wednesday, February 26, 2003 1:04 AM
  Subject: [PHP] mysql trouble
 
 
  hi pasl i got a troblem here
 
 
  if some one can help me ?
 
  take a look at this
  ?php
  // process form
  $link = mysql_connect(localhost, root);
  mysql_select_db(mydb,$db); $sql = INSERT INTO agenda (nombre,
  direccion, telefono, email)  +
VALUES ('$nombre', '$direccion', '$telefono', '$email'); $result =

  mysql_query($sql); echo ¡Gracias! Hemos recibido sus datos.\n;
 
  ?
 
 
 
  HE DOES NOT WORKING
 
  any subjest ?
 
 



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




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



Re: [PHP] to Bryan Lipscy Re: [PHP] mysql trouble

2003-02-26 Thread Jason Wong
On Thursday 27 February 2003 01:00, Luis A wrote:

 ?php
 $link = mysql_connect(localhost, nobody);
 mysql_select_db(mydb, $link);
 $result = mysql_query(SELECT * FROM opina, $link);
 echo Nombre: .mysql_result($result, 0, nombre).br;

[snip]

You need to use the mysql_fetch_*() functions as well. See manual for details. 

Aren't you the guy who doesn't have internet access? [sic]. If so let me know 
and I'll email the manual to you, state whether you want:

a) English or Spanish (I see you're using a Cuba domain)
b) Single HTML or Multiple HTML or Windows HTML (CHM format)


-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
His great aim was to escape from civilization, and, as soon as he had
money, he went to Southern California.
*/


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



Re: [PHP] to Jason Wong Re: [PHP] mysql trouble

2003-02-26 Thread Luis A
OK IF no trouble for ud to send it to me the manual ??

in spanish
- Original Message -
From: Jason Wong [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, February 26, 2003 12:17 PM
Subject: Re: [PHP] to Bryan Lipscy Re: [PHP] mysql trouble


 On Thursday 27 February 2003 01:00, Luis A wrote:

  ?php
  $link = mysql_connect(localhost, nobody);
  mysql_select_db(mydb, $link);
  $result = mysql_query(SELECT * FROM opina, $link);
  echo Nombre: .mysql_result($result, 0, nombre).br;

 [snip]

 You need to use the mysql_fetch_*() functions as well. See manual for
details.

 Aren't you the guy who doesn't have internet access? [sic]. If so let me
know
 and I'll email the manual to you, state whether you want:

 a) English or Spanish (I see you're using a Cuba domain)
 b) Single HTML or Multiple HTML or Windows HTML (CHM format)


 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-general
 --
 /*
 His great aim was to escape from civilization, and, as soon as he had
 money, he went to Southern California.
 */


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





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



Re: [PHP] to Jason Wong Re: [PHP] mysql trouble

2003-02-26 Thread Jason Wong
On Thursday 27 February 2003 01:32, Luis A wrote:
 OK IF no trouble for ud to send it to me the manual ??

 in spanish

  b) Single HTML or Multiple HTML or Windows HTML (CHM format)

Which format?

Also please do not change the subject (ie putting people's name into the 
subject).

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Life -- Love It or Leave It.
*/


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



Re: [PHP] to Jason Wong Re: [PHP] mysql trouble

2003-02-26 Thread Luis A
HTML
b)single
- Original Message - 
From: Jason Wong [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, February 26, 2003 12:38 PM
Subject: Re: [PHP] to Jason Wong Re: [PHP] mysql trouble


 On Thursday 27 February 2003 01:32, Luis A wrote:
  OK IF no trouble for ud to send it to me the manual ??
 
  in spanish
 
   b) Single HTML or Multiple HTML or Windows HTML (CHM format)
 
 Which format?
 
 Also please do not change the subject (ie putting people's name into the 
 subject).
 
 -- 
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-general
 --
 /*
 Life -- Love It or Leave It.
 */
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 



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



[PHP] to paulm Re: [PHP] mysql trouble

2003-02-25 Thread Luis A
hey i think the root does not need password to connect to mysql

or yes 

on my server the root user does not have password
thats why i dont know why he does not update the database?

- Original Message -
From: paulm [EMAIL PROTECTED]
To: Luis A [EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 6:48 PM
Subject: Re: [PHP] mysql trouble


 you don't have a password for root in mysql_connect
 - Original Message -
 From: Luis A [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, February 26, 2003 1:04 AM
 Subject: [PHP] mysql trouble


 hi pasl i got a troblem here


 if some one can help me ?

 take a look at this
 ?php
 // process form
 $link = mysql_connect(localhost, root);
 mysql_select_db(mydb,$db);
 $sql = INSERT INTO agenda (nombre, direccion, telefono, email)  +
   VALUES ('$nombre', '$direccion', '$telefono', '$email');
 $result = mysql_query($sql);
 echo ¡Gracias! Hemos recibido sus datos.\n;

 ?



 HE DOES NOT WORKING

 any subjest ?





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



Re: [PHP] mysql trouble

2003-02-25 Thread Richard Whitney
Quoting Luis A [EMAIL PROTECTED]:

### hi pasl i got a troblem here 
### 
### 
### if some one can help me ?
### 
### take a look at this 
### ?php
### // process form
### $link = mysql_connect(localhost, root);
you need to have the password as the third argument
$link = mysql_connect(localhost, root, password);

Also, why is it in a variable?
Just make it:
mysql_connect(localhost, root, password);
### mysql_select_db(mydb,$db);
### $sql = INSERT INTO agenda (nombre, direccion, telefono, email)  +
###   VALUES ('$nombre', '$direccion', '$telefono', '$email');
### $result = mysql_query($sql);
### echo ¡Gracias! Hemos recibido sus datos.\n;
### 
### ?
### 
### 
### 
### HE DOES NOT WORKING 
### 
### any subjest ?
### 
### 
### 
### 


-- 
Richard Whitney   *
Transcend Development
Producing the next phase of your internet presence.
[EMAIL PROTECTED]   *
http://xend.net*
602-971-2791
  * *   *
*  *  *__**
 _/  \___  *
 *  /   *\**
  */ * *  \
**/\_ |\
 /   \_  /  \
/  \/\
   /  \ 
  /\
 /  \


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



RE: [PHP] mysql trouble

2003-02-25 Thread John W. Holmes
 take a look at this
 ?php
 // process form
 $link = mysql_connect(localhost, root);
 mysql_select_db(mydb,$db);
 $sql = INSERT INTO agenda (nombre, direccion, telefono, email)  +
   VALUES ('$nombre', '$direccion', '$telefono', '$email');
 $result = mysql_query($sql);

You use a period (.) to concatenate strings, not a plus (+) symbol.

If you displayed $sql, like you should when you're debugging your
script, you'd of realized this a long time ago. 

---John W. Holmes...

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



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



RE: [PHP] to paulm Re: [PHP] mysql trouble

2003-02-25 Thread John W. Holmes
 hey i think the root does not need password to connect to mysql
 
 or yes 
 
 on my server the root user does not have password
 thats why i dont know why he does not update the database?

You have no internet access, you think root does not need a password,
and you're a programmer... wow. 

You can set a password for the root user in MySQL. I guess it's not
required to have one, but it's a very good idea to have one. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/
 
 - Original Message -
 From: paulm [EMAIL PROTECTED]
 To: Luis A [EMAIL PROTECTED]
 Sent: Tuesday, February 25, 2003 6:48 PM
 Subject: Re: [PHP] mysql trouble
 
 
  you don't have a password for root in mysql_connect
  - Original Message -
  From: Luis A [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Wednesday, February 26, 2003 1:04 AM
  Subject: [PHP] mysql trouble
 
 
  hi pasl i got a troblem here
 
 
  if some one can help me ?
 
  take a look at this
  ?php
  // process form
  $link = mysql_connect(localhost, root);
  mysql_select_db(mydb,$db);
  $sql = INSERT INTO agenda (nombre, direccion, telefono, email)  +
VALUES ('$nombre', '$direccion', '$telefono', '$email');
  $result = mysql_query($sql);
  echo ¡Gracias! Hemos recibido sus datos.\n;
 
  ?
 
 
 
  HE DOES NOT WORKING
 
  any subjest ?
 
 
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




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



RE: [PHP] mysql trouble

2003-02-25 Thread John W. Holmes
 ### ?php
 ### // process form
 ### $link = mysql_connect(localhost, root);
 you need to have the password as the third argument
 $link = mysql_connect(localhost, root, password);
 
 Also, why is it in a variable?
 Just make it:
 mysql_connect(localhost, root, password);

Sometime there are users that do not have a password. Every parameter to
mysql_connect() is optional, by the way.

Also, you want to assign the result of mysql_connect() to a variable so
you can tell the connections apart. If you only have one connection per
script, then it's not a big deal. But, if you connect to several
databases, then you need that result to tell them apart when you do
queries later so PHP knows what connection to send your query through.

 ### mysql_select_db(mydb,$db);
 ### $sql = INSERT INTO agenda (nombre, direccion, telefono, email) 
+

Problem is the plus (+) sign at the end of this line.

---John W. Holmes...

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



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



RE: [PHP] mysql trouble

2003-02-25 Thread Bryan Lipscy
Create a user with appropriate privledges for the database.  DO NOT use
root.  


?php

$DB_HOST = localhost;
$DB_USER = root;  // Do not do this.  Make a different user.
$DB_PASS = ;
$DB_DB = mydb;

// connect to the database server
$db= @mysql_pconnect ( $DB_HOST , $DB_USER , $DB_PASS );

// use the database
@mysql_select_db ( $DB_DB )  or die ( [ERROR] .mysql_error()
);

// process form

 $sql = INSERT INTO agenda (nombre, direccion, telefono, email)
VALUES ('.$nombre.', '.$direccion.', '.$telefono.',
'.$email.'); 

$result = mysql_query($sql); 

echo ¡Gracias! Hemos recibido sus datos.\n;

/* Free resultset */
mysql_free_result($result);

/* Closing connection */
mysql_close($db);

?


You did not mention where the $nombre, $direccion, $telefono, or $email
variables are being initialized.
To capture the values from a form use $_POST['name'] where name is the
name of the field on the form.

HTH

-Original Message-
From: Luis A [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 25, 2003 4:21 PM
To: [EMAIL PROTECTED]
Subject: [PHP] to paulm Re: [PHP] mysql trouble


hey i think the root does not need password to connect to mysql

or yes 

on my server the root user does not have password
thats why i dont know why he does not update the database?

- Original Message -
From: paulm [EMAIL PROTECTED]
To: Luis A [EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 6:48 PM
Subject: Re: [PHP] mysql trouble


 you don't have a password for root in mysql_connect
 - Original Message -
 From: Luis A [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, February 26, 2003 1:04 AM
 Subject: [PHP] mysql trouble


 hi pasl i got a troblem here


 if some one can help me ?

 take a look at this
 ?php
 // process form
 $link = mysql_connect(localhost, root); 
 mysql_select_db(mydb,$db); $sql = INSERT INTO agenda (nombre, 
 direccion, telefono, email)  +
   VALUES ('$nombre', '$direccion', '$telefono', '$email'); $result =

 mysql_query($sql); echo ¡Gracias! Hemos recibido sus datos.\n;

 ?



 HE DOES NOT WORKING

 any subjest ?





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


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