PHP, MYSQL or WAMP
Posted by: flavio (200.8.18.---)
Date: March 27, 2006 03:05AM

Hey:

How are you?

This is my problem, When i try to insert data into the database it creates the fields of the data but it doesn't insert the data.

I've installed Apache 2, PHP 4 and MySQL 4 myself and the web site works perfectly, so what is my problem?

i think it could be the version of the database. Please let me know what you think, and if there is a solution please let me know it.

i think it is a great program and i want to use it. I use HTML, PHP codes.

Thanks for all.
Bye.


Options: ReplyQuote
Re: PHP, MYSQL or WAMP
Posted by: CyberSpatium (---.hsd1.or.comcast.net)
Date: March 27, 2006 07:48AM

You need to check out the phpMyAdmin manual on how to use it. You are not using it correctly. Make sure after you insert data, you press the submit button or go button to add the data to your database.

The phpMyAdmin manual is here:
[www.phpmyadmin.net]

Options: ReplyQuote
Re: PHP, MYSQL or WAMP
Posted by: flavio (200.8.18.---)
Date: March 27, 2006 05:32PM

I'm using MySQL front 3.2 and i also installed the Mysql Administrator's and Mysql Query Browser's adds for wamp, could it be my problem?

I'm going to try with the phpMyAdmin, but don't you think that maybe my problem could also be with the php, or mysql code version?

i'm going to try what you said. i'll let you know if it worked.

i have another option, coudn't it be the apache server? i mean, Do i have to change somthing in the httpd.conf, or in the Wamp's php.ini?

thanks



Post Edited (03-27-06 18:32)

Options: ReplyQuote
Re: PHP, MYSQL or WAMP
Posted by: CyberSpatium (---.hsd1.or.comcast.net)
Date: March 28, 2006 02:56AM

Also, make sure you press the submit or ok button after you enter data into your DB using phpmyadmin, or the data will not be placed in the database.

Options: ReplyQuote
Re: PHP, MYSQL or WAMP
Posted by: flavio (200.8.18.---)
Date: March 28, 2006 06:22PM


Look, i have a web site, and it works with forms that send data to the Database, but when it sends the data, the database creates an empty field, i mean, the field is created but the data isn't inserted in the field.

thanks

Options: ReplyQuote
Re: PHP, MYSQL or WAMP
Posted by: CyberSpatium (---.hsd1.or.comcast.net)
Date: March 28, 2006 07:04PM

please post your php code so I can check it out.

Options: ReplyQuote
Re: PHP, MYSQL or WAMP
Posted by: flavio (200.8.18.---)
Date: March 29, 2006 12:44AM

<?php
// conectar MBD
$con = mysql_connect("localhost","*****","******"winking smiley;

// seleccion BD
mysql_select_db("videoteca",$con);
$imagen = addslashes(fread(fopen($imagen, "r"winking smiley, filesize($imagen)));

// construir SQL
$sql = "INSERT INTO peliculas (nombre, tipo, cod_peli, sinopsis, imagen)".
"VALUES ('$nombre', '$tipo', '$cod_peli', '$sinopsis', '$imagen')";

// Ejecutar SQL
$cursor=mysql_query($sql,$con);

// Procesar resultado
$insert = mysql_affected_rows($con);

if ($insert == -1)
echo "Ud. debe tener un error en su sql";

if ($insert > 0)
echo "La Pelicula fue insertada correctamente";
else
echo "El registró no fue insertado";

// cierra conexion
mysql_close($con);
?>

wich version of MySQL does the wamp install?
could My problem be that i'm using php 4 code for MySQL 5?

thanks
Flavio

Options: ReplyQuote


Sorry, only registered users may post in this forum.