problem getting TableGear to work

81 views
Skip to first unread message

Wig

unread,
Mar 23, 2011, 12:34:44 PM3/23/11
to TableGear
Im new to tablegear and php. im trying to get tablegear to work but im
gettin an error on my webpage:

Database Error: Database Required.


and a dialog box saying:

TableGear Error: Element 'tgTable' does not exists.


can anyone help me here. I know its a simple problem.

this is the code i used:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /
>
<title>Courses</title>
<script type="text/javascript" src="javascripts/mootools1.3.1.js"></
script>
<script type="text/javascript" src="javascripts/TableGear1.6.1-
MooTools.js"></script>
<link type="text/css" rel="stylesheet" href="stylesheets/
tablegear.css" />
<link type="text/css" href="stylesheets/courses.css"
rel="stylesheet" />
</head>
<body>
<?php
include "adminTabs.php";
include "include/TableGear1.6.1.php";
$tgTable=new TableGear(array("database"=>array("username"=>"root",
"password"=>"",
"database"=>"teacher_assign",
"table"=>"course"),
"editable"=>"all",
"sortable"=>"all"));
?>
<h1>COURSES</h1>
<?php
$tgTable->getTable();
?>

<script type="text/javascript">
new TableGear("tgTable");
</script>
</body>
</html>


can anyone plz help.will be greatly appreciated

Andrew Plummer

unread,
Mar 27, 2011, 11:08:22 PM3/27/11
to tabl...@googlegroups.com
"database required" at it's most simple just means the info for your DB is wrong... username/password/host
Double check that you can login manually however you do it (maybe phpmyadmin?) ... this would most likely affect the table being built as well so that should start working too....

Girish

unread,
May 3, 2011, 5:42:43 AM5/3/11
to TableGear
The issue is simple, in the code

change

$tgTable=new TableGear(array("database"=>array("username"=>"root",

"password"=>"",

"database"=>"teacher_assign",

"table"=>"course"),

"editable"=>"all",

"sortable"=>"all"));


to

$tgTable=new TableGear(array("database"=>array("username"=>"root",

"password"=>"",

"name"=>"teacher_assign",

"table"=>"course"),

"editable"=>"all",

"sortable"=>"all"));

The change was database was changed to name. Andrew can you please
change this in your examples too, please.

Regards
Girish R

Andrew Plummer

unread,
May 11, 2011, 1:05:15 AM5/11/11
to tabl...@googlegroups.com
Thanks for this catch! I updated the example code.

Andrew
Reply all
Reply to author
Forward
0 new messages