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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:47:19+00:00 2026-06-01T19:47:19+00:00

Ok I have this code: <? $name=$_POST[‘name’]; $con = mysql_connect(localhost,root,); if (!$con) { die(‘Could

  • 0

Ok I have this code:

<?
$name=$_POST['name'];

$con = mysql_connect("localhost","root","");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("juliver", $con);

$result = mysql_query("SELECT * FROM items WHERE id='$name'");
$ss = ""
while($row = mysql_fetch_array($result))
{   
    $ss .= "<div style='border:1px solid red; float:left; width:100px;'><img src="Images/media'.$row['name'].'" />";
    $ss .= "<p>".$row['title']."</p>";
    $ss .= "<p>".$row['description']."</p>";
    $ss .= "<a href='".$row['link']."'>".$row['link']."</a></div>";

}

mysql_close($con);
?>

<? echo $ss; ?>

Now, I want to organize the display, therefore, I want the record to be set by 3 but the only problem where im stuck is I dont know how to make it to display in by set of 3. Im open for a suggestion, please help me. Thank you.

  • 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-01T19:47:21+00:00Added an answer on June 1, 2026 at 7:47 pm

    a function

    function sqlArr($sql){
      $ret = array();
      $res = mysql_query($sql) or trigger_error(mysql_error()." ".$sql);
      if ($res) {
        while($row = mysql_fetch_array($res)){
          $ret[] = $row;
        }
      }
      return $ret;
    }
    

    a code

    mysql_connect("localhost","root","");
    mysql_select_db("juliver");
    
    $name = mysql_real_escape_string($_POST['name']);
    $data = sqlArr("SELECT * FROM items WHERE id='$name'");
    $data = array_chunk($data,3);
    include 'template.tpl.php';
    

    a template

    <table border='1'>
    <? foreach ($data as $row): ?>
      <tr>
    <?   foreach ($row as $cell): ?>
        <td><?=$cell['id']?><?=$cell['title']?></td>
    <?   endforeach ?>
      </tr>
    <? endforeach ?>
    </table>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code struct Student { char name[48]; float grade; int marks[10,5]; char
I have this code to load icon and application name , but it is
I have this code here: var Person = (function() { var name; var PersonConstructor
I have this code: class MyObj { int Id; string Name; string Location; }
I have this code: class DocumentIdentifier attr_reader :folder, :name def initialize( folder, name )
I have this code: function submitTwice(f){ f.action = 'http://mydomain.com/threevideopage.php'; f.target='name'; f.submit(); } I left
I have this snippet of code private Templates retrieveFromCache(String name) { TemplatesWrapper t =
I have a table like this: name code group john 12 smith 15 how
I have this code: <form action= id=credentials method=post> <label for=name id=nameLabel >Name*:</label> <input type=text
So I have this code: <form name=form action=./ method=post> <input type=file name=newfile id=newfile />

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.