Click here to Skip to main content
15,849,328 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
QuestionHow to call a reply forms using php. Pin
Member 1370467720-Mar-18 21:45
Member 1370467720-Mar-18 21:45 
Questiondynamic question in php and mysql Pin
antonio_dsanchez9-Feb-18 11:24
antonio_dsanchez9-Feb-18 11:24 
QuestionGet the html content from a website using php Pin
Joshin Joy17-Dec-17 21:51
Joshin Joy17-Dec-17 21:51 
AnswerRe: Get the html content from a website using php Pin
Jochen Arndt17-Dec-17 23:38
professionalJochen Arndt17-Dec-17 23:38 
GeneralRe: Get the html content from a website using php Pin
Joshin Joy18-Dec-17 21:15
Joshin Joy18-Dec-17 21:15 
GeneralRe: Get the html content from a website using php Pin
Jochen Arndt18-Dec-17 22:02
professionalJochen Arndt18-Dec-17 22:02 
GeneralRe: Get the html content from a website using php Pin
Member 1387615717-Jun-18 21:01
Member 1387615717-Jun-18 21:01 
Questionfunction to display content with php does not work as intended Pin
CHrispho15-Dec-17 10:46
CHrispho15-Dec-17 10:46 
I'm trying to create a generic template for multiple pages by retrieving them in the database but it does not work. My database is properly enable at the top of my page.

PHP
function stmt_query2(){

        $conn = pdo_con();

        $query = '
            SELECT * FROM layout_template as lt 
            INNER JOIN page_layout as pl ON lt.page_layout_id = pl.page_layout_id
            WHERE pl.page_layout_id = 1';

        $result = $heidisql->query($query);

        return $result;
    }

  function item_detail() {

      $output = '';

      $result = stmt_query2();

      while($rows = $result->fetch(PDO::FETCH_ASSOC)) {

          $output .='<div class="row">';

          $output .= '<div class="col-md-3">'
                  . '<a href="#"><img class="img-fluid rounded mb-3 mb-md-0" src="'.$rows["mainsub_layout_img"].'" alt="'.$rows["mainsub_layout_alt"].'"></a>'
                  . '</div>';

          $output .= '<div class="col-md-5">';

          $output .= '<h3>'.$rows["mainsub_layout_heading"].'</h3>';

          $output .= '<p class="sub_description">'.$rows["mainsub_layout_txt"].'</p>';

          $output .='<a class="btn btn-primary" href="#">Read More</a>';

          $output .=' </div>'
                  . '</div>';

          } 

          return $output;

          }


But it work if I did it like that


PHP
$conn = pdo_con();

      $query = '
          SELECT * FROM layout_template as lt 
          INNER JOIN page_layout as pl ON lt.page_layout_id = pl.page_layout_id
          WHERE pl.page_layout_id = 1';

      $result = $heidisql->query($query);

while($rows = $result->fetch(PDO::FETCH_ASSOC)) {

              $output .='<div class="row">';

              $output .= '<div class="col-md-3">'
                      . '<a href="#"><img class="img-fluid rounded mb-3 mb-md-0" src="'.$rows["mainsub_layout_img"].'" alt="'.$rows["mainsub_layout_alt"].'"></a>'
                      . '</div>';

              $output .= '<div class="col-md-5">';

              $output .= '<h3>'.$rows["mainsub_layout_heading"].'</h3>';

              $output .= '<p class="sub_description">'.$rows["mainsub_layout_txt"].'</p>';

              $output .='<a class="btn btn-primary" href="#">Read More</a>';
              $output .='</div></div>';
              
              $output .='<hr>';
              } 

              echo $output;

AnswerRe: function to display content with php does not work as intended Pin
Jochen Arndt17-Dec-17 23:50
professionalJochen Arndt17-Dec-17 23:50 
QuestionChat functionality is not working when SSL is involved Pin
Member 135528281-Dec-17 18:15
Member 135528281-Dec-17 18:15 
AnswerRe: Chat functionality is not working when SSL is involved Pin
jschell5-Dec-17 13:29
jschell5-Dec-17 13:29 
QuestionPHP: using Facebook login SDK returned an error: No URL set! Pin
iucaa19-Nov-17 23:53
iucaa19-Nov-17 23:53 
QuestionPHP Getting Data From Javascript Pin
Valecia_cho23-Oct-17 14:48
Valecia_cho23-Oct-17 14:48 
AnswerRe: PHP Getting Data From Javascript Pin
Richard Deeming24-Oct-17 3:08
mveRichard Deeming24-Oct-17 3:08 
QuestionHow do I Attach acrobat pdf page to email in codeigniter? Pin
Member 1347022217-Oct-17 5:13
Member 1347022217-Oct-17 5:13 
SuggestionRe: TLDR Pin
Richard Deeming17-Oct-17 5:31
mveRichard Deeming17-Oct-17 5:31 
QuestionThinkphp 5.0 query table how the array of how to get rid of a column? And then save it to another table? Pin
micccn14-Oct-17 0:37
micccn14-Oct-17 0:37 
Questionhelp me on my php script Pin
horlartech8-Sep-17 13:03
horlartech8-Sep-17 13:03 
SuggestionRe: help me on my php script Pin
Richard MacCutchan8-Sep-17 20:24
mveRichard MacCutchan8-Sep-17 20:24 
GeneralRe: help me on my php script Pin
horlartech10-Sep-17 3:39
horlartech10-Sep-17 3:39 
GeneralRe: help me on my php script Pin
horlartech10-Sep-17 3:49
horlartech10-Sep-17 3:49 
QuestionRe: help me on my php script Pin
Richard MacCutchan10-Sep-17 5:17
mveRichard MacCutchan10-Sep-17 5:17 
QuestionCall to a member function prepare() on a non-object Pin
Igoussam28-Aug-17 11:56
Igoussam28-Aug-17 11:56 
AnswerRe: Call to a member function prepare() on a non-object Pin
Richard MacCutchan28-Aug-17 22:36
mveRichard MacCutchan28-Aug-17 22:36 
Questionhow to get hard disk Serial Number using php on server side Pin
Lakshmanan Duraisamy27-Jul-17 0:15
Lakshmanan Duraisamy27-Jul-17 0:15 

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.