-1
How to do INSERT correctly? Not inserting !
$id = $_GET['id'];
$queryrun=mysqli_query($conn,"SELECT image_path FROM tbl_image WHERE
id='$id' ");
$row=mysqli_fetch_object($queryrun);
if($row->image_path!== $document)
{
unlink("upload/".$row->image_path);
}
$query = " UPDATE tbl_image SET image_album,image_text =
'$img_album','$img_text',image_path = '$document' where id = '$id' ";
$queryrun = mysqli_query($conn,$query);
$_SESSION['msg'] = "Your Data Updated Successfully";
}
Doubt if the Internet is correct !
$query = " UPDATE tbl_image SET image_album,image_text =
'$img_album','$img_text',image_path = '$document' where id = '$id' ";
Attempt to specify for each value ? same error
$query = "INSERT INTO tbl_image SET image_album,SET image_text =
'$img_album','$img_text',image_path = '$document' ";
Solved in this way
$query = "INSERT INTO tbl_image SET image_album = '$img_album', image_text = '$img_text', image_path = '$document' ";
Any error message appears? see if it shows any:
$queryrun = mysqli_query($conn,$query) or die(mysqli_error($conn);
– rray
no error message and does not insert !
– Carlos Coelho
There is an update there and no Insert ;)
– rray
P each column vc must specify a value, which it does not have at all in its update.
– rray
and how it would be to specify for each value ?
– Carlos Coelho
Thus
$query = "UPDATE tbl_image SET 
 image_album = 'valor',
 image_text = '$img_album',
 '$img_text',image_path = '$document'
 where id = '$id' ";
tested the code of the first comment, returned no error?– rray
tested yes! works like $query = " UPDATE tbl_image SET image_album = '$img_album',image_path = '$Document' Where id = '$id' "; Dae It inserts but I wanted to add one more table
– Carlos Coelho