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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:52:12+00:00 2026-06-05T05:52:12+00:00

<?php $q=select * from students where (dynamic for user searching) $qry=mysql_fetch_array($q); while($row=mysql_fetch_array()) { **//

  • 0
<?php   
$q=select * from students where (dynamic for user searching)   
$qry=mysql_fetch_array($q);   
while($row=mysql_fetch_array())   
{   
   **// i do not need data here?**   
}   
?>   
< table>   
< tr>< td><?php echo **$row[?][?];** ?>< /td>< td><?php echo **$row[?][?];** ?>< /td>...< /tr>   
< tr>< td><?php echo **$row[?][?];** ?>< /td>< td><?php echo **$row[?][?];** ?>< /td>...< /tr>   
....    
< /table> 

In need to generate a dynamic report in html table format
the html table rows and columns are static for results
so i cant use echo with in while loop
i have to access it out side while loop
i have an idea of selecting single row single column for each cell of table separatly
but it will be time consuming and length
any alternative or solution?

  • 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-05T05:52:14+00:00Added an answer on June 5, 2026 at 5:52 am

    You don’t have to use a while loop. You can fetch the data as you need it.

    $row1 = mysql_fetch_array($qry);
    $row2 = mysql_fetch_array($qry);
    

    I don’t like doing this though because you have to keep track of the resource ($qry in this case) and you have to keep typing mysql_fetch_*() so I tend to load results into an array before I use them.

    $result = array();
    while($row=mysql_fetch_object($qry))
    {
        $result[] = $row;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While working with PHP ,handling connection's with Database (MySQL) $result = mysql_query('select * from
I need to do this query: SELECT * FROM property_select(ARRAY[8,9,10,11,12,13,14,15,16,17,19,20,26,28]) using PHP function pg_query_params($prepared,
(This is called via PHP) I have the following: SELECT name FROM user WHERE
PHP session_start(); $username = $_POST['regduser']; $userpass = md5($_POST['regdpass']); $sql = $sql->prepare(SELECT * from Students
<h2>User Profile: <?php if($sth->rowCount() > 0) {$row = $sth->fetch(PDO::FETCH_ASSOC);echo &nbsp;{$row['uname']};} else {echo No data.;}?></h2>
My select statement in PHP is select * from table; I use the following
I am using a query inside PHP as: $query = 'SELECT * from #__chronoforms_UploadAuthor
I create a json encode in PHP like this: $get = mysql_query(SELECT * FROM
I am experimenting with PHP. This is my func.php function returnBlankStylist(){ $sql=mysql_query(SELECT * FROM
topic.php $id = isset($_GET['id']) ? intval($_GET['id']) : 0; $query = mysql_query(SELECT * FROM topics

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.