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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:32:51+00:00 2026-06-13T09:32:51+00:00

I dont now where my mistake is, my code is as follows: <?php mysql_set_charset(‘utf8’);

  • 0

I dont now where my mistake is, my code is as follows:

<?php

mysql_set_charset('utf8');
$result = mysql_query("SELECT * FROM obedy ORDER BY datum DESC LIMIT 30");
while ($row = mysql_fetch_array($result, MYSQL_NUM)) 
{
    $time = strtotime( $row[0] );
    $myDate = date( 'd.m.', $time );
    $w_day = date( 'N', $time );
    $ww_day = $w_day-1;
    $the_row= $row[0];

    echo "<p>" . $myDate . "&emsp;";
    echo "<input type='hidden' value='$row[0]' name='tdel'>";
    echo "<input type='text' name='menu1' id='menu1' class='input' value='". $row[1] ."' size='37'/>";
    echo "<input type='text' name='menu2' id='menu2' class='input' value='". $row[2] ."' size='37'/>";
    echo "<input type='text' name='menu3' id='menu3' class='input' value='". $row[3] ."' size='37'/>";
    echo "<input type='submit' formaction='del_menu.php' class='button' value='Smazat' />";
    echo "</p>";                    
}

mysql_free_result($result);

?>

del_menu.php

<?php

$huh = mysql_connect("juxcore.ipagemysql.com", "*", "*") or
die("Could not connect: " . mysql_error());

mysql_select_db("jux_mms");
mysql_set_charset('utf8');

$watta="DELETE FROM obedy WHERE datum = '$_POST[tdel]'";

if (!mysql_query($watta,$huh))
{
    die('Error: ' . mysql_error());
}

header('Location: http://www.juxcore.com/x/vita/menu.php');

The thing is, I don’t know why it deletes the last displayed row, instead the one clicked. Any ideas how to solve that?

  • 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-13T09:32:52+00:00Added an answer on June 13, 2026 at 9:32 am

    You should use <form> tags:

    echo "<form action='del_menu.php' method='post'><p>" . $myDate . "&emsp;";
    echo "<input type='hidden' value='".$row[0]."' name='tdel'>";
    echo "<input type='text' name='menu1' id='menu1_".$row[0]."' class='input' value='". $row[1] ."' size='37'/>";
    echo "<input type='text' name='menu2' id='menu2_".$row[0]."' class='input' value='". $row[2] ."' size='37'/>";
    echo "<input type='text' name='menu3' id='menu3_".$row[0]."' class='input' value='". $row[3] ."' size='37'/>";
    echo "<input type='submit'  class='button' value='Smazat' />";
    echo "</p></form>";
    

    The problem is that you can only have one item with the same name in one form. If you use multiple items with the same name, only the last one defined will get trough. You can use multiple forms to solve that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i dont know if i should be asking this here (im now thinking maybe
I just installed valgrind but now my breakpoints dont work in qtcreator. How can
Here is my test page (dont mind the layout right now) https://www.bcidaho.com/test_kalyani/employer-plans-test.asp i found
Although I am using mySQL (for now), I dont want any DB specific SQL.
Instead of excluding it, by mistake, I deleted the .cs code behind file for
I'm trying to switch over to Storyboard from IB and code but got the
I've the following code in PHP which works fine (returns more or less 10
[Python 3.1] Edit: mistake in the original code. I need to print a table.
I was watching the videos from WWDC 2010 and have now started to dig
This is a bit confused question for those who don't now advanced SQL... However.

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.