Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8975033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:47:08+00:00 2026-06-15T18:47:08+00:00

I I am getting myself tangled with a pdo statement to display MySQL data

  • 0

I I am getting myself tangled with a pdo statement to display MySQL data in a table using pdo.

my syntax is:

 $startdate=$_POST["start"];
 $enddate=$_POST["end"];
 $ttype=$_POST["ttype"];

$result = $db->query("SELECT cycletype,commenttype,adminstatus FROM v2loads where haulier= :haulier and :start < sarrive and :end> sarrive order by sarrive"); 
$result->bindParam(':haulier', $company, PDO::PARAM_STR); 
$result->bindParam(':start', $startdate, PDO::PARAM_STR); 
$result->bindParam(':end', $enddate, PDO::PARAM_STR); 
$result->execute;

I then try t fetch the output with

<table>
    <? while($row = $jobs->fetch(PDO::FETCH_ASSOC)) {  ?>
      <tr>
        <td>
          <? echo $row['cycletype'];?>
        <td>
        <td>
          <? echo $row['icommenttype];?>
        <td>
        <td>
          <? echo $row['adminstatus'];?>
        <td>
     </tr>
    <?  }  ?>
</table>

This produces error:
Call to a member function bindParam() on a non-object

Any assistance would be appreciated.
Kind Regards,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T18:47:09+00:00Added an answer on June 15, 2026 at 6:47 pm

    This is your script:

        $startdate=$_POST["start"];
        $enddate=$_POST["end"];
        $ttype=$_POST["ttype"];
        $result = $db->query("SELECT cycletype,commenttype,adminstatus FROM v2loads where    haulier= :haulier and :start < sarrive and :end> sarrive order by sarrive"); 
        $result->bindParam(':haulier', $company, PDO::PARAM_STR); 
        $result->bindParam(':start', $startdate, PDO::PARAM_STR); 
        $result->bindParam(':end', $enddate, PDO::PARAM_STR); 
        $result->execute;
    

    Change This To:

      $startdate=$_POST["start"];
      $enddate=$_POST["end"];
      $ttype=$_POST["ttype"];
      $result = $db->prepare("SELECT cycletype,commenttype,adminstatus FROM v2loads where    haulier= :haulier and :start < sarrive and :end> sarrive order by sarrive"); 
      $result->bindParam(':haulier', $company, PDO::PARAM_STR); 
      $result->bindParam(':start', $startdate, PDO::PARAM_STR); 
      $result->bindParam(':end', $enddate, PDO::PARAM_STR); 
      $result->execute;
    

    Then Try:

      <table>
      <? while($row = $result->fetch(PDO::FETCH_ASSOC)) {  ?>
      <tr>
        <td>
          <? echo $row['cycletype'];?>
        <td>
        <td>
          <? echo $row['icommenttype];?>
        <td>
        <td>
          <? echo $row['adminstatus'];?>
        <td>
      </tr>
      <?  }  ?>
     </table>
    

    You have used bindparam on a non object..USE prepare instead of query.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Getting red warning message that expected identifier for this statement CALayer = ImageView.layer; Using
I am getting myself all tangled up where in the nesting. I have a
I'm starting to find myself getting more and more in to using WCF for
just getting myself familiar with jquery, please consider me as a noob for now.
I'm getting myself acquainted with MVC by making a 'for-fun' site in django. I'm
I am getting myself a bit confused about how to go about this. My
getting myself confused with NSString's various range methods and where and when they should
I'm just getting myself to familiarize with GIS but i like to know before
I think I'm getting ahead of myself, but I tried AJAX tutorials to read
Having issues getting myself started on MVC3 Trying to define a simple route here

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.