×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

AJAX not working after database migration from MySQL to SQL Server ( Undefined index)

AJAX not working after database migration from MySQL to SQL Server ( Undefined index)

AJAX not working after database migration from MySQL to SQL Server ( Undefined index)

(OP)
Hello everyone,
I'm new to coding and really unexperienced in web development. But i have a huge problem at the moment, that I have been trying to solve for the last couple of days.
To my problem:
I'm migrating a database from MySQL to MS SQL Server 2012 for an already existing web application. The data has been migrated successfully and is 100% similar to the old data.
The problem is I had to edit a few SQL Statements in a PHP-Application, which is using the database. The connection has been successfully established from the php-application to the new MS SQL Server.
But when I try to send a query via ajax im always getting this error: (After reloading the website everything works fine but without reloading it I get this error message)

A PHP Error was encountered
Severity: Notice

Message: Undefined index: filter_18

This is the ajax code im using :

$.ajax({
url: global_url+"test/getTest"
,type: 'POST'
,dataType: 'json'
,data: {
filter_1 : filter_1
,filter_2 : filter_2
,filter_3 : filter_3
,filter_4 : filter_4
,filter_5 : filter_5
,filter_6 : filter_6
,filter_7 : filter_7
,filter_8 : filter_8
,filter_9 : filter_9
,filter_10 : filter_10
,filter_11 : filter_11
,filter_12 : filter_12
,filter_13 : filter_13
,filter_14 : filter_14
,filter_15 : filter_15
,filter_16 : filter_16
,filter_17 : filter_17
,filter_18 : filter_18
}
,async: true
,success: function(data) {
$("#test").html(data.html);
$("#amountofx").html("");
if(data.amountofx_all != amountofx){
$("#amountofx").html(data.amountofx_all +" von "+data.amountofx);
}
else {
$("#amountofx").html(data.amountofx);
}

mleh = $(".x:nth-of-type(1)").height();
$(".btn_show_x").height(mleh);
$("#pagenr_data").html(data.pagenr);
if (data.pagenr == "") {
$("#pagenr_data").hide();
}
else {
$("#pagenr_data").show();
}
}
,error: function(requestObject, error, errorThrown) {
alert("Fehler beim Auslesen der Maßnahme.");
hideOverlay();
}

});

Please keep in mind, that I didn't write this code I just had to change every single variable in this code snippet in order to post it here.

What confuses me the most, is that the application worked with the old MySQL Server and I haven't changed ANY syntax besides some SQL Statements. The error has to be in this ajax or in a config file etc. The SQL Statements work without ajax I've also checked them. The connection between the controller / models and ajax also works.
I’m Using codeigniter and jquery 3.5.1.

I really appreciate any help because at the moment I'm complete lost and don't know how to solve this problem.
Thanks a lot in advance and merry Christmas to you all.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close