Jump to content

Recommended Posts

hi, i currently have all my mysql data displayed in a tabe. I would like to add a button to delete all the data in the row. Can some please assit me in doing this. Thank you in advance

 

<html>
<head>
<title>Displaying MySQL Data</title>
</head>
<body>
<p>
  <?php
$db_host="xxxxxxt"; // Host name
$db_user="xxxxxxxx"; // Mysql username
$db_pwd="xxxxxxxx"; // Mysql password
$db_name="xxxxxxxx"; // Database name




mysql_connect($db_host, $db_user, $db_pwd);
mysql_select_db($db_name);

$query="select * from test_mysql";
$result=mysql_query($query);
echo "<table border=1>";
echo "<tr>";
for($i=0;$i<mysql_num_fields($result);$i++)
{
    echo "<th>";
    echo mysql_field_name($result, $i);
echo "</th>";
}

while($row=mysql_fetch_row($result))
{
    echo "<tr>";
    for($j=0;$j<$i;$j++)
    {
    echo "<td>";
    echo $row[$j];
    echo "</td>";
    }
    echo "</tr>";
}
echo "</tr>";
echo "</table>";

?>
</p>
<p><a href="http://www.xxxxx.com/insert.php">Click Here to Enter More data!</a></p>
</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/111666-deleting-a-mysql-row/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.