-3

I get this error: Parse error: syntax error, unexpected 'mysqli_set_charset' (T_STRING) in /home/csgoxdne/public_html/set.php on line 4

Here is the code:

<?php
$mysqli = new mysqli("localhost:3306", "csgoxdnet", "secretpassword");
  if ($mysqli->error) print ("Error connecting! Message: ".$mysqli->error) 
mysqli_set_charset($mysqli, 'utf8');

function fetchinfo($rowname,$tablename,$finder,$findervalue)
  {($finder == "1");
      $query ="SELECT * FROM $tablename WHERE rowname = '$rowname'";
      $result = mysqli_query($mysqli, $query); 
}
else
    {
         $query = "SELECT * FROM $tablename WHERE `$finder`='$findervalue'"
         if (!$query)   {die    ('Invalid query: '.$mysqli->error)}
         $result = mysqli_query($mysqli, $query);
 }
 return $result;

I honestly can't fix the error. Thanks for the help in advance.

Matias K.
  • 37
  • 10

1 Answers1

-3

use this way

$mysqli->query("SET CHARACTER SET utf8");
Sahil Manchal
  • 472
  • 6
  • 20