473,763 Members | 8,483 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to resolve Unknown column 'full_name' in 'field list'?

115 New Member
Hi I have a table that contains all the informations about the user . i want to when to click edit to edit the information of a user .
I wrote this page : edit_user.php
Expand|Select|Wrap|Line Numbers
  1.  
  2. <?php
  3.         require_once("../../include/database.php");
  4.         require_once("../../Functions/user_functions.php");
  5.  
  6. $id=$_POST[id];
  7. user::GetInfoUser($userid);
  8.  
  9. //if form is submitted
  10. if(isset($_POST[Submit]))
  11. {  
  12.  
  13. $fullname   = mysql_real_escape_string($_POST[fullname]); 
  14. $gender     = mysql_real_escape_string($_POST[gender]);  
  15. $email         = mysql_real_escape_string($_POST[email]);      
  16. $password   = mysql_real_escape_string($_POST[password]);
  17. $phone      = mysql_real_escape_string($_POST[phone]);
  18. $birthday   = mysql_real_escape_string($_POST[birthday]);
  19. $nationality = mysql_real_escape_string($_POST[nationality]);
  20. $address  = mysql_real_escape_string($_POST[address]);
  21.  
  22.  
  23. user::UpdateUser($id,$fullname,$password,$gender,$email,$birthday,$phone,$address,$nationality);    
  24.  
  25.  
  26.     ?>
  27.     <script language="javascript">
  28.     alert('User Edited Successfully');
  29.     location = 'view_users.php';
  30.     </script>
  31.     <?php 
  32.     exit;
  33. }
  34.  
  35. ?>
  36.  
  37. <html><head>
  38. <script type="text/javascript" src="fckeditor/fckeditor.js"></script>
  39. <script language="javascript" src="gen_validatorv31.js"></script>
  40. <link href="../styles/hstyle.css" rel="stylesheet" type="text/css">
  41. <title>Admin main page</title> </head>
  42.  
  43. <body> <a href="http://bytes.com/submit/index.php"> Back to home </a></td> 
  44.  
  45. <p class="big_title1">Editing User</p>
  46. <form action="<?php echo $_SERVER[PHP_SELF] ?>" method="post" enctype="multipart/form-data" name="form2"> 
  47. <table width="970" border="0" cellpadding="3" cellspacing="3">
  48.   <tr>
  49.     <td width="112">Name</td>
  50.     <td width="800"><input name="fullname" type="text" class="width1" id="fullname" value="<?php  $id=$_GET['id']; 
  51.  $full_name = user::Getfullname($id,&$fullname);
  52.  echo $full_name; ?>" size="50" /></td>
  53.     <td >&nbsp;</td>
  54.     </tr>
  55.   <tr>
  56.     <td>Gender</td>
  57.     <td><input name="gender" type="text" class="width1" id="gender" value="<?php $gender=user::GetGender($id,&$gender); echo $gender ?>" size="5" /></td>
  58.   </tr>
  59.   <tr><td>Email</td>
  60.   <td><input name="email" type="text" class="width1" id="email" value="<?php $email=user::GetEmail($id,&$email); echo $email; ?>" size="50" /></td>
  61.   <td>&nbsp;</td>
  62.   </tr>
  63.     <tr><td>Password</td>
  64.   <td><input name="password" type="text" class="width1" id="password" value="<?php $password=user::GetPassword($id,&$password);
  65.   echo $password; ?>" size="20" /></td>
  66.   <td>&nbsp;</td>
  67.   </tr>
  68.   <tr><td>Birthday</td>
  69.   <td><input name=" birthday" type="text" class="width1" id=" birthday" value="<?php $birthday=user::GetBirthday($id,&$birthday);
  70.   echo $birthday; ?>" size="7" /></td>
  71.   <td>&nbsp;</td>
  72.   </tr>
  73.   <tr>
  74.     <td>Phone</td>
  75.     <td><input name="phone" type="text" class="width1" id="phone" value="<?php $phone=user::GetPhone($id,&$phone); echo $phone; ?>" /></td>
  76.     <td>&nbsp;</td>
  77.     </tr>
  78.     <tr>
  79.     <td>Address</td>
  80.     <td><input name="address" type="text" class="width1" id="address" value="<?php $address=user::GetAddress($id,&$address); echo $address; ?>" /></td>
  81.     <td>&nbsp;</td>
  82.     </tr>
  83.     <tr>
  84.     <td>Nationality</td>
  85.     <td><input name="nationality" type="text" class="width1" id="nationality" 
  86.     value="<?php $nationatlity=user::GetNationality($id,&$nationality); echo $nationality; ?>" /></td>
  87.     <td>&nbsp;</td>
  88.     </tr>
  89.   <tr>
  90.     <td colspan="3">&nbsp;</td>
  91.   </tr>
  92.   <tr>
  93.     <td><input type="submit" name="Submit" value="Edit Users" /></td>
  94.     <td>
  95.  
  96.         <div align="left">
  97.           <input name="id" type="hidden" id="id" value="<?php echo $_GET['id'] ;?>" />
  98.  
  99.         </div></td>
  100.     <td>&nbsp;</td>
  101.     </tr>
  102. </table>
  103. </form>
  104.  
  105. <script language="JavaScript" type="text/javascript">
  106. var frmvalidator = new Validator("form2");
  107. frmvalidator.addValidation("nametxt","req","Please enter a name");
  108.  
  109.  
  110. </script>
  111. <p>&nbsp;</p>
  112. </body>
  113. </html>
  114.  
