0

Hi
I'm working on a website and every thing is going great untill I faced this problem with the editing page!
here is my code :

<?php
session_start();
if(!isset($_SESSION['admin'])){
    echo "Only admin has access to this page";
    header("Refresh: 3;url=login.php");
}else{
    require("inc/config.php");
    require("inc/header.php");
    $id = (int)mysql_real_escape_string($_GET['id']);
    $title = $_GET['title'];
    $describtion = $_GET['describtion'];
    $url = $_GET['url'];
        $status  = $_GET['status'];
      $sql = "SELECT * FROM serv WHERE id=$id";
      $query = mysql_query($sql);
if(empty($title) or empty($describtion) or empty($status)){
    echo "Fill the applecation";
}else{
$sql = 'UPDATE serv SET(title = '".$title."',describtion = '".$describtion."',url = '".$url"',status ='".$status."') WHERE id=$id';
    $query = mysql_query($sql) or die(mysql_error());
}


}
    ?>

This is the error :
Parse error: syntax error, unexpected '"' in /Applications/XAMPP/xamppfiles/htdocs/wasata/admincp/check_edit.php on line 19

2
Contributors
2
Replies
10
Views
3 Years
Discussion Span
Last Post by keloa
1

You missed a dot near $url:

'".$url"'

change it to:

'".$url."'

But you can rewrite it in a cleaner way:

$sql = "UPDATE serv SET title = '$title', description = '$description', url = '$url' WHERE id = $id";

Edited by cereal

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.