1

I can't find out what I'm doing wrong here. I'm just trying to insert a value into a field. the value consists of text,numbers and # characters. There are no errors or nothing, also nothing is inserted.. Here is the php:

$dbc = mysqli_connect(DBHOST,DBUSER,DBPW);
if (!$dbc) {
die("Database connection failed: " . mysqli_error($dbc));
exit();
}

$dbs = mysqli_select_db($dbc, DBNAME);
if (!$dbs) {
die("Database selection failed: " . mysqli_error($dbc));
exit(); 
}
mysqli_set_charset($dbc, 'utf8');

$reportdata = mysqli_real_escape_string($dbc, $_GET['reportdata']);

$query = "INSERT INTO `onwordreports`(`reportdata`) VALUES ('$reportdata')";

$result = mysqli_query($dbc, $query or trigger_error("Veri yükleme başarısız: " . mysqli_error($dbc)));

echo $result;

mysqli_close($dbc);

Thanks.

1
  • Turn on error reporting. Commented Apr 6, 2016 at 13:28

1 Answer 1

2

Closing ) issue

$result = mysqli_query($dbc, $query) or trigger_error("Veri yükleme başarısız: " . mysqli_error($dbc));
                                ^^^^^// close it here instead of last
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.