Jump to content

Problem with php/database


hasek522

Recommended Posts

Are there any flaws with the sql UPDATE statement below?  I believe all my other code is working fine and there is just a problem with the sql statement below.  Any help would be greatly appreciated.

 

 

$sql = "UPDATE pictures SET

file_name ='". $_POST['filename']."', description='". $_POST['description']."'

  WHERE id ='". $_POST['picid']. "';";

 

 

Link to comment
https://forums.phpfreaks.com/topic/113855-problem-with-phpdatabase/
Share on other sites

why not make sure you have a error check on the query?

<?php
$sql = "UPDATE pictures SET
          file_name ='". $_POST['filename']."', description='". $_POST['description']."'
           WHERE id ='". $_POST['picid']. "';";
$r = mysql_query($sql) or die(mysql_error()."<br /><br />".$sql);
?.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.