Why doesn't this php/mysql code work?

yogibear7

New member
What I'm trying to have it do is add the users name under the camera column BUT, if a users name is already there, I want it to add a comma and then add the news users name. I've tried the code below, but it does not work. Any suggestions?

<?php
$con = mysql_connect("site","username","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}

mysql_select_db("database", $con);

if ($row['shoot'] = "") {
mysql_query("UPDATE shoots SET camera = CONCAT(camera, '$_POST[camera]') WHERE shoot = '$_POST[shoot]'");
}
else {
mysql_query("UPDATE shoots SET camera = CONCAT(camera, '$_POST[camera]') WHERE shoot = ', $_POST[shoot]'");
}

mysql_close($con)
?>
 
Back
Top