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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:31:25+00:00 2026-06-07T07:31:25+00:00

That is my jquery code: $(function() { $(#edit_union).click(function() { var tuzove = $(#tuzove).val(); var

  • 0

That is my jquery code:

$(function() {  
$("#edit_union").click(function() {
    var tuzove = $("#tuzove").val();
    var description = $("#description").val();
    var union_owner = $("#union_owner").val();
    var union_name = $("#union_name").val();
    var uid = $("#uid").val();
    var dataString = 'tuzove='+ tuzove + '&description=' + description + '&union_owner=' + union_owner + '&union_name=' + union_name + '&uid=' + uid;  
    $.ajax({  
        type: "POST",  
        url: "ajax/admp_ajax.php",  
        data: dataString,  
        success: function() {
            $(".adm_panel_serach_user").append("<br/><span style=' color: #0099ff; font-weight: bold;'>Success.</span>");
        }  
    });
    return false;
});
});

That is ajax/admp_ajax.php page:

include_once 'classes/admin_panel.php';
$admpanel = new adminPanal();

if ($_POST['tuzove'] && $_POST['description'] && $_POST['union_owner'] && $_POST['union_owner'] && $_POST['uid'])
$admpanel->editUnion($_POST['tuzove'], $_POST['description'], $_POST['union_owner'], $_POST['union_name'], $_POST['uid']);

That is editUnion function:

public function editUnion($tyzove, $description, $ownerName, $unionName, $unionId) {
    mysql_query("UPDATE `union` SET tuzove = '" . $tyzove . "', description = '" . mysql_real_escape_string($description) . "', owner_id = '" . $this->getUserId($ownerName) . "' WHERE name = '" . $unionName . "'");

    if ($ownerName == $ownerName)
        mysql_query("UPDATE users SET union_rank = '0', union_id = '0' WHERE username = '" . $ownerName . "'");

    mysql_query("UPDATE users SET union_rank = '1', union_id = '" . $unionId . "' WHERE username = '" . $ownerName . "'");
}

Problem is that, when I click edit_union button write Success, but don’t update union :(.

  • 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-07T07:31:27+00:00Added an answer on June 7, 2026 at 7:31 am

    Well your php page will return some content whether the sql query fails or not. This means that success will always be fired unless the page cannot be loaded for some reason. SQL failures will not cause it to fail.

    Therefore you will always get your success printed but the update itself may fail. Try running the php page by itself in the browser and see any errors sql kicks up. You can also try printing the sql queries to the screen using echo statements in php and then copy these onto the sql commandline or into phpmyadmin etc.

    Also a side note, since your query info is coming from a form / input fields you need to be very careful to prevent sql injection and the like. Look into using mysqli and prepared statements instead.

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

Sidebar

Related Questions

Here is my jQuery code: function onSaveClicked() { var message = { MessageID: $(#MessageID).val()
I have the following jQuery Code: $(#menu span).click(function() { var url = this.getAttribute(data-url); var
I'm trying to call a function that contains jQuery code. I want this function
I have some jQuery code that intercepts links clicked on a page: $(document).ready(function() {
I have a Jquery code that is following: var selectedQuestions = $(#SelectedQuestions); var selectedCustomQuestions
this is my first question here. I have the following jquery code: $(document).ready(function(){ $(a).click(function(){
I am trying to use ajax like below; jquery code: $(a.generate).click(function(){ $.ajax({ data: {tag:
Here is a code fragment from a page: $(#add_new).button().click(function (ui,event) { var postdata =
I have the below jQuery code: $(document).ready(function () { $('#ajaxButton').click(function () { $.ajax({ url:
I have the following JavaScript/jQuery code that starts the listener that highlights the DOM

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.