Text collaboration system using php mysql and html -
i trying create parent child text collaboration system , parent text can have more 1 child. instance :
text 1 can edited , have edit 2 , text 1 can edited again , have edit 3 edit 3 can edited , become edit 4 , on.
below script have allows user edit original text input : index.php
<?php include 'includes/connection.php'; $query = "select * branches"; $result1 = mysql_query($query) or die(mysql_error()); while($person = mysql_fetch_array($result1)) { //as long there data, output data $id = $person['id']; $query2 = "select * branchesedit (parent_id = '$id' )"; $result2 = mysql_query($query2) or die(mysql_error()); echo "<h3>" . $person['names'] . "</h3>"; echo "<p>" . $person['lyrics'] . "</p>"; echo "<a href=\"modify.php?id=" . $person['id'] . "\">modify song</a>"; echo "<span> </span>"; echo "<a href=\"delete.php?id=" . $person['id'] . "\">delete song</a>"; while($row2 = mysql_fetch_array($result2)){ echo "<h3>" . $row2['name'] . "</h3>"; echo "<p>" . $row2['lyricupdate'] . "</p>"; } } ?>
modify.php
<?php if(isset($_post['submit'])) { $query = "select id branches id = $_get[id]"; mysql_query("insert branchesedit(`ids`, `name`, `lyricupdate`, `parent_id`) values ('','$_post[inputname]', '$_post[ta]', '$_post[id]')") or die(mysql_error()); echo "song has been modified"; header("location: index.php"); } ?>