Ability to convert a SQL query into PHP, ASP, HTML, PHP, Java, Javascript
-
AdminDevart (_, Devart) commented
I need my queries JSON encoded. Is there any option to do this in MySQL query builder?
The case is that I am not able to use the query created by your software directly on my website as the syntax is different. The syntax is unknown to me.
You software produce the wanted result with below query:
*****
SELECT
component.percentage,
component.ingredient,
PlanetsPride_Dictionary.ENG
FROM PlanetsPride_Dictionary
INNER JOIN component
ON PlanetsPride_Dictionary.id = component.ingredient
WHERE component.user = '814'
AND component.name = '3303'
//variables substituted with values//
*****
*****
But my site requires it in a syntax like below (not working):
$query
->SELECT (ARRAY('component.percentage', 'component.ingredient', 'PlanetsPride_Dictionary.ENG'))
->FROM ('PlanetsPride_Dictionary')
->JOIN ('INNER', $myDb->quote('component'))
->ON ('PlanetsPride_Dictionary.id = ' . $myDb->quote('component.ingredient'))
->WHERE ('component.user = ' . $myDb->quote($userID) . ' AND ' . $myDb->quote('component.name') . ' = ' . $myDb->quote($thisname));
*****
Is there any option for your software to wrap/syntax the query in this format - whatever format that might be?
*****
Furthermore you query gives me the result of an array/without including "array" or #number/letters attached - e.g:
My other source of support suggest something like this (not working):
$query
->select(array(' c.percentage', ' d.eng'))
->from($myDb->quoteName('#__content', 'c'))
->join('INNER', $db->quoteName('#__dictionary', 'd') . ' ON (' . $db->quoteName('c.ingredient') . ' = ' . $myDb->quoteName('b.id') . ')')
->where('user = ' . $myDb->quote($userID) . ' AND name = ' . $myDb->quote($thisname));
*****