The serialized output is this and it seems correct for me:
a:2:{i:0;a:2:{s:9:"vdepot_id";s:1:"5";s:11:"vdepot_name";s:24:"Langfristig (Fonds etc.)";}i:1;a:2:{s:9:"vdepot_id";s:1:"6";s:11:"vdepot_name";s:16:"Trading System 1";}}
thanks, now the issue came to my mind. The Problem is that i have the "user_id" in my SQL Selection.
I am getting the user_id with the following code.
//access the wordpress functions require_once('wp-load.php');
$user_id = get_current_user_id();
--> It seems that this won't work when wpdatatables is trying to access the php file when serialized php array is chosen as the input data source type.
Is there a way to get this to work? I need to use the user_id for the sql selection for sure.
Ok I can see your server using HTTPS, so can you pleae try this below.
We are using CURL to get the data from the HTTPs.
Now probably you will need to add some certificate to the plugin file ( depends on your certificate verification) You can find more information on this link.
Like it is said in the link HTTPS requires exchanging and verify the SSL cert which protects the URL so if you hit an HTTPS URL you will receive an error because you aren't handling the security translation.
In file wp-content/plugins/wpdatatables/source/class.wdttools.php around line 147 you will find this line of codes
Hi there,
i am trying to get a wpdatatable with a serialized php array to work but it doesnt.
I am always getting the "Table in data source has no rows." error.
This works fine:
$return_array[] = array(
'vdepot_id' => '1', // Set the ID
'Title' => 'test', // Set the title
'Content preview with link' => 'testcontent'
);
echo serialize( $return_array );
But when trying to create the array with a while loop it doesn't work:
while($row = mysqli_fetch_array($resultvdepots)) {
$vdepotsarray[] = array(
'vdepot_id' => $row['virtuellesdepot_id'],
'vdepot_name' => $row['virtuellesdepot_name']
);
}
echo serialize( $vdepotsarray );
The serialized output is this and it seems correct for me:
a:2:{i:0;a:2:{s:9:"vdepot_id";s:1:"5";s:11:"vdepot_name";s:24:"Langfristig (Fonds etc.)";}i:1;a:2:{s:9:"vdepot_id";s:1:"6";s:11:"vdepot_name";s:16:"Trading System 1";}}
why is wpdatatables not able to read this output?
Regards,
Michael
HI Michael,
Thank you for your purchase.
Can you please check if the output is valid with some validator.
Also tell me are there any errors in the server log.
Best regards.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi,
unserializing works with a validator and there are no erros in the server log. This is the result of the unserialize function.
array (
0 =>
array (
'vdepot_id' => '1',
'vdepot_name' => 'Langfristig (Fonds etc.)',
),
1 =>
array (
'vdepot_id' => '8',
'vdepot_name' => 'Test',
),
)
i guess it has something to do with index array vs associative array...
Regards,
Michael
Hi Michael,
Can you please send me a link of that php script or link of that json file, so I can take a look?
Best regards.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi Michael,
This is what I see when I go to that link. (attachment)
Which maybe can be the case of the issue.
Best regards.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi Bogdan,
thanks, now the issue came to my mind. The Problem is that i have the "user_id" in my SQL Selection.
I am getting the user_id with the following code.
//access the wordpress functions
require_once('wp-load.php');
$user_id = get_current_user_id();
--> It seems that this won't work when wpdatatables is trying to access the php file when serialized php array is chosen as the input data source type.
Is there a way to get this to work? I need to use the user_id for the sql selection for sure.
Regards,
Michael
Hi Michael
Ok I can see your server using HTTPS, so can you pleae try this below.
We are using CURL to get the data from the HTTPs.
Now probably you will need to add some certificate to the plugin file ( depends on your certificate verification) You can find more information on this link.
Like it is said in the link HTTPS requires exchanging and verify the SSL cert which protects the URL so if you hit an HTTPS URL you will receive an error because you aren't handling the security translation.
In file wp-content/plugins/wpdatatables/source/class.wdttools.php around line 147 you will find this line of codes
Probably you will need to add the certification there and everything should work fine.
Best regards.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables