Go Back   Tech Support Forum > Design Forum > Web Serving and Management

User Tag List

php/mysql unknown column in field list

This is a discussion on php/mysql unknown column in field list within the Web Serving and Management forums, part of the Tech Support Forum category. Unknown column '$Firstname' in 'field list' here was the code i've done, can someone help me? :( $query = 'INSERT


Closed Thread
 
Thread Tools Search this Thread
Old 08-04-2012, 06:40 AM   #1
Registered Member
 
Join Date: Aug 2012
Posts: 2
OS: Windows 7 Ultimate


Smile

Unknown column '$Firstname' in 'field list'

here was the code i've done, can someone help me? :(

$query = 'INSERT INTO registration_form (`Firstname` ,`MiddleInitial` ,`Lastname` ,`Address`,`ContactNo` ,`Gender` ,`Username` ,`Password`)
VALUES (`$Firstname` ,`$MiddleInitial` ,`$Lastname` ,`$Address`,`$ContactNo` ,`$Gender` ,`$Username` ,`$Password`)';
JuanToothTree is offline  
Sponsored Links
Advertisement
 
Old 08-05-2012, 07:56 PM   #2
Manager
- Alternative Computing
- Design
 
wmorri's Avatar
 
Join Date: May 2008
Location: New York
Posts: 6,493
OS: Window 7/Ubuntu/Fedora/Backtrack 5

My System

Send a message via AIM to wmorri Send a message via MSN to wmorri

Hi,

Can you post more code than that and and you give use the entire error message.
__________________


Linux Forever!|html5 boilerplate
wmorri is offline  
Old 08-09-2012, 07:16 AM   #3
Registered Member
 
Join Date: Aug 2012
Posts: 2
OS: Windows 7 Ultimate



this was the error message : Unknown column '$Firstname' in 'field list'


here was the whole code
HTML Code:
<html>
    <title>Registration</title>
    <head><center><font size="24">REGISTRATION FORM</font></center>
    </head>
    <body>
        <form name="Regform" method="POST" action="Reg.php">
            
            <b> Firstname </b>
            <input type ="text" name="FN"><br>
            <b> Middle Initial </b>
            <input type ="text" name="MI"><br>
            <b> Lastname </b>
            <input type ="text" name="LN"><br>

            
            <b> Address </b>
            <input type ="text" name="Add"><br>
            <b> Contact No. </b>
            <input type ="text" name="CN"><br>
            <b> Gender </b>
            <select name ="gender" style="width: 160px">
                <option value ="male">Male</option>
                <option value ="female">Female</option>
                <option value ="unknown">Unknown</option>
            </select><br>

            
            <b>USERNAME</b>
            <input type ="text" name="UN"><br>
            <b>PASSWORD</b>
            <input type ="password" name="PASS"><br>
            <b> Confirm Password</b>
            <input type ="password" name="CP"><br>


            <input type ="submit" name="Save" value ="Register">
            <input type ="reset" name="Reset">
            <input type ="button" name="Cancel" value ="Back" onclick="window.location.href='Index.php';">
        </form>
    <?php
            if(isset($_POST['Save']))
                {
                 $Firstname = trim($_POST['FN']);
                 $MiddleInitial = trim($_POST['MI']);
                 $Lastname = trim($_POST['LN']);
                 $Address = trim($_POST['Add']);
                 $ContactNo = trim($_POST['CN']);
                 $Gender = trim($_POST['gender']);
                 $Username = trim($_POST['UN']);
                 $Password = trim($_POST['PASS']);
                 $ConfirmPass = trim($_POST['CP']);

            if ($Password != $ConfirmPass)
                    {
                       print "<script type = 'text/javascript'>
                                alert('Your password did not match dude! XD');
                                    </script>";
                     }
                      else
                      {
            
            if ($Firstname == ''|| $MiddleInitial == '' || $Lastname == '' || $Address == '' || $ContactNo == '' || $Gender == '' || $Username == '' || $Password == '' || $ConfirmPass == '')
                      {
                        print "<script type = 'text/javascript'>
                                 alert('Reminder: Please Fill out all the information needed!');
                                    </script>";
                             
                       }
                        else
                        {
                    $Connection = mysql_connect('localhost','root','') or die(mysql_error());
                    mysql_select_db('registration') or die (mysql_error());
                    $query = 'INSERT INTO registration_form (`Firstname` ,`MiddleInitial` ,`Lastname` ,`Address`,`ContactNo` ,`Gender` ,`Username` ,`Password`)
                        VALUES (`$Firstname` ,`$MiddleInitial` ,`$Lastname` ,`$Address`,`$ContactNo` ,`$Gender` ,`$Username` ,`$Password`)';

                    $Result = mysql_query($query) or die(mysql_error());
                                echo 'Succesful!';
                                echo    "<meta http-equiv=refresh content=1;URL=Reg.php>";
        }
        }
        }
        
            
        ?>
JuanToothTree is offline  
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
Invisible Ads
I seem to have invisible ads that run on my computer that i cant seem to remove...Help? Logfile of random's system information tool 1.09 (written by random/random) Run by Family at 2012-06-20 16:21:44 Microsoft Windows 7 Home Premium Service Pack 1 System drive C: has 541 GB (91%) free of...
DiscGolfer Inactive Malware Help Topics 4 07-06-2012 02:59 PM
Windows 7 crash after 3-5 mins / Incl: Process list & full current HJT log @ crash.
Ok, so normally I can fix most any bug on my computer, and it's not a big deal for me.... But this one sucks and it has been a problem for about a month now. I have tried over a dozen different "fixes" from over 8 different blog sites with no real solution to my problem. I am running Win7 home...
Indyspark Windows 7 , Windows Vista Support 2 07-24-2011 12:31 PM
BSOD on my home Win7 HTPC [moved from V/7]
I have an HTPC that I built dedicated to running Windows Media Center. Media Center and supporting apps are all that it does and I do not install software on there beyond my based Media Center applications. Recently I have started to get a BSOD with different messages. One time it says...
AndresE BSOD, App Crashes And Hangs 27 02-15-2011 09:11 PM
[SOLVED] Internet (Browsing) only works in safe mode
Hi all, Yesterday I picked up a laptop of a friend of mine which had some problems with the Internet connectivity. Turns out, Internet only works when booted in Safe Mode, however, it does ping in Normal Mode so there is connectivity. Tried IE and Firefox, both do not work in Normal Mode and do...
swriezebos Networking Support 2 01-25-2011 07:49 AM

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is on
Smilies are on
[IMG] code is on
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Post a Question


» Site Navigation
 > FAQ
  > 10.0.0.2
Powered by vBadvanced CMPS v3.2.3


All times are GMT -7. The time now is 09:57 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
vBulletin Security provided by vBSecurity v2.2.2 (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.1.0 (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
Copyright 2001 - 2018, Tech Support Forum

Windows 10 - Windows 7 - Windows XP - Windows Vista - Trojan Removal - Spyware Removal - Virus Removal - Networking - Security - Top Web Hosts