A
A
Alexander Stepanov2017-09-01 13:14:47
css
Alexander Stepanov, 2017-09-01 13:14:47

How to make the correct query to the database?

Greetings! How to make the correct query to the database? Writes I can not execute the query, because it cannot find the table. What am I doing wrong? Help please)
Code:

<?php

  ini_set('error_reporting', E_ALL);
  ini_set('display_errors', 1);
  ini_set('display_startup_errors', 1);

  $real_psw   = 'mercury';
  $salt       = strrev($real_psw).strtolower($real_psw).sha1($real_psw);
  $psw_to_db  = crypt($real_psw, $salt);
  
  $dbName = $_SERVER["DOCUMENT_ROOT"] . "/PrizivClient123.mdb";
  
  if (!file_exists($dbName)) {
    die("Could not find database file.");
  }
                                                                                  
  try {
    $db = new PDO("odbc:DRIVER={Microsoft Access Driver (*.mdb)};DBQ=$dbName;Pwd=$psw_to_db");
    $db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ); 
  }
  catch (PDOException $e) {
    echo $e->getMessage();
  }
  
  $sql = "SELECT COUNT(*) FROM Призывники";
  
  $result = $db->query($sql);
  $row = $result->fetch();

  var_dump($row);


?>

Base at the link: rgho.st/private/6KKhR8DLc/1aedf9edddd0b6f5cb14744c...
password: vadbiz
Please help!

Answer the question

In order to leave comments, you need to log in

6 answer(s)
S
svetlov97, 2019-05-12
@svetlov97

transform: rotate(-90deg);

V
Valeriu Vodnicear, 2019-05-12
@vodnicear

https://developer.mozilla.org/en-US/docs/Web/CSS/t...
transform: rotate(90deg)

S
Shohruh Shaimardonov, 2019-05-12
@joeberetta

<div>
<p>Some Text</p>
</div>

div {
  display: inline-block;
  transform: rotate(-90deg);
}

div p {
  font-weight: bold;
}

S
survivor2005, 2019-05-12
@survivor2005

This question could be googled

R
Roman Chuvilev, 2019-05-12
@FrontEndTarot

More verbose, but IMHO
more structurally correct (look at the behavior of blocks).

A
Artyom Karetnikov, 2017-09-01
@zloycoder

From all that I see, I strongly advise against calling tables by Russian names. From what I read in the comments - it looks like the problem is there. Because no matter what data is there in the table itself, select count(*) from Conscripts would return something if there is data. Naming tables, queries and procedures with Russian names, placing the database in paths with Russian names... There are subtle glitches.
Conclusion? Rename the table to at least Prisivnyk and try select count(*) from Prisivnyk

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question