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 . '" />'; Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Xtremer360 Posted December 8, 2010 Author Share Posted December 8, 2010 Did this help? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.