Page 1 of 1

Could not retrieve table name from page URL

Posted: 2022-11-12 04:59
by rpierce
Hi Again,

I am working on creating a dashboard that updates according to a Project selected from the database. I have this working great on my local machine using XAMPP. When I upload to my server it conks out. In the Chrome console I receive the Subject error:
Could not retrieve table name from page URL
When I go to the Source in Chrome I get the following:
AppGini.currentTableName = function() {
// retrieve current table name from page URL
var tables = location.href.match(/\/([a-zA-Z0-9_]+)_view\.php/);
if(undefined == tables || undefined == tables.length || undefined == tables[1]) {
console.warn('AppGini.currentTableName: Could not retrieve table name from page URL');
return false;
}
Please help if you can!

Ray

Re: Could not retrieve table name from page URL

Posted: 2022-11-12 11:49
by pbottcher
Hi Ray,

this is actually just a warning that you can ignore, unless you need the Tablename in a script.

Re: Could not retrieve table name from page URL

Posted: 2022-11-12 22:19
by rpierce
Ohh, that makes sense, because I see that I'm getting the same warning on the XAMPP system. But on the XAMPP system the Google Charts appear in spite of the error. Do you have any ideas on why the charts don't appear on my server? I have show errors turned on for PHP but get none. I initially thought it was a PHP issue, but seem to have ruled that out. It's a puzzle to me.

Ray

Re: Could not retrieve table name from page URL

Posted: 2022-11-13 09:19
by pbottcher
This is more difficult to catch as we dont have any further information.
- did you check your database is set up the same as on xampp
- did you check that all the field definitions are set up correctly (rebuild fields)
- can you trace in the browser console the call that should show the Google Charts / provide the data if you do it async

Re: Could not retrieve table name from page URL

Posted: 2022-11-14 17:23
by rpierce
Pascal,

- I copied the database from the server and imported it to xampp when I began the google chart project. I did all the work to get it operational on xampp. Once it was working I ftp'd all the files to the server. Initially I got errors saying something to the effect of, "column cannot be of type 'string'". I can see that for some reason on the server the query is returning strings. Even fields that are int in the database structure. The main numeric value I am working with for the chart is derived from a Count() function, which as I understand it from reading on the internet, always returns an Integer. But my query shows it as a string.

- When I compare the structure of the tables in question, all the fields definitions are identical

- When I go to the browser console I only get the error message first mentioned in this message string. The var_dump() shows the data is in the variable but everything is in a string.

If there is any other information you need to help decipher this, just ask I can email it to you.

Thanks as always,
Ray

Re: Could not retrieve table name from page URL

Posted: 2022-11-17 21:34
by pbottcher
Hi Ray,

can you cast the result of your query (if you know that it must be an integer you may use (int), or (float) for a decimal response).