I have a mysql table that is connected to xcode via php, Im trying to update a cell using this code, and is returning nothing in the table.
<?php
$conn = mysql_connect($host, $user, $pass);
@mysql_select_db($db) or die("Unable to find database");
$routeID = $_GET["routeID"];
$newComment = $_GET["newComment"];
$query = "UPDATE routes SET comment = '$newComment' WHERE routeID='$routeID'";
mysql_query($query) or die (mysql_error("error"));
mysql_close();
?>
If I changed $routeID
to routeID='routeID'
or routeID=routeID
it would update the entire comment column and add the actual id into it e.g. test?routeID=1
If I changed $routeID
to routeID=1 or 20
etc. it would update the correct row. Any ideas on whats wrong with this.