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 -
-
<?php
-
require_once("../../include/database.php");
-
require_once("../../Functions/user_functions.php");
-
-
$id=$_POST[id];
-
user::GetInfoUser($userid);
-
-
//if form is submitted
-
if(isset($_POST[Submit]))
-
{
-
-
$fullname = mysql_real_escape_string($_POST[fullname]);
-
$gender = mysql_real_escape_string($_POST[gender]);
-
$email = mysql_real_escape_string($_POST[email]);
-
$password = mysql_real_escape_string($_POST[password]);
-
$phone = mysql_real_escape_string($_POST[phone]);
-
$birthday = mysql_real_escape_string($_POST[birthday]);
-
$nationality = mysql_real_escape_string($_POST[nationality]);
-
$address = mysql_real_escape_string($_POST[address]);
-
-
-
user::UpdateUser($id,$fullname,$password,$gender,$email,$birthday,$phone,$address,$nationality);
-
-
-
?>
-
<script language="javascript">
-
alert('User Edited Successfully');
-
location = 'view_users.php';
-
</script>
-
<?php
-
exit;
-
}
-
-
?>
-
-
<html><head>
-
<script type="text/javascript" src="fckeditor/fckeditor.js"></script>
-
<script language="javascript" src="gen_validatorv31.js"></script>
-
<link href="../styles/hstyle.css" rel="stylesheet" type="text/css">
-
<title>Admin main page</title> </head>
-
-
<body> <a href="http://bytes.com/submit/index.php"> Back to home </a></td>
-
-
<p class="big_title1">Editing User</p>
-
<form action="<?php echo $_SERVER[PHP_SELF] ?>" method="post" enctype="multipart/form-data" name="form2">
-
<table width="970" border="0" cellpadding="3" cellspacing="3">
-
<tr>
-
<td width="112">Name</td>
-
<td width="800"><input name="fullname" type="text" class="width1" id="fullname" value="<?php $id=$_GET['id'];
-
$full_name = user::Getfullname($id,&$fullname);
-
echo $full_name; ?>" size="50" /></td>
-
<td > </td>
-
</tr>
-
<tr>
-
<td>Gender</td>
-
<td><input name="gender" type="text" class="width1" id="gender" value="<?php $gender=user::GetGender($id,&$gender); echo $gender ?>" size="5" /></td>
-
</tr>
-
<tr><td>Email</td>
-
<td><input name="email" type="text" class="width1" id="email" value="<?php $email=user::GetEmail($id,&$email); echo $email; ?>" size="50" /></td>
-
<td> </td>
-
</tr>
-
<tr><td>Password</td>
-
<td><input name="password" type="text" class="width1" id="password" value="<?php $password=user::GetPassword($id,&$password);
-
echo $password; ?>" size="20" /></td>
-
<td> </td>
-
</tr>
-
<tr><td>Birthday</td>
-
<td><input name=" birthday" type="text" class="width1" id=" birthday" value="<?php $birthday=user::GetBirthday($id,&$birthday);
-
echo $birthday; ?>" size="7" /></td>
-
<td> </td>
-
</tr>
-
<tr>
-
<td>Phone</td>
-
<td><input name="phone" type="text" class="width1" id="phone" value="<?php $phone=user::GetPhone($id,&$phone); echo $phone; ?>" /></td>
-
<td> </td>
-
</tr>
-
<tr>
-
<td>Address</td>
-
<td><input name="address" type="text" class="width1" id="address" value="<?php $address=user::GetAddress($id,&$address); echo $address; ?>" /></td>
-
<td> </td>
-
</tr>
-
<tr>
-
<td>Nationality</td>
-
<td><input name="nationality" type="text" class="width1" id="nationality"
-
value="<?php $nationatlity=user::GetNationality($id,&$nationality); echo $nationality; ?>" /></td>
-
<td> </td>
-
</tr>
-
<tr>
-
<td colspan="3"> </td>
-
</tr>
-
<tr>
-
<td><input type="submit" name="Submit" value="Edit Users" /></td>
-
<td>
-
-
<div align="left">
-
<input name="id" type="hidden" id="id" value="<?php echo $_GET['id'] ;?>" />
-
-
</div></td>
-
<td> </td>
-
</tr>
-
</table>
-
</form>
-
-
<script language="JavaScript" type="text/javascript">
-
var frmvalidator = new Validator("form2");
-
frmvalidator.addValidation("nametxt","req","Please enter a name");
-
-
-
</script>
-
<p> </p>
-
</body>
-
</html>
-
and this is the code of the user_functions.php: -
<?php
-
class user {
-
function DeleteUser($id){
-
mysql_query("DELETE FROM `users` WHERE user_id = $id");
-
}
-
-
function GetInfoUser($userid){
-
$GetQuery = "SELECT * FROM users WHERE user_id='$userid'";
-
$GetResult = mysql_query($GetQuery);
-
$row = mysql_fetch_array($GetResult);
-
}
-
-
function Getfullname($userid,&$full_name){
-
$GetQuery = "SELECT * FROM users WHERE user_id='$userid'";
-
$GetResult = mysql_query($GetQuery);
-
$row = mysql_fetch_array($GetResult);
-
$full_name = $row[full_name];
-
return $full_name;
-
}
-
-
function GetGender($userid,&$gender){
-
$GetQuery = "SELECT * FROM users WHERE user_id='$userid'";
-
$GetResult = mysql_query($GetQuery);
-
$row = mysql_fetch_array($GetResult);
-
$gender = $row[gender];
-
return $gender;
-
}
-
-
function GetEmail($userid,&$email){
-
$GetQuery = "SELECT * FROM users WHERE user_id='$userid'";
-
$GetResult = mysql_query($GetQuery);
-
$row = mysql_fetch_array($GetResult);
-
$email = $row[email];
-
return $email;
-
}
-
-
function GetPassword($userid,&$password){
-
$GetQuery = "SELECT * FROM users WHERE user_id='$userid'";
-
$GetResult = mysql_query($GetQuery);
-
$row = mysql_fetch_array($GetResult);
-
$password = $row[password];
-
return $password;
-
}
-
-
function GetBirthday($userid,&$birthday){
-
$GetQuery = "SELECT * FROM users WHERE user_id='$userid'";
-
$GetResult = mysql_query($GetQuery);
-
$row = mysql_fetch_array($GetResult);
-
$birthday = $row[birthday];
-
return $birthday;
-
}
-
-
function GetPhone($userid,&$phone){
-
$GetQuery = "SELECT * FROM users WHERE user_id='$userid'";
-
$GetResult = mysql_query($GetQuery);
-
$row = mysql_fetch_array($GetResult);
-
$phone = $row[phone];
-
return $phone;
-
}
-
-
function GetAddress($userid,&$address){
-
$GetQuery = "SELECT * FROM users WHERE user_id='$userid'";
-
$GetResult = mysql_query($GetQuery);
-
$row = mysql_fetch_array($GetResult);
-
$address = $row[address];
-
return $address;
-
}
-
-
function GetNationality($userid,&$nationality){
-
$GetQuery = "SELECT * FROM users WHERE user_id='$userid'";
-
$GetResult = mysql_query($GetQuery);
-
$row = mysql_fetch_array($GetResult);
-
$nationality = $row[nationality];
-
return $nationality;
-
}
-
-
-
function UpdateUser($id,$full_name,$password,$gender,$email,$birthday,$phone,$address,$nationality){
-
$UpdateUser_Query = 'UPDATE `tours` SET `full_name` = "'.$full_name.'" , `password` = "'.$password.'" , `gender` = "'.$gender.'" ,
-
`email` = "'.$email.'" , `birthday` = "'.$birthday.'" , `phone` = "'.$phone.'" , `address` = "'.$address.'"
-
WHERE `tours`.`tour_id` ="' .$id.'"' ;
-
mysql_query($UpdateUser_Query) or die(mysql_error());
-
}}
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
1 7228 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'.
Sign in to post your reply or Sign up for a free account.
Similar topics |
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
|
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???
|
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:
|
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...
|
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...
| |
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`";...
|
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...
|
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,...
|
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
|
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...
|
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...
| |
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...
|
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...
|
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...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |