hossfly007 Posted November 16, 2006 Share Posted November 16, 2006 my script and database are not syncing as you can tell PLEASE what do i do? I am very new to thisBagTag#: 1 Name: BagTag#: Name: 1BagTag#: 2 Name: BagTag#: Name: 3 BagTag#: 4 Name: BagTag#: Name: 4BagTag#: 5 Name: BagTag#: Name: 5 -<?php $host = '0000; $user = '0000'; $password = '0000'; $dbName = '0000'; $conn = mysql_connect($host, $user, $password) or die(mysql_error()); $db = mysql_select_db($dbName, $conn) or die(mysql_error());if (isset($_POST['bag_number']) && trim($_POST['bag_number']) != '') { $bag_number = $_POST['bag_number']; $sql = "insert into testTable (bag_number) values ('$bag_number')"; $result = mysql_query($sql, $conn) or die(mysql_error()); }if (isset($_POST['bag_member']) && trim($_POST['bag_member']) != '') { $bag_member = $_POST['bag_member']; $sql = "insert into testTable (bag_member) values ('$bag_member')"; $result = mysql_query($sql, $conn) or die(mysql_error()); }$result = mysql_query("select bag_number, bag_member from testtable");$row= mysql_fetch_assoc($result);echo "<table>\n";while ($row= mysql_fetch_assoc($result)){echo "<tr><td>BagTag#: " . $row["bag_number"]. "</td><td>Name: ". $row["bag_member"]. "</td></tr>\n";}echo "</table>";echo "<br> Make a new entry: <br> <form action = '{$_SERVER['PHP_SELF']}' method ='post'><input type = 'text' name = 'bag_number' maxlength='20' size = '10'> <input type = 'text' name = 'bag_member' maxlength='20' size = '10'> <input type = 'submit' value = 'Add Entry'> </form>"; ?> -Field Type Null Default bag_number varchar(5) No bag_member varchar(50) No bag_w varchar(5) No bag_l varchar(5) No Link to comment https://forums.phpfreaks.com/topic/27522-mysql-index-key-what-causes-this-problem/ Share on other sites More sharing options...
fenway Posted November 16, 2006 Share Posted November 16, 2006 I don't understand... syncing? Link to comment https://forums.phpfreaks.com/topic/27522-mysql-index-key-what-causes-this-problem/#findComment-125855 Share on other sites More sharing options...
hossfly007 Posted November 16, 2006 Author Share Posted November 16, 2006 i dont really know if that's the term, but when i post the info and the retrieve it it does show up on the same row, i'm thinking that is suppose to stay together right?1 with 12 with 23 with 3<<<example of the output>>>BagTag#: 1 Name: BagTag#: Name: 1BagTag#: 2 Name: 4BagTag#: Name: 2 Link to comment https://forums.phpfreaks.com/topic/27522-mysql-index-key-what-causes-this-problem/#findComment-125856 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.