
17/08/2003, 13:46
|
 | | | Fecha de Ingreso: junio-2002 Ubicación: En la Internet.
Mensajes: 4.068
Antigüedad: 22 años, 9 meses Puntos: 5 | |
problema de conexion?? estoy utilizando un script pero me sale este error:
You have an error in your SQL syntax near '-_clasifica' at line 1
tengo un archivo llamado user.php con el siguiente contenido:
<?php
$host = 'localhost';
$user = 'xxxx';
$password = 'xxxxxxx';
$txt_db_name = 'aaaaa_net_-_clasifica';
?>
y otro llamado installer.php con este otro contenido:
$submit = $_POST['submit'];
$PHP_SELF = $_SERVER['PHP_SELF'];
if($submit)
{
//Connect to the database and select used database
include('user.php');
$connection = mysql_connect("$host","$user","$password")
or die(mysql_error());
$username = trim($_POST['username']);
$password = trim($_POST['password']);
$password2 = trim($_POST['password2']);
$season = trim($_POST['season']);
$team = trim($_POST['team']);
//
//Fields filled?
//
if($username == '' || $password == '' || $password2 == '' || $season == '' || $team == '')
{
echo'Fill all fields.';
exit();
}
//
//Passwrds are the same?
//
if($password != "$password2")
{
echo'You didn\'t retype correctly.';
exit();
}
if(strlen($password) < 6)
{
echo'Your password must be at least six characters long.';
exit();
}
//
//Create database if not exists
//
mysql_query("CREATE DATABASE IF NOT EXISTS $txt_db_name",$connection)
or die(mysql_error());
//
//Select the database
//
mysql_select_db("$txt_db_name");
//
//Deducted points table
//
mysql_query("
CREATE TABLE tplls_deductedpoints (
id int(11) NOT NULL auto_increment,
seasonid int(10) unsigned NOT NULL default '0',
teamid smallint(4) unsigned NOT NULL default '0',
points tinyint(3) NOT NULL default '0',
PRIMARY KEY (id),
KEY seasonid (seasonid),
KEY opponentid (teamid)
) TYPE=MyISAM
",$connection)
or die(); ....................................
¿que falla?? ¿alguien me puede ayudar?
GRACIAS |