and this is the code of the user_functions. php:
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. class user {
  3. function DeleteUser($id){
  4. mysql_query("DELETE FROM `users` WHERE user_id = $id");    
  5. }
  6.  
  7. function GetInfoUser($userid){
  8. $GetQuery  =  "SELECT * FROM users WHERE user_id='$userid'";
  9. $GetResult =  mysql_query($GetQuery);
  10. $row       =  mysql_fetch_array($GetResult); 
  11. }
  12.  
  13. function Getfullname($userid,&$full_name){
  14. $GetQuery  =  "SELECT * FROM users WHERE user_id='$userid'";
  15. $GetResult =  mysql_query($GetQuery);
  16. $row       =  mysql_fetch_array($GetResult);     
  17. $full_name = $row[full_name];    
  18. return $full_name;
  19. }
  20.  
  21. function GetGender($userid,&$gender){
  22. $GetQuery  =  "SELECT * FROM users WHERE user_id='$userid'";
  23. $GetResult =  mysql_query($GetQuery);
  24. $row       =  mysql_fetch_array($GetResult);     
  25. $gender = $row[gender];    
  26. return $gender;
  27. }
  28.  
  29. function GetEmail($userid,&$email){
  30. $GetQuery  =  "SELECT * FROM users WHERE user_id='$userid'";
  31. $GetResult =  mysql_query($GetQuery);
  32. $row       =  mysql_fetch_array($GetResult);     
  33. $email = $row[email];    
  34. return $email;
  35. }
  36.  
  37. function GetPassword($userid,&$password){
  38. $GetQuery  =  "SELECT * FROM users WHERE user_id='$userid'";
  39. $GetResult =  mysql_query($GetQuery);
  40. $row       =  mysql_fetch_array($GetResult);     
  41. $password = $row[password];    
  42. return $password;
  43. }
  44.  
  45. function GetBirthday($userid,&$birthday){
  46. $GetQuery  =  "SELECT * FROM users WHERE user_id='$userid'";
  47. $GetResult =  mysql_query($GetQuery);
  48. $row       =  mysql_fetch_array($GetResult);     
  49. $birthday = $row[birthday];    
  50. return $birthday;
  51. }
  52.  
  53. function GetPhone($userid,&$phone){
  54. $GetQuery  =  "SELECT * FROM users WHERE user_id='$userid'";
  55. $GetResult =  mysql_query($GetQuery);
  56. $row       =  mysql_fetch_array($GetResult);     
  57. $phone = $row[phone];    
  58. return $phone;
  59. }
  60.  
  61. function GetAddress($userid,&$address){
  62. $GetQuery  =  "SELECT * FROM users WHERE user_id='$userid'";
  63. $GetResult =  mysql_query($GetQuery);
  64. $row       =  mysql_fetch_array($GetResult);     
  65. $address = $row[address];    
  66. return $address;
  67. }
  68.  
  69. function GetNationality($userid,&$nationality){
  70. $GetQuery  =  "SELECT * FROM users WHERE user_id='$userid'";
  71. $GetResult =  mysql_query($GetQuery);
  72. $row       =  mysql_fetch_array($GetResult);     
  73. $nationality = $row[nationality];    
  74. return $nationality;
  75. }
  76.  
  77.  
  78. function UpdateUser($id,$full_name,$password,$gender,$email,$birthday,$phone,$address,$nationality){
  79.         $UpdateUser_Query = 'UPDATE  `tours` SET `full_name` = "'.$full_name.'" , `password` =  "'.$password.'" , `gender` = "'.$gender.'" ,
  80.                          `email` = "'.$email.'" , `birthday` = "'.$birthday.'"  , `phone` = "'.$phone.'"  , `address` = "'.$address.'"
  81.                           WHERE  `tours`.`tour_id` ="' .$id.'"' ;
  82.         mysql_query($UpdateUser_Query) or die(mysql_error());
  83. }} 
