Failed to load resource: the server responded with a status

The log contains the next record

It seems you are using wrong name of table (or current user just has not access for that table)

[code]<?php
require("…/codebase/connector/grid_connector.php");
$res=mysql_connect(“HOSTNAME”,“USERNAME”,“PASSWORD”);
mysql_select_db(“429406_myccalgary”);

$conn = new GridConnector($res,“MySQL”);
$conn->render_table(“mygridc”,“id”,“fname,fstatus,ftype,femail,fphone,fmobile,faddress,fproduct,fdimensions,fscb,fscf,finstalled,flast,next”);
?>[/code]

I know, “mygridc” (table name) and “id” (primary id) are not correct, I don’t know where to find them. Where can I find them?

Thanks!

Hi any update on this? I don’t know where to find the two things I need for this to work

I’m not sure what is the problem.
As you are loading data from some table you know its name, right ?

Hi,

Hope your new year is going well!

The problem is that I don’t know the name, I’m beginning to think we aren’t trying to so the se thing lol

I don’t have a table already made, I want this to create a table I guess?

Do I need to create an SQL file with information and give it a name?

$conn = new GridConnector($res,"MySQL"); $conn->render_table("mygridc","id","fname,fstatus,ftype,femail,fphone,fmobile,faddress,fproduct,fdimensions,fscb,fscf,finstalled,flast,next"); ?>

Okay so I’m following a little now, this is trying to find a table but can’t because there isn’t a table, so I have to make one? I thought that was what the database is though, isn’t this supposes to create the table and record the values into the database?

I love this product, I’m just new to SQL, and relatively new with PHP, so I apologize for not being clear but I’m just trying to figure this out!

Thanks

Connector works with already created table ( it will not create any structures on its own )

So you need to create a table (mygridc) with all fields that you are using in the connector’s config.

So when I write “mygrid = myLayout.cells(“a”).attachGrid();”, that is the table name?

What about the ID?

This is what I mean, I don’t know what to do with these values.

This is my table:

// initializing and loading grid mygrid = myLayout.cells("a").attachGrid(); mygrid.setImagePath("../codebase/skins/web/imgs/"); mygrid.setHeader("Client Name/Title,Status,Type,Contact Information,#cspan,#cspan,Address,Product,#cspan,Service Cost,#cspan,Date (MM/DD/YYYY),#cspan,#cspan"); mygrid.attachHeader("#text_filter,#select_filter_strict,#select_filter_strict,Email Address,Phone,Mobile,#text_filter,#select_filter_strict,Dimensions,Basic,Full,Installed On,Last Service,Next Contact"); mygrid.setColumnIds("fname,fstatus,ftype,femail,fphone,fmobile,faddress,fproduct,fdimensions,fscb,fscf,finstalled,flast,fnext"); mygrid.setInitWidths("140,80,80,200,90,90,220,100,90,50,50,100,100,100") mygrid.setColAlign("left,left,left,left,left,left,left,left,center,right,right,right,right,right") mygrid.setColSorting("str,str,str,str,int,int,str,str,str,int,int,date,date,date") mygrid.setColTypes("edtxt,context,context,edtxt,edn,edn,edtxt,context,edtxt,price,price,edtxt,edtxt,edtxt"); mygrid.attachEvent("onKeyPress",onKeyPressed); mygrid.enableTooltips("true,true,true,true,true,true,true,true,true,true,true,true,true,true"); mygrid.enableStableSorting(true); mygrid.forceLabelSelection(true); mygrid.enableEditEvents(false,false,false);

What other table do I make? I haven’t seen anything in the examples that different from what I’m doing?

The client side code doesn’t is fully separated from the server side.
The only line on client side which is important

grid.load(“some.php”)

which will instruct grid to call some.php and use it response as data feed.
On server side, you have some.php which doesn’t related to any client side code it just generates data feed from some table in the DB. So in context of some.php, table name is name of table in the database.

If you have few different grid’s on client side you need to have a few separate server side scripts with different configurations.

Okay, so the table name is the name of the table in the database!

Thanks!

Where do I find the ID though?

If you mean the second parameter in the render command - that is name of id field in the datatable ( it is not related to the client side code either )

You can use any field in a table which is unique for each record.

[code]<?php
require("…/codebase/connector/grid_connector.php");
$res=mysql_connect(“BLANK”,“BLANK”,“BLANK”);
mysql_select_db(“429406_myccalgary”);

$conn = new GridConnector($res,"MySQL");
$conn->render_table("429406_myccalgary","id","fname,fstatus,ftype,femail,fphone,fmobile,faddress,fproduct,fdimensions,fscb,fscf,finstalled,flast,fnext");

?>[/code]

So the name is my database name, and the ID can be whatever I want??

Like this?

	$conn->render_table("429406_myccalgary","345","fname,fstatus,ftype,femail,fphone,fmobile,faddress,fproduct,fdimensions,fscb,fscf,finstalled,flast,fnext");

ID is name of some field in this table.
So you can’t use name of any field from the table, not just any random alphanumeric value.

Thank you for answering me, but I’m not understanding what this is and I don’t know where to find out.

I understand that the NAME value is whatever I named my database, that the ID value is “some value in the database”, and that neither are in the PHP code.

After 3 months of trying to figure this out, you’ve now told me where the NAME value comes from, so where do I find the this value in the database that tells me what the ID is?

Thanks!