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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:24:27+00:00 2026-06-02T23:24:27+00:00

<a href=add.php>add new product</a><br> <br> <?php include(mysql.php); $result = mysql_query(SELECT * FROM gallery );

  • 0
<a href="add.php">add new product</a><br>
<br>

<?php

include("mysql.php");

$result = mysql_query("SELECT * FROM gallery ");

$just = mysql_fetch_array($result);
$num=mysql_num_rows($result);  

$table="";
$table.="<td>delete</td>";

$table.="<td>update</td>";
if ($num > 0 ) {
$i=0;

while($just = mysql_fetch_array($result))   
{
$num=mysql_num_rows($result);  
  {

$table .= "<tr>";

$table .= "<td><a href=\"delete.php?name=".$just['name']."&id=".$just['id']."\">".$just['title']."</a></td>";
$table .= "<td><a href=\"update.php?description=".$just['description']."&title=".$just['title']."&id=".$just['id']."\">".$just['title']."</a></td>";

  }
$table .= "</tr>";
while ($i < $num) {

$name = stripslashes(mysql_result($result,$i,"name"));
$title = stripslashes(mysql_result($result,$i,"title"));
$description = stripslashes(mysql_result($result,$i,"description"));

++$i; }
}
}


else { $table = '<tr><td colspan="2" align="center">Nothing found</td></tr>'; }

?>

<table border="1" cellpadding="1" cellspacing="2"><? echo $table ?></table>

good morning , in the above code iam trying to create a table of 2 columns delete and update , being able to manage mysql through this page , but i get only 1 row from mysql table although i expect 4 (4 rows are saved in mysql table)
what’s the wrong here , thanks in advance

  • 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-02T23:24:29+00:00Added an answer on June 2, 2026 at 11:24 pm
    <a href="add.php">add new product</a><br>
    <br>
    
    <?php
    
    include("mysql.php");
    
    $result = mysql_query("SELECT * FROM `gallery`");
    
    $num = mysql_num_rows($result);  
    
    $table = "";
    $table .= "<td>delete</td>";
    $table.="<td>update</td>";
    
    if ($num > 0 ) {
        $i=0;
        while($just = mysql_fetch_assoc($result)) {
            $num=mysql_num_rows($result);  
            $table .= "<tr>";
            $table .= "<td><a href=\"delete.php?name=".$just['name']."&id=".$just['id']."\">".$just['title']."</a></td>";
            $table .= "<td><a href=\"update.php?description=".$just['description']."&title=".$just['title']."&id=".$just['id']."\">".$just['title']."</a></td>";
        }
        $table .= "</tr>";
        while ($i < $num) {
            $name = stripslashes(mysql_result($result,$i,"name"));
            $title = stripslashes(mysql_result($result,$i,"title"));
            $description = stripslashes(mysql_result($result,$i,"description"));
            ++$i; 
        }
    } else { 
        $table = '<tr><td colspan="2" align="center">Nothing found</td></tr>'; 
    }
    ?>
    
    <table border="1" cellpadding="1" cellspacing="2"><? echo $table ?></table>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an href in HTML that I dynamically produce from a server. I
I'm trying to prevent A HREF from actually opening the link, but to execute
I have a simple form that generates a new photo gallery, sending the title
I need to add a $ variable to an href url, I have tried
I have modified my PHP web app to add events to a Google Calendar.
I want to loop though some links and add a number to the href,
I have an alternating rows using PHP: while($i < $num) { $idphysicians = mysql_result($qPhysician,$i,idphysicians);
I have two pages, product.php and viewcart.php. When a user clicks on a button
I'm trying to encode the following relative URL using PHP: /tracks/add/5449326 I've tried using
Hi I am trying to write a tag cloud using jquery xml+MySql and php.

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.