But i'm keep getting this error when i click on submit to edit the info: Unknown column 'full_name' in 'field list'. Any help please i will appreciate it
Sep 30 '10 #1
1 7265
Markus
6,050 Recognized Expert Expert
This is a MySQL error, and, as such, should be posted in the relevant MySQL forum. However, the error, as suggested, is that the column 'full_name' does not exist in the table 'tours'.
Oct 1 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
9870
by: ndsoumah | last post by:
Hello Guys I'm trying to run this query $uneRequete = "SELECT * FROM Usager WHERE motDePasse = {$loginPassword}"; and I get this error message : Error 1054: Unknown column 'xxxx' in WHERE clause..... where 'xxxx' is the content of $loginPassword
8
11066
by: Ward B | last post by:
Greetings all. I'm getting the following error message... Unknown column 'icaodesc' in 'field list' when I try to update a table from a PHP form. What 'field list' is it referring to? My PHP script or the MySQL table???
2
3312
by: Nospam | last post by:
I installed a script that is suppose to accept paypal, however on trying to test a payment, I get this error msg: Error Database access error and I get this error msg emailed to me:
8
3288
by: phillip.s.powell | last post by:
This query produces the following error: I'm sorry but I must have this "column" in the query, it's vital for required sorting order (you have to sort image_location_country in alphanumeric order, however, that column can also be null, BUT all NON-NULL fields MUST BE FIRST before all NULL fields!) I'm not sure what's happening, please help!
2
28201
by: torpecool | last post by:
Hello Everyone, I just ran into this issue, and I am hoping that some of you may be able to help. I am developing a web-based PHP application with a MySQL back-end. I have a testing and a production environment. The only discernable difference between the two is that the testing environment runs MySQL 4.1.14 and the production environment runs 5.0.2.
5
2529
by: Larry in Honolulu | last post by:
I'm getting an error message that makes no sense to me. I have a table with a field named 'testkey' for a list of "keys" in the form of ABC10102. I have a php variable holding a specific key number. The relevant code is - $_testkey = 'LAL10102'; $sql = "SELECT * FROM `pro_keys` WHERE `keynum`=`$_testkey`"; $result=mysql_query($sql,$db_conn); echoing the $sql gives -
4
5694
by: karthikeyanck | last post by:
I'm a newbie, I've installed PHP, Apache and MySQL on my Ubuntu system I've trouble in quering the data from MySQL when using the query function within PHP. I 've created a Database "test", Table "employee", i 've two columns "username" and "password", I've data "admin" and "admin" on both username and the password columns. $u and $p variables has "admin". <?php $query = "SELECT username and password FROM employee WHERE username = $u...
4
10681
tjc0ol
by: tjc0ol | last post by:
Hi guys, I'm a newbie in php and I got error in my index.php which is: 1054 - Unknown column 'p.products_id' in 'on clause' select p.products_image, pd.products_name, p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,...
3
4922
nomad
by: nomad | last post by:
Hello everyone: I new to PHP and I'm reading a book on PHP Bibles 2nd edition. It has to deal with a user-rating system. There are 4 scripts to it. I'm getting an error Unknown column 'quotation' in 'field list' Here is my code rated_display.php <?php
0
9564
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9387
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10148
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10002
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9823
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8822
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2794
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.