-2

I want to display the table categories with PHP code, but displays the error:

Parse error: syntax error, unexpected end of file in W:\domains\test.ru\index.php on line 15.

What to do?

CODE:

<?php

$connection = mysqli_connect('127.0.0.1', 'root', '19912005', 'test_bd');

if($connection = false){
    echo 'Не удалось подключится к БД!';
    exit();

$result = msqli_qery($connection, "SELECT * FROM `categories`");

$r1 = mysqli_fetch_assoc($result);

print_r($r1);

?>
Adrita Sharma
  • 21,581
  • 10
  • 69
  • 79
sswwss
  • 13
  • 2

1 Answers1

-1

put the code below inside your codes, it is going to work

if($connection = false){
    echo 'Не удалось подключится к БД!';
    exit();
 }
  • When the answer is "add one missing curly brace", there is no need to answer. Just leave a comment under the question and flag/vote to close as Off-topic: Typo. This page will be quickly scrubbed from the site (as will any upvote points you receive) because this page is completely useless to researchers. See: [Should one advise on off topic questions?](//meta.stackoverflow.com/q/276572/1768232). – John Conde May 12 '19 at 12:07