Jump to content

rinteractive

Members
  • Posts

    27
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

rinteractive's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. please anybody help me???? i am running out of my time my boss is scribbllinnng me
  2. 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
  3. The above query is running but the table is not updating the record :'(
  4. It give error on this line   //Connect to mysql server as un excepted '&'
  5. <?php include_once ("functions.php"); include_once ("config.php"); //Start session &#160; //Connect to mysql server &#160; $link = mysql_connect("localhost","root",""); &#160; if(!$link) { &#160; &#160; &#160; die('Failed to connect to server: ' . mysql_error()); &#160; } &#160; //Select database &#160; $db = mysql_select_db("project"); &#160; if(!$db) { &#160; &#160; &#160; die("Unable to select database"); &#160; } &#160; &#160; //Array to store validation errors &#160; //Connect to mysql server &#160; &#160; //Sanitize the POST values &#160; $id = CleanVar(h_($_POST['id'])); &#160; $fname = CleanVar(h_($_POST['fname'])); &#160; $lname = CleanVar(h_($_POST['lname'])); &#160; $gender = CleanVar(h_($_POST['gender'])); &#160; $day= CleanVar(h_($_POST['day'])); &#160; $month = CleanVar(h_($_POST['month'])); &#160; $year = CleanVar(h_($_POST['year'])); &#160; $country = CleanVar(h_($_POST['country'])); &#160; $postalcode = CleanVar(h_($_POST['postalcode'])); &#160; $error&#160; &#160; &#160; &#160; &#160; =&#160; "N"; //start the update If($error == "N") { &#160; $current_cat_sql = "UPDATE members SET firstname = '".d_($fname)."', &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; lastname = '".d_($lname)."', &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; gender= '".d_($gender)."', &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; day = '".d_($day)."', &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; month = '".d_($month)."', &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; year = '".d_($year)."', &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; country = '".d_($country)."', &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; postalcode = '".d_($postalcode)."' &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; WHERE member_id = '".d_($id)."'"; &#160; mysql_query ($current_cat_sql) or die ("Err".mysql_error()); header("location: register-success.php"); &#160; &#160; &#160; exit; } else { echo "error"; } ?> This is the code i have used
  6. 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
  7. 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
  8. Thanks Adam i have tired your then also it gives the same error message
  9. 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
  10. 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()); } ?>
  11. i am new to php , just i want the difference between session and cookies can any one explain me. Thanks in Advance
  12. Thanks Adam my problem is solved now, your code helped me a lot
  13. 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
  14. 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
  15. Thanks wolfrat my problem is solved. The image is displaying Thanks a lot, your code is very helpful
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.