Google Groups Home
Help | Sign in
php
Unknown column 'var_value?' in 'field list' O_o
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
n37  
View profile
 More options Jul 6 2006, 10:29 am
From: "n37" <rfernan...@alfadatacenter.com>
Date: Thu, 06 Jul 2006 07:29:08 -0700
Local: Thurs, Jul 6 2006 10:29 am
Subject: Unknown column 'var_value?' in 'field list' O_o
CODE:

$NombreEmpresa    = $_POST['NombreEmpresa'];
                $ActividadEmpresa = $_POST['ActividadEmpresa'];
                $Direccion        = $_POST['Direccion'];
                $Localidad        = $_POST['Localidad'];
                $Provincia        = $_POST['Provincia'];
                $Cp               = $_POST['Cp'];
                $Telf1            = $_POST['Telf1'];
                $Telf2            = $_POST['Telf2'];
                $Fax              = $_POST['Fax'];
                $TelfMovil        = $_POST['TelfMovil'];
                $Url              = $_POST['Url'];
                $Contacto         = $_POST['Contacto'];
                $Cargo            = $_POST['Cargo'];
                $Mail             = $_POST['Mail'];

                // Primero insertamos la empresa
                $queryemp = "INSERT INTO DirectoriosNauticos
(NombreEmpresa,
ActividadEmpresa, Direccion, Cp, Localidad, Provincia, Telf1, Telf2,
Fax, Contacto, Cargo, TelfMovil, Mail, Url) VALUES ('$NombreEmpresa',
$ActividadEmpresa, '$Direccion', $Cp, $Localidad, $Provincia, $Telf1,
$Telf2, $Fax, '$Contacto', '$Cargo', $TelfMovil, '$Mail', '$Url')";
                $resultemp = mysql_query($queryemp, $conex) or
die(mysql_error());

THE PAGE RETURNS:

Unknown column 'Barcelona' in 'field list'

MY EXPLANATION:

If i comment this 2 vars (like in bottom code), the error changes:

$queryemp = "INSERT INTO DirectoriosNauticos (Localidad, Provincia)
VALUES ('$Localidad', '$Provincia')";

It said:

You have an error in your SQL syntax; check the manual that corresponds

to your MySQL server version for the right syntax to use near
'DataCenter' at line 1

Where 'Datacenter' is part of the field $_POST['NombreEmpresa']; and
default val is 'LOL DataCenter'...

I'm being crazy or there's a hidden bug? :/

All help is much appreciated. Many thx all.

kthxb


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
n37  
View profile
 More options Jul 6 2006, 1:10 pm
From: "n37" <rfernan...@alfadatacenter.com>
Date: Thu, 06 Jul 2006 10:10:40 -0700
Local: Thurs, Jul 6 2006 1:10 pm
Subject: Re: Unknown column 'var_value?' in 'field list' O_o
UPDATE:

// variables del formulario
                $NombreEmpresa    = $_POST['NombreEmpresa'];
                $ActividadEmpresa = $_POST['ActividadEmpresa'];
                $Direccion        = $_POST['Direccion'];
                $Localidad        = $_POST['Localidad'];
                $Provincia        = $_POST['Provincia'];
                $Cp               = $_POST['Cp'];
                $Telf1            = $_POST['Telf1'];
                $Telf2            = $_POST['Telf2'];
                $Fax              = $_POST['Fax'];
                $TelfMovil        = $_POST['TelfMovil'];
                $Url              = $_POST['Url'];
                $Contacto         = $_POST['Contacto'];
                $Cargo            = $_POST['Cargo'];
                $Mail             = $_POST['Mail'];

                // Primero insertamos la empresa
                $queryemp = 'INSERT INTO DirectoriosNauticos (NombreEmpresa,
ActividadEmpresa, Direccion, Cp, Localidad, Provincia, Telf1, Telf2,
Fax, Contacto, Cargo, TelfMovil, Mail, Url) VALUES
("'.$NombreEmpresa.'", '.$ActividadEmpresa.', "'.$Direccion.'",
"'.$Cp.'", "'.$Localidad.'", "'.$Provincia.'", "'.$Telf1.'",
"'.$Telf2.'", "'.$Fax.'", "'.$Contacto.'", "'.$Cargo.'",
"'.$TelfMovil.'", "'.$Mail.'", "'.$Url.'")';
                $resultemp = mysql_query($queryemp, $conex) or die(mysql_error());

                echo $queryemp . "<br /><br />";

PRINTS:

INSERT INTO DirectoriosNauticos (NombreEmpresa, ActividadEmpresa,
Direccion, Cp, Localidad, Provincia, Telf1, Telf2, Fax, Contacto,
Cargo, TelfMovil, Mail, Url) VALUES ("Alfa DataCenter", 1, "C\\ loled 3
entlo1", "08025", "Barcelona", "Cataluña", "935672299", "935689299",
"934326599", "Raúl Fernández", "CTO", "687512732", "mail",
"http://www.alfadatacenter.com")

You have an error in your SQL syntax; check the manual that corresponds
to your MySQL server version for the right syntax to use near
'DataCenter' at line 1

Any suggestions?

Urgent, thx.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google