rinteractive
Members-
Posts
27 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
rinteractive's Achievements
Newbie (1/5)
0
Reputation
-
please anybody help me???? i am running out of my time my boss is scribbllinnng me
-
Its giving error like this Err 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 '' at line 9
-
The above query is running but the table is not updating the record :'(
-
It give error on this line   //Connect to mysql server as un excepted '&'
-
<?php include_once ("functions.php"); include_once ("config.php"); //Start session   //Connect to mysql server   $link = mysql_connect("localhost","root","");   if(!$link) {       die('Failed to connect to server: ' . mysql_error());   }   //Select database   $db = mysql_select_db("project");   if(!$db) {       die("Unable to select database");   }     //Array to store validation errors   //Connect to mysql server     //Sanitize the POST values   $id = CleanVar(h_($_POST['id']));   $fname = CleanVar(h_($_POST['fname']));   $lname = CleanVar(h_($_POST['lname']));   $gender = CleanVar(h_($_POST['gender']));   $day= CleanVar(h_($_POST['day']));   $month = CleanVar(h_($_POST['month']));   $year = CleanVar(h_($_POST['year']));   $country = CleanVar(h_($_POST['country']));   $postalcode = CleanVar(h_($_POST['postalcode']));   $error          =  "N"; //start the update If($error == "N") {   $current_cat_sql = "UPDATE members SET firstname = '".d_($fname)."',                               lastname = '".d_($lname)."',                               gender= '".d_($gender)."',                               day = '".d_($day)."',                               month = '".d_($month)."',                               year = '".d_($year)."',                               country = '".d_($country)."',                               postalcode = '".d_($postalcode)."'                   WHERE member_id = '".d_($id)."'";   mysql_query ($current_cat_sql) or die ("Err".mysql_error()); header("location: register-success.php");       exit; } else { echo "error"; } ?> This is the code i have used
-
i have tired your code it showing error message like this Parse error: syntax error, unexpected '&' in C:\xampp\htdocs\project\admin\PHP-Login\register-edit-action1.php on line 6
-
when i write session_start(); code it given the error message like this Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\project\admin\PHP-Login\register-edit-action1.php:1) in C:\xampp\htdocs\project\admin\PHP-Login\register-edit-action1.php on line 6 Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\project\admin\PHP-Login\register-edit-action1.php:1) in C:\xampp\htdocs\project\admin\PHP-Login\register-edit-action1.php on line 57
-
Thanks Adam i have tired your then also it gives the same error message
-
hey guys , i have changed my code now bt error message is showing please anyone help me???? my code is this <?php include_once ("functions.php"); include_once ("config.php"); //Start session //Connect to mysql server $link = mysql_connect("localhost","root",""); if(!$link) { die('Failed to connect to server: ' . mysql_error()); } //Select database $db = mysql_select_db("project"); if(!$db) { die("Unable to select database"); } //Array to store validation errors //Connect to mysql server //Sanitize the POST values $id = CleanVar(h_($_POST['id'])); $fname = CleanVar(h_($_POST['fname'])); $lname = CleanVar(h_($_POST['lname'])); $gender = CleanVar(h_($_POST['gender'])); $day= CleanVar(h_($_POST['day'])); $month = CleanVar(h_($_POST['month'])); $year = CleanVar(h_($_POST['year'])); $country = CleanVar(h_($_POST['country'])); $postalcode = CleanVar(h_($_POST['postalcode'])); $error = "N"; if ($error == "Y"){ include_once ("register-edit.php"); exit; } else{ $current_cat_sql = "UPDATE members SET firstname = '".d_($fname)."', lastname = '".d_($lname)."', gender= '".d_($gender)."', day = '".d_($day)."', month = '".d_($month)."', year = '".d_($year)."', country = '".d_($country)."', postalcode = '".d_($postalcode)."' WHERE member_id = '".d_($id)."'"; mysql_query ($current_cat_sql) or die ("Err".mysql_error()); } header("location: register-success.php"); exit; ?> The error message is Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\project\admin\PHP-Login\register-edit-action1.php:1) in C:\xampp\htdocs\project\admin\PHP-Login\register-edit-action1.php on line 53 Thanks in Advance
-
hai guys!!!! i am new to php and Mysql , i am trying to edit the user profile bt the table is not updating the records. The coding i have used for updating below: <?php include_once ("functions.php"); include_once ("config.php"); //Start session session_start(); //Array to store validation errors $errmsg_arr = array(); //Validation error flag $errflag = false; //Connect to mysql server //Function to sanitize values received from the form. Prevents SQL injection function clean($str) { if(!get_magic_quotes_gpc()) { $str = @trim(mysql_real_escape_string($str)); } else { return @trim($str); } } //Sanitize the POST values $fname = clean($_POST['fname']); $lname = clean($_POST['lname']); $gender = clean($_POST['gender']); $day= clean($_POST['day']); $month = clean($_POST['month']); $year = clean($_POST['year']); $country = clean($_POST['country']); $postalcode = clean($_POST['postalcode']); $id = Cleanvar($_REQUEST['id']); //Input Validations if($fname == '') { $errmsg_arr[] = 'First name missing'; $errflag = true; } if($lname == '') { $errmsg_arr[] = 'Last name missing'; $errflag = true; } if($gender == '') { $errmsg_arr[] = 'Gender missing'; $errflag = true; } if($day == '') { $errmsg_arr[] = 'Day missing'; $errflag = true; } if($month == '') { $errmsg_arr[] = 'Month missing'; $errflag = true; } if($year == '') { $errmsg_arr[] = 'Year missing'; $errflag = true; } if($country == '') { $errmsg_arr[] = 'Country name missing'; $errflag = true; } if($postalcode == '') { $errmsg_arr[] = 'Postal code missing'; $errflag = true; } //Check for duplicate login ID //If there are input validations, redirect back to the registration form //Create INSERT query $qry = "UPDATE members SET firstname = '$fname' , lastname = '$lname', gender = '$gender', day = '$day', month = '$month', year = '$year', country = '$country' , postalcode = '$postalcode' WHERE member_id = '".d_($id)."'"; $result = mysql_query($qry); //Check whether the query was successful or not if($result) { header("location: register-success.php"); exit(); }else { die("Query failed".mysql_error()); } ?>
-
i am new to php , just i want the difference between session and cookies can any one explain me. Thanks in Advance
-
Thanks Adam my problem is solved now, your code helped me a lot
-
i am new to mysql, table is not creating even there is no error message. The code i have used below. <?php $con = mysql_connect("localhost","root",""); if(!$con) { echo"Connection failed".mysql_error(); } mysql_select_db("project",$con); $sql= "CREATE TABLE `experience` ( `id` int(11) unsigned NOT NULL auto_increment, `years` int(11) NOT NULL, PRIMARY KEY (`id`) ) TYPE=MyISAM"; mysql_query($sql,$con); mysql_close($con); ?> Please any one help me
-
i am new to php and mysql. just i want to display the user id in all the pages when the user is login. i have created the session id for the user, i don't how to display the user id in all pages please any one help me and give the suggestion Thanks in Advance
-
[SOLVED] Retrieving data from mysql table using php
rinteractive replied to rinteractive's topic in PHP Coding Help
Thanks wolfrat my problem is solved. The image is displaying Thanks a lot, your code is very helpful