Web design service - AND c.lair_id = l.id . AND c.id

AND c.lair_id = l.id . AND c.id = $char ; $result = mysql_query($sql) or die(mysql_error()); $ch = mysql_fetch_array($result); Once the script determines there was a record retrieved, it alters the default variables to reflect the edited document. The background is green, and you are Updating rather than Creating. if (is_array($ch)) { $subtype = Update ; $tablebg = #EEFFEE ; $subhead = Edit data for . $ch[ alias ] . and click $subtype Character. ; The next SQL statement retrieves all powers associated with this character. All you really need is the ID so that you can create a $powers array with each element containing the word selected. This will be used in the Powers field on the form, so that each power assigned to the character will be automatically selected. $sql = SELECT p.id . FROM char_main c . JOIN char_power p . JOIN char_power_link pk . ON c.id = pk.char_id . AND p.id = pk.power_id . WHERE c.id = $char ; $result = mysql_query($sql) or die(mysql_error()); if (mysql_num_rows($result) > 0) { while ($row = mysql_fetch_array($result)) { $powers[$row[ id ]] = selected ; } } Now you do exactly the same thing with the character s enemies. Note the similarity in this SQL statement to the one in charlist.php. The only difference is that you want only the enemies that match your character. // get list of character s enemies $sql = SELECT n.id . FROM char_main c . JOIN char_good_bad_link gb . JOIN char_main n . ON (c.id = gb.good_id AND n.id = gb.bad_id) . OR (n.id = gb.good_id AND c.id = gb.bad_id) . WHERE c.id = $char ; $result = mysql_query($sql) or die(mysql_error()); if (mysql_num_rows($result) > 0) { while ($row = mysql_fetch_array($result)) { $enemies[$row[ id ]] = selected ; } } 321 Building Databases
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision J2ee Web Hosting services.

Leave a Reply