PDA

View Full Version : no mysql update


songboy
11-20-2009, 02:40 PM
This code keeps registering an error:

$fileName = addslashes($fileName);
$filePath = addslashes($filePath);

$query = ("UPDATE writer_photo SET writer_photo_file = '$filePath' WHERE user_name = '$logname')");
$result = mysqli_query($cxn, $query) or die('Error, query failed');
include("the_next_form.php");
exit();

I'm surprised because it works for INSERT INTO. I've also used the same UPDATE code elsewhere - that works fine.
The only thing that might make a difference is that I'm trying to update a file name and file path ($filePath). I have found out that you can't repopulate a html form field with file data but I would be surprised if you could not update file data in mysql. Everything echoes out all the way down. The UPDATE just won't make the swap. Is there a side issue about updating file data that I don't know about.
Even a nudge in the right direction would be much appreciated.
Thanks - Songboy.

songboy
11-20-2009, 10:50 PM
I found it - the bracket after $logname (shouldn't be there).
On we go !