I have been having problems with this code and i cant find out why
I am trying to add a new element to an array. it says it goes throu butwhen i check its empty:

$sql="UPDATE $title SET arole = CONCAT_WS(',', arole, '$name')
WHERE op = '$name'";

if (!mysql_query($sql,$con))
{
    die('Error: ' . mysql_error());
}
else
{
    echo "Point Placed<br>";
    echo "<a href='index.php'>Return to Login</a>";
}

Put this temporary debug code on line 3:

die("UPDATE $title SET arole = CONCAT_WS(',', arole, '$name') WHERE op = '$name'";);

Your query will get displayed with actual values. Copy it to the SQL window of phpmyadmin and see what you get when you run it. If there are errors you will get error messages there that will help you solving the problem.

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.