Hello I'm soon changing to mysqli but for now, what is the problem that the upload script won't allow me to upload pictures to my server. When I press the upload button it says that the file doesn't exist on mamp and on localhost it says that the index.php was not found. Can someone please help me with this problem.
<?php
ini_set('display_error', '1');
// connect to database
mysqli_connect('localhost','root','root') or die (mysqli_error());
mysqli_select_db("Uploader") or die(mysqli_error());
It gives this error (on my MAMP application):
Warning: mysqli_connect(): (HY000/2002): No such file or directory in - on line 18
Warning: mysqli_error() expects exactly 1 parameter, 0 given in - on line 18.
mysqli_select_db
This function should only be used to change the default database for the connection. You can select the default database with 4th parameter in mysqli_connect().
Font: mysqli_select_db function
You should change to:
$link = mysqli_connect("myhost","myuser","mypassw","mybd") or die("Error " . mysqli_error($link));
Font: mysqli_connect function