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

Recommended Answers

All 2 Replies

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";

Thank you man

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.