Adding PHP Code

  • Unknown's avatar

    I’m encountering a fatal error when trying to add PHP code to my website

  • Unknown's avatar


    prepare(“SELECT * FROM new_table WHERE sit_num = ‘$int'”);

    $sth->setFetchMode(PDO:: FETCH_OBJ);
    $sth -> execute();

    if($row = $sth->fetch())
    {
    ?>
    <br><br><br>
    <table>
    <tr>
    <th class=”table1″>Certificate No.</th>
    <th class=”table1″>Full Name</th>
    <th class=”table1″>Course Title</th>
    <th class=”table1″>Date Of Issue</th>
    <th class=”table1″>Trainer</th>
    </tr>
    <tr>
    <td class=”table2″><?php echo $row->sit_num; ?></td>
    <td class=”table2″><?php echo $row->candidate_name; ?></td>
    <td class=”table2″><?php echo $row->course_name; ?></td>
    <td class=”table2″><?php echo $row->date_of_issue; ?></td>
    <td class=”table2″><?php echo $row->trainer; ?></td>
    </tr>
    </table>
    <?php
    }
    else {
    echo “رقم الشهادة غير صحيح، الرجاء التأكد من الرقم وإعادة المحاولة”;
    }
    }
    ?>

  • Unknown's avatar

    You can’t add PHP code to a free wordpress.com website, https://wordpress.com/support/code/

  • Unknown's avatar

    Thank you for your reply,but I’m using elementor pro as a builder, even with that I can’t add the code???

  • @aratccenter, you’re in the wrong forum :). You’re talking about a site using the open-source WordPress software (from WordPress.org) but hosted elsewhere.

    Because WordPress.com and WordPress.org are two entirely separate entities, we cannot access files or data for sites hosted elsewhere; we can only assist with sites hosted on our servers. You can read more about the differences between WordPress.org software and WordPress.com here:
    https://wordpress.com/support/com-vs-org/

    You can look for help at the community forums here: https://wordpress.org/support/forums/.

    http://wordpress.org/support/ is also a great resource for sites using the open-source WordPress.org software.

  • Unknown's avatar

    Thank you for the clarification, I didn’t know about that.

  • The topic ‘Adding PHP Code’ is closed to new replies.