i dont know whyyyyyyy  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

Reply via email to