Click here to Skip to main content
15,881,852 members
Home / Discussions / Web Development
   

Web Development

 
QuestionMessage Removed Pin
29-Jul-17 13:48
EuroValdes29-Jul-17 13:48 
Generalapp development Pin
Brahm Pratap Rana28-Jul-17 22:12
Brahm Pratap Rana28-Jul-17 22:12 
GeneralRe: app development Pin
Richard MacCutchan28-Jul-17 22:55
mveRichard MacCutchan28-Jul-17 22:55 
QuestionBulk Email web project project Pin
Jassim Rahma21-Jul-17 6:08
Jassim Rahma21-Jul-17 6:08 
QuestionAngularjs 1.5 - multi level tree node inside a drop down list Pin
chandra terli7-Jul-17 9:56
chandra terli7-Jul-17 9:56 
AnswerRe: Angularjs 1.5 - multi level tree node inside a drop down list Pin
Nathan Minier17-Jul-17 1:43
professionalNathan Minier17-Jul-17 1:43 
AnswerRe: Angularjs 1.5 - multi level tree node inside a drop down list Pin
BrunoFaitalaas17-Jul-17 21:41
BrunoFaitalaas17-Jul-17 21:41 
QuestionArray and Sub Array from PHP Pin
Jassim Rahma25-Jun-17 11:50
Jassim Rahma25-Jun-17 11:50 
Hi,

I have the following SQL:
SQL
SELECT customers_address.customer_address_id, address_category.address_category_name, customers_address.address_name,
address_details.address_details_id,
address_details.address_details_text
FROM customers_address
JOIN address_category ON address_category.address_category_id = customers_address.address_category_id
LEFT JOIN address_details ON address_details.customer_address_id = customers_address.customer_address_id
WHERE customer_id = param_customer;

I want to show this output in JSON:
CustomerAddress:
     {
        customer_address_id
        address_category_name
        address_name
     }
     Details:
         {
            address_details_id
            address_details_text
         }

my current php is:
PHP
$mysql_query = $mysql_connection->prepare('CALL sp_populate_customer_addresses(:param_customer)');
$mysql_query->bindParam(':param_customer', $customer_id, PDO::PARAM_STR);
$mysql_query->execute();

if ($mysql_query->rowCount() <= 0) { echo "false"; }
else
{
  $jsonData = array();

  while($mysql_row = $mysql_query->fetch())
  {
      $jsonData[] = $mysql_row;
  }

    echo json_encode($jsonData);
}

Thanks,

Jassim

Technology News @ www.JassimRahma.com

AnswerRe: Array and Sub Array from PHP Pin
Planet Thomas4-Jul-17 1:19
Planet Thomas4-Jul-17 1:19 
QuestionRest API Versioning Pin
Abhinav S22-Jun-17 21:03
Abhinav S22-Jun-17 21:03 
AnswerRe: Rest API Versioning Pin
Richard Deeming23-Jun-17 1:43
mveRichard Deeming23-Jun-17 1:43 
GeneralRe: Rest API Versioning Pin
Abhinav S23-Jun-17 4:52
Abhinav S23-Jun-17 4:52 
QuestionOpen Snippingtool by HTML or by HTA Pin
Member 1326358621-Jun-17 9:58
Member 1326358621-Jun-17 9:58 
QuestionRe: Open Snippingtool by HTML or by HTA Pin
ZurdoDev21-Jun-17 10:25
professionalZurdoDev21-Jun-17 10:25 
AnswerRe: Open Snippingtool by HTML or by HTA Pin
Member 1326358621-Jun-17 11:41
Member 1326358621-Jun-17 11:41 
GeneralRe: Open Snippingtool by HTML or by HTA Pin
ZurdoDev22-Jun-17 1:18
professionalZurdoDev22-Jun-17 1:18 
PraiseRe: Open Snippingtool by HTML or by HTA Pin
Member 1326358622-Jun-17 8:13
Member 1326358622-Jun-17 8:13 
GeneralRe: Open Snippingtool by HTML or by HTA Pin
ZurdoDev22-Jun-17 8:15
professionalZurdoDev22-Jun-17 8:15 
GeneralRe: Open Snippingtool by HTML or by HTA Pin
Richard Deeming22-Jun-17 8:30
mveRichard Deeming22-Jun-17 8:30 
Question" How can add a new TABLE in NOPCOMMERCE? Pin
Member 1283740721-Jun-17 5:30
Member 1283740721-Jun-17 5:30 
AnswerRe: " How can add a new TABLE in NOPCOMMERCE? Pin
Richard MacCutchan21-Jun-17 5:50
mveRichard MacCutchan21-Jun-17 5:50 
QuestionSwitch between angular UI Router tabs with same state and different parameters Pin
NeelamParmar13-Jun-17 20:10
NeelamParmar13-Jun-17 20:10 
QuestionMessage Closed Pin
13-Jun-17 17:46
CheatHacker.com13-Jun-17 17:46 
AnswerRe: How To Get Google Rank In USA Pin
Richard MacCutchan13-Jun-17 21:46
mveRichard MacCutchan13-Jun-17 21:46 
AnswerRe: How To Get Google Rank In USA Pin
camillebo16-Jun-17 13:40
camillebo16-Jun-17 13:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.