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

  • SEARCH
  • Home
  • 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 6653297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:15:05+00:00 2026-05-26T01:15:05+00:00

Admin: Please create image urls as images I’m trying to achieve the following output:

  • 0

Admin: Please create image urls as images
I’m trying to achieve the following output:

//
    Joseph Dickinson
    Title: Need Xbox 360
    Comment: I need one quick!
    on 2011-09-15
    John Doe 149.99
    Jane Doe 154.99
    Diana Matthews 160.00
    Amanda Koste 174.99
//

Currently, I get the name “Joseph Dickinson” written for each offer like “John Doe 149.99” or “Jane Doe 154.99”. I want it ONCE for each, Title like “Need Xbox 360”
https://i.stack.imgur.com/ERLbX.png

This page gathers this info through a php file:

<?php require_once('inc/db/dbc.php'); ?>
<?php
#GET User (Buyer) Info and General Listing Info
$pdo = new PDO($h1, $u, $p);
$pdo->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
$sth = $pdo->prepare('
  SELECT uFName, uLName, listTitle, listCmt, listDt, mBCFName, mBCLName, moAmt, moDtOff
  FROM User U, Listing L, Merchant M, MerchantOffer MO
  WHERE U.uID = L.uID
  and L.listID = MO.listID
  and M.mID = MO.mId
  LIMIT 0,5
;');
$sth->execute(array());

?>

PHP I’m Using

    <?php $usrBrowser = $_SERVER['HTTP_USER_AGENT']; $todayDt = date('Y-m-d');  ?>
    <form id="AddListing" method="post" action="#">
        <input type="hidden" name="theUserID" value="" /> <br>
        Product Wanted: <input type="text" name="ListingTitle" /> <br>
        Listing Length:<?php require_once('inc/php/listingLengths.php'); ?>
        &nbsp;&nbsp;&nbsp;Cost: <input type="text" name="ProductAskingPrice" /> <br>
        &nbsp;&nbsp;&nbsp;Shipping: <input type="text" name="ProductAskingShipAmount" /> <br>
        &nbsp;&nbsp;&nbsp;Additional Comment: <input type="text" name="ListingComment" /> <br>  
        <input type="hidden" name="ListingDateOfEntry" value="<?php echo $todayDt; ?>" /> <br>  
        <input type="hidden" name="ListingUserBrowserType" value="<?php echo $usrBrowser; ?>" /> <br>
        <input type="submit" value="List" />
    </form>
    <?php 
    $result = $sth->fetchAll(PDO::FETCH_NUM);
    #print_r($result); //or var_dump($result); for more info
    foreach($result as $row){
        $half = array_splice($row,0,5);
        echo implode("<br> ",$half)."<br />".implode(" ",$row);
    }   
    ?>

How do I get it to output in that manner I listed above? Would it be easier to use array indexes? How do I achieve the // // above?
https://i.stack.imgur.com/dBhyx.png

  • 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-05-26T01:15:06+00:00Added an answer on May 26, 2026 at 1:15 am

    Try this:

    foreach($result as $row)  
      {  
      print $row[0] . ' ' . $row[1] . '<br>Title: ' . $row[2] . '<br>Comment: ' . $row[3] ...   . '<br>';
      }  
    

    If you change $result = $sth->fetchAll(PDO::FETCH_NUM); into $result = $sth->fetchAll(PDO::FETCH_ASSOC); you can get the same result with more readable code:

    print $row['uFName'] . ' ' . $row['uLName'] . '<br>Title: ' . $row['listTitle'] . '<br>Comment: ' . $row['listCmt'] ... . '<br>';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a wordpress plugin admin menu. The problem that I
I am trying to create stored procedure in mysql admin. I am hosting a
I'mt trying to create a plugin which adds a custom page in the admin
what i am trying to do is when an admin tries to create a
I am trying to create a page in my WordPress Admin Area that displays
explain me please how to use it in my Admin? You can just create
I'm trying to post on the page that I create. **Please note that this
I need to create a redirect with message in admin joomla component, I'm using
I've created a button within the Admin theme, which is named 'Create order for
I am considering best option to create multi-purpose admin page in my asp.net application.

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.