php - Catchable fatal error: Object of class mysqli_result could not be converted to string -


i quite new in php , mysql , keep getting error while try delete selected file server:

<?php $nombre_archivo = $_post['delete']; if( isset($_post['submit4']) ){ $con=mysqli_connect("####","####","####","####"); if (mysqli_connect_errno()) { echo "failed connect mysql: " . mysqli_connect_error(); } $user = mysqli_query($con,"select `user` `archivos_servidor` `nombre_archivo`='$nombre_archivo'"); mysqli_close($con); }       unlink("../uploads/".$user."/".$nombre_archivo); ?> 

thank consideration on matter

you missed fetch record. should use one.

$nombre_archivo = $_post['delete']; if( isset($_post['submit4']) ){ $con=mysqli_connect("####","####","####","####"); if (mysqli_connect_errno()) { echo "failed connect mysql: " . mysqli_connect_error(); } $result = mysqli_query($con,"select `user` `archivos_servidor` `nombre_archivo`='$nombre_archivo'");  $row = mysqli_fetch_assoc($result);  $user = $row['user']; mysqli_close($con); }       unlink("../uploads/".$user."/".$nombre_archivo); 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -