(Shows errror upload failed after i have uploaded some other files)
Other Information
(So, i made this photo sharing website, where you can sign in and share photos. The problem is when i upload a few photos the mysgl insert into database failed error kicks in just like that. I need help guys)
File hosting or File Sharing is not allowed in infinityfree and your account will be suspended by admin if you violate it.
Please refer the ToS Terms of Service - InfinityFree
@anon77371365 Couldnât you say why youâve listed these content? For who doesnât have read ToS itâll be a bit of non-sence, Address to the Terms of service and which .No youâve taken it from next time!
@simon12345 We do not allow file sharing/hosting, if you want you can use Image hosting APIâs to host their images when they press upload button, otherwise you cannot host this content with us.
Couldnât you say why youâve listed these content? For who doesnât have read ToS itâll be a bit of non-sence, Address to the Terms of service and which .No youâve taken it from next time!
$upload = mysqli_query($link,âINSERT INTO photos VALUES($i,â$nameâ,â$width x $heightâ,â$imagepathâ,â$sizeâ,â$usernameâ,â$categoryâ, â$useremailâ,0,0)â) or die(âCouldnât upload.â);
Just FYI: file sharing sites are not allowed on premium hosting either. The terms of service are not different between free and premium hosting, the only difference is how strictly they are enforced.
As for your issue, it would help a lot if you could get the actual error message from the database query. Right now, you only know if it breaks, but not why it breaks.
You can do that by changing your code like so:
$upload = mysqli_query($link,"INSERT INTO photos VALUES($i,'$name','$width x $height','$imagepath,'$size','$username','$category', '$useremail',0,0)");
if ($upload === false) {
die("Couldn't upload: ".mysqli_error($link));
}