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 8768041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:58:17+00:00 2026-06-13T16:58:17+00:00

what am i doing wrong here! i want to display all data that is

  • 0

what am i doing wrong here! i want to display all data that is associated with a specific client id

EX user inputs “2”

all rows that has client_id “2” will be displayed

<?php

if($_POST['submit'] == "submit"){
   $username="xxx_admin";
   $password="xxx";
   $database="xxx_database";

//connect to mysql server
                $mysqli = new mysqli("localhost", $username, $password, $database);

                                        //check if any connection error was encountered
                                        if(mysqli_connect_errno()) {
                                            printf("Connect failed: %s\n", mysqli_connect_error());
                                            exit;
                                        }   
   $client_id = $_POST['client_id'];
   echo $client_id;
  $query = "select * from messages where client_id='$client_id'";
  $result = mysqli_query($query);
  $class_p = "timeling";
  $clid_p = "oldupdate";
  echo "<ol id=".$clid_p." class=".$class_p.">";echo $row->message;
                                        while ($row = $result->fetch_object())
                                        {
                                                // set up a row for each record
                                                echo "<li>";
                                                echo $row->message;
                                                echo "<br>" . $row->date_post;
                                                echo "</li>";
                                        }

    echo "</ol>";

     $mysqli->close();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title></title>
<style type="text/css">
body
{
font-family:Arial, Helvetica, sans-serif;
font-size:14px;
}
.update_box
{
background-color:#D3E7F5; border-bottom:#ffffff solid 1px; padding-top:3px
}
a
    {
    text-decoration:none;
    color:#d02b55;
    }
    a:hover
    {
    text-decoration:underline;
    color:#d02b55;
    }
    *{margin:0;padding:0;}


    ol.timeline
    {list-style:none;font-size:1.2em;}ol.timeline li{ display:none;position:relative; }ol.timeline li:first-child{border-top:1px dashed #006699;}
    .delete_button
    {
    float:right; margin-right:10px; width:20px; height:20px
    }

    .cdelete_button
    {
    float:right; margin-right:10px; width:20px; height:20px
    }

    .feed_link
    {
    font-style:inherit; font-family:Georgia; font-size:13px;padding:10px; float:left; width:350px
    }
    .comment
    {
    color:#0000CC; text-decoration:underline
    }
    .delete_update
    {
    font-weight:bold;

    }
    .cdelete_update
    {
    font-weight:bold;

    }
    .post_box
    {
    border-bottom:1px dashed #006699;background-color:#F3F3F3;  width:499px;padding:.7em 0 2em 0;line-height:1.1em;

    }
    #fullbox
    {
    margin-top:6px;margin-bottom:6px; display:none;
    }
    .comment_box
    {
        display:none;margin-left:90px; padding:10px; background-color:#d3e7f5; width:300px;  height:50px;

    }
    .comment_load
    {
      margin-left:90px; padding:10px; background-color:#d3e7f5; width:300px; height:30px; font-size:15px; border-bottom:solid 1px #FFFFFF;

    }
    .text_area
    {
    width:290px;
    font-size:12px;
    height:30px;

    }
</style>
</head>
<body>
<div align="center">
<form method="post" action="">

Search:</br>
<p>client id: <input type="text" name="client_id"/> </p></br>

<input type="submit" name="submit" value="submit"/>

</form>


</div>
</body>
</html>

this is all that I’m getting when i input a value and click submit

<html>
<head>
</head>
<body>

2
<ol id="oldupdate" class="timeling">
</ol>
</body>
</html>
  • 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-13T16:58:19+00:00Added an answer on June 13, 2026 at 4:58 pm

    Following should work

    while ($row = mysqli_fetch_object($result))
    {
        // set up a row for each record
        echo "<li>";
        echo $row->message;
        echo "<br>" . $row->date_post;
        echo "</li>";
    }
    

    PHP Manual Reference Link: http://php.net/manual/en/mysqli-result.fetch-object.php

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

Sidebar

Related Questions

so I don't understand what I am doing wrong here. I want to populate
What am I doing wrong here folks? <?php include 'header.php'; /** * Display a
Here is my current situation: I have a user class that has an attribute
I cannot see what I am doing wrong here. Simply put, I want to
What am I doing wrong here? I'm trying to get started with jQuery UI
What am I doing wrong here: class Helo { // main: generate some simple
What am I doing wrong here? I'm serializing a value, storing it in a
What am I doing wrong here? private void SendMail(string from, string body) { string
What am I doing wrong here? Im trying to save a canvas drawing by
What am I doing wrong here? It says Database Count Failed (on the $count

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.