help with php, ajax and mysql (small task)

Closed Posted 6 years ago Paid on delivery
Closed

i need help with a code that will pull records from the database, and will echo them to a php variable using ajax.

i have a <select> code that have onchange="getData([login to view URL]);"

then a script that will look something like this

<script>

function getData(val) {

$.ajax({

url : "includes/[login to view URL]",

dataType: 'json',

type: 'POST',

data: "datasent="+val,

success : function(data) {

receivedData = [login to view URL](data);

$('#internal').val([login to view URL]);

$('#customer').val([login to view URL]);

}

});

}

</script>

the #internal is an input

<input type="text" id="internal" placeholder="2">

i would like to have the "[login to view URL]" to be showed as the value of the input.

same as the customer, only with another input for the customer.

the php code is something like

$Number = $_POST['datasent'];

$query = "SELECT * FROM table WHERE item_number = $Number";

$results = mysqli_query($connection, $query);

$row = mysqli_fetch_array($results);

json_encode($row);die;

what am i missing and it is really important for me to have the multiple variables pulled in one function instead of having multiple different functions for each input.

i expect getting this code to work shouldn't take more than half an hour. so my budget for this is 5$.

AJAX MySQL PHP Software Architecture XML

Project ID: #15375234

About the project

32 proposals Remote project Active 6 years ago

32 freelancers are bidding on average $11/hour for this job

vishal80

I can solve this ajax error of getting data, you are making mistake while sending a request Contact me i will solve it soon

$8 USD / hour
(175 Reviews)
7.1
Shopify

Hello , Greetings from Shopify. I hope you are doing fine. I read your project description and would like to work with you. I think you need developed new website for your business. I am here to provide you great More

$15 USD / hour
(27 Reviews)
7.0
shayona163

hello sir i am expert in AJAX, MySQL, PHP, Software Architecture, XML i can do this work you will satisfy with my work i can do this work asap thank you

$10 USD / hour
(174 Reviews)
6.9
prashushinde9

Hello, I am a senior developer with extensive experience in building high quality Mobile apps & Web system. When I work on a project, I strive for excellence and 100% client satisfaction. Having an idea is easy, More

$11 USD / hour
(55 Reviews)
7.1
spryox

You have created project of minimum 8USD so we have to bid atleast 8 USD. I can get this done in next hour and available for work. For info I have 7+ years of working experience so be assured of the work

$8 USD / hour
(162 Reviews)
6.3
glennwilkins

sir pm me .... sir pm me .... sir pm me .... sir pm me .... sir pm me .... sir pm me .... sir pm me .... sir pm me .... sir pm me .... sir pm me .... sir pm me .... sir pm me ....

$8 USD / hour
(185 Reviews)
6.3
Websitemaestro

Hi, I can definitely help you with your requirements. I am a full time developer working "8 hours a day" 40 hours per week. I have limited space here to write please message for more discussion. Waiting for yo More

$8 USD / hour
(76 Reviews)
6.4
manjeet2017

Hi, I went through your requirement and feel comfortable to do this job. I have good experience in website design & development. Please initiate chat to discuss further.

$12 USD / hour
(101 Reviews)
6.0
bouguima123

Hello Man, i'm a PHP expert having participate in many web projects i have a good experience using jquery and javascrpt trust me i can complete your work quickly in 1 hours max regards Omar

$13 USD / hour
(38 Reviews)
6.1
RubyOnRail

Hello We have a Skilled Team of Experts having a Strong 8 years of an Experience in Web & Mobile Application Designing & Development & have already completed more than 230 Projects successfully. Relevant Skills a More

$16 USD / hour
(18 Reviews)
5.9
woksepp

Hello there! I can take a look at it before getting awarded, hit me up in the chat if you're interested :=)

$10 USD / hour
(32 Reviews)
4.9
bitibe

hiii there i am interested in your projecjt and gone through your post let me are u able able to share your that part of code so can fix it within an hour contact me for further chat

$12 USD / hour
(14 Reviews)
4.8
rohitmittal18

Hello Friend, You need to make two changes in your code: 1. remove dataType: 'json', from javascript 2. echo outpu of php like: echo json_encode($row);die; Making above changes will provide you the desired res More

$13 USD / hour
(18 Reviews)
4.3
athminteam

Python, Java, Node, Javascript, Angular, PHP, C, C++, Android, IOS, Cordova(Hybrid) and digital marketing. android/ios apps, chat bots. AI, IOT and cloud soltuions shopify, wordpress and magento

$12 USD / hour
(6 Reviews)
2.9
varinderkaurcode

Yes after go through your job details I assure to you that i am complete it using my development skills with perfection and complete it in your timeline . I am a Senior Web Developer and excellent in website designi More

$13 USD / hour
(2 Reviews)
2.0
juste009

Hello I have confidence about your project I don't money from you I just want work history I am looking forward to be worked with you Thank you

$8 USD / hour
(2 Reviews)
0.6
NavrozPatel

Hello Sir. I have 5+ years experience in PHP and Mysql. I can do this project very easily without any issue and in no time. Just message me so that we can start this project right now.

$10 USD / hour
(1 Review)
0.0