Xtremer360 Posted December 7, 2010 Share Posted December 7, 2010 This part of the question is based off of php so I'll put it here of course. The idea behind this is jquery/ajax is going to get passed an id (eventid) from a dropdown select box inside a form and it's going to run a query to find all the events in my database with that same id. After running the query it's going to list them out and find the highest number of another field (label) and its going to add one to its value and then what I would like for it to is send it back to the form in the jquery/ajax and and place that label inside of the existing input text field in the form. So I'm asking is if my code is presented and is doing what I"m attempting it to do on the php side and if so if I can take out the print tag of the input text field. $eventid = $_GET['eventid']; $result = mysqli_query("SELECT * FROM `events` WHERE `event_id` = '$eventid'"); $list = mysqli_num_rows($result); $label = $list + 1; print '<input type="text" name="label" class="text" readonly="readonly" value="' . $list . '" />'; Link to comment https://forums.phpfreaks.com/topic/220891-php-side-of-a-ajax-request/ Share on other sites More sharing options...
Xtremer360 Posted December 7, 2010 Author Share Posted December 7, 2010 Perhaps this might explain it even better. What I want it to to is when the user selects an if its the first event with that name meaning it'd be the first instance of that show itd be 1 for the label now when it comes time for the next show wiht that name it'll go into the database and see that there's already and instance of that show and it'll see that the label there is 1 so then it'll add one to that number and return 2 for the label Link to comment https://forums.phpfreaks.com/topic/220891-php-side-of-a-ajax-request/#findComment-1143821 Share on other sites More sharing options...
Xtremer360 Posted December 8, 2010 Author Share Posted December 8, 2010 Did this help? Link to comment https://forums.phpfreaks.com/topic/220891-php-side-of-a-ajax-request/#findComment-1144649 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.