2015-01-15, 03:19 AM
I am having problem with some code I found and wondered if anyone could help me get the code working. I had it working on test website on my computer but when I moved it to the hosted website (Yes I changed the MySQL info) When you try and enter the name it will put up with the error. I have check the MySQL info over and couldn't find anything wrong. Can you help?
Fatal error: Call to undefined function mysqli_connect() in /home/rejectedmc/public_html/changeavatar.php on line 16
<?php
$mysqlhost = "";
$mysqluser = "";
$mysqlpass = "";
$mysqldb = "";
$FUTC = $_POST['FUTC'];
$SA = $_POST['setavatar'];
$avatarcon=mysqli_connect($mysqlhost,$mysqluser,$mysqlpass,$mysqldb);
if (mysqli_connect_errno()) {
throw new Exception(mysqli_connect_error(), mysqli_connect_errno());
}
$img = "avatar.php?user=".$SA;
mysqli_query($avatarcon,"UPDATE mybb_users SET avatar='$img' WHERE username='$FUTC'");
echo 'Redirecting To Home Page<br>';
echo '<br>Image: <a href='.$img.'><img src='.$img.'></img></a>';
mysqli_close($avatarcon);
echo '<meta http-equiv="refresh" content="0; url=usercp.php" />';
?>