im getting unexpected '$sql' when I run this code.. and idont know why..

<?php
include('connect/connection.php');
if(isset($_POST['pid2']))
{

    $pid = $_POST['pid2'];
    $name = $_POST['name']


$sql="INSERT INTO tbl_wishlist (prod_id, name)
    (select prod_id, image from tbl_product where prod_id ='$pid' AND image ='$name' )";


}else{ echo 'mali';}
mysql_close();

?>

Recommended Answers

All 2 Replies

Member Avatar for diafol

Place a semicolon at the end of:

$name = $_POST['name']
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.