OpenJs mysql not reading database [migrated]
- by Benedikt Wutzi
I try to access a mysql table using OpenJs Grid.
I already doublechecked if the database "partsdb" and the table "parts" exists and it can be accessed from the commandline.
Currently I'm using the must basic example:
members.php:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Members Page</title>
<script>
$(function() {
$(".parts").grid();
});
</script>
</head>
<body>
<div id="container">
<h1>Members Page</h1>
<table action="ajax.php">
<tr>
<th col="id">Id</th>
<th col="name">Name</th>
</tr>
</table>
<a href='<?php echo base_url()."main/logout" ?>'>Logout</a>
</div>
and ajax.php
<?php
mysql_connect("localhost","****","*****");
mysql_select_db("partsdb");
require_once("grid.php");
$grid = new Grid("parts");
?>
When I run php directly on ajax.php I get an error telling me: " Unknown column 'parts.' in 'field list' " and the table shows only the headers.
What am I doing wrong?