Data base not found

Talk about installation process and problems

Moderator: alexandrleonenko

RANTUNES80
Newbie
Newbie
Posts: 4
Joined: Apr 3rd, '14, 16:47

Data base not found

Postby RANTUNES80 » Apr 5th, '14, 04:31

I need some help with my code i receive that error mensage:


+ Add New View Delete

No data found! Please, check carefully your code syntax!
It may be case sensitive or there are some unexpected symbols.


Retrieve data for current mode #2:
select sql (total: 0 | time: 0.0003 sec.) SELECT tbusuarios.id_usuario, tbusuarios.id_regional, tbusuarios.usuario, tbusuarios.matricula, tbusuarios.senha, tbusuarios.fone, tbusuarios.e-mail, tbusuarios.acesso, FROM tbusuarios WHERE 1=1 ORDER BY usuario ASC LIMIT 0, 10

Retrieve data for current mode #2:
select sql (total: 0 | time: 0.0003 sec.) SELECT tbusuarios.id_usuario, tbusuarios.id_regional, tbusuarios.usuario, tbusuarios.matricula, tbusuarios.senha, tbusuarios.fone, tbusuarios.e-mail, tbusuarios.acesso, FROM tbusuarios WHERE 1=1 ORDER BY usuario ASC LIMIT 0, 10

POST:

GET:

FILES:
Array
(
)


Errors:

1) SELECT tbusuarios.id_usuario, tbusuarios.id_regional, tbusuarios.usuario, tbusuarios.matricula, tbusuarios.senha, tbusuarios.fone, tbusuarios.e-mail, tbusuarios.acesso, FROM tbusuarios WHERE 1=1 ORDER BY usuario ASC LIMIT 0, 10
[nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM tbusuarios WHERE 1=1 ORDER BY usuario ASC LIMIT 0, 10' at line 1]

2) SELECT tbusuarios.id_usuario, tbusuarios.id_regional, tbusuarios.usuario, tbusuarios.matricula, tbusuarios.senha, tbusuarios.fone, tbusuarios.e-mail, tbusuarios.acesso, FROM tbusuarios WHERE 1=1 ORDER BY usuario ASC LIMIT 0, 10
[nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM tbusuarios WHERE 1=1 ORDER BY usuario ASC LIMIT 0, 10' at line 1]

3) SELECT tbusuarios.id_usuario, tbusuarios.id_regional, tbusuarios.usuario, tbusuarios.matricula, tbusuarios.senha, tbusuarios.fone, tbusuarios.e-mail, tbusuarios.acesso, FROM tbusuarios WHERE 1=1 ORDER BY usuario ASC LIMIT 0, 10
[nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM tbusuarios WHERE 1=1 ORDER BY usuario ASC LIMIT 0, 10' at line 1]


Warnings:

1) Wrong parameter in [id_usuario]: Check this field carefully, it may be not a Primary Key!

my code:

define("DATAGRID_DIR", "../SIDOF_PGT/datagrid/datagrid/");
require_once(DATAGRID_DIR.'datagrid.class.php');

// includes database connection parameters
include_once('install/config.php');
ob_start();
## *** set needed options
$debug_mode = true;
$messaging = true;
$unique_prefix = "f_";
$dgrid = new DataGrid($debug_mode, $messaging, $unique_prefix);

## *** set data source with needed options
## *** put a primary key on the first place
$sql=" SELECT "
." tbusuarios.id_usuario, "
." tbusuarios.id_regional, "
." tbusuarios.usuario, "
." tbusuarios.matricula, "
." tbusuarios.senha, "
." tbusuarios.fone, "
." tbusuarios.e-mail, "
." tbusuarios.acesso, "
."FROM tbusuarios ";
$default_order = array("usuario"=>"ASC");
$dgrid->DataSource("PEAR", "mysql", $DB_HOST, $DB_NAME, $DB_USER, $DB_PASS, $sql, $default_order);

$dg_caption = '<b>GERENCIAMENTO DE ACESSO DE USUÁRIOS</b>';
$dgrid->SetCaption($dg_caption);

## +---------------------------------------------------------------------------+
## | 6. View Mode Settings: |
## +---------------------------------------------------------------------------+
## *** set columns in view mode
$dgrid->SetAutoColumnsInViewMode(true);

## +---------------------------------------------------------------------------+
## | 7. Add/Edit/Details Mode settings: |
## +---------------------------------------------------------------------------+
## *** set settings for edit/details mode
$table_name = "tbusuarios";
$primary_key = "id_usuario";
$condition = "";
$dgrid->SetTableEdit($table_name, $primary_key, $condition);
$dgrid->SetAutoColumnsInEditMode(true);

## +---------------------------------------------------------------------------+
## | 8. Bind the DataGrid: |
## +---------------------------------------------------------------------------+
## *** set debug mode & messaging options
$dgrid->Bind();
ob_end_flush();

?>



</div> <!--/GRID-->

What's wrong with my code, the primary key is correct.

Can anybody help me?

If it helps
MySQL version with xamp:
Servidor: 127.0.0.1 via TCP/IP
Tipo de servidor: MySQL
Versão do servidor: 5.6.16 - MySQL Community Server (GPL)
Versão do protocolo: 10
Utilizador: root@localhost
Conjunto de caracteres do servidor: UTF-8 Unicode (utf8)
Last edited by RANTUNES80 on Apr 5th, '14, 05:12, edited 1 time in total.

administrator
Site Admin
Site Admin
Posts: 6105
Joined: Jan 7th, '09, 23:18
Contact:

Re: Data base not found

Postby administrator » Apr 6th, '14, 07:41

." tbusuarios.acesso, "
."FROM tbusuarios ";


you have unexpected "," after tbusuarios.acesso

RANTUNES80
Newbie
Newbie
Posts: 4
Joined: Apr 3rd, '14, 16:47

Re: Data base not found

Postby RANTUNES80 » Apr 6th, '14, 18:34

Ok Thanks.
It works!


Return to “Installation”