I have the following html:
<h4>Add Steps</h4>
<ul id="pasi">
<li>
<span>Pasul 1: </span><textarea id="pas"></textarea>
<input id="add_pas" type="button" value="Add Step" onclick="add_pas()"/>
</li>
<input id="" type="button" value="Add recipe" />
and this jquery function:
function add_pas() {
var pas = "Pasul " + i;
var list = $('#pasi');
var html = "<li class='pas-"+ pas +"'><span>" + pas + "</span><textarea></textarea><img src='../images/x.png' /></li>";
list.each(function(){
$(this).append(html);
});
i++
}
The function adds a new step when the button is clicked.
SQL:
TABLE recipe_steps (id, recipe_id,sort_oder,description)
My question is how do I insert the custom number of steps into the database, and then how to retrieve it. A first thaught was to insert all the steps into a vector(steps[]) but I don't really know where to start. Please take in consideration that I'm a begginer in php, mysql, jquery . Thank you and I hope I made it as clear as possible.