Jump to content

myristate

Members
  • Posts

    17
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

myristate's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks, that fixed it right up. I was always unsure of the span tag. But ive read up on it now. Thanks! [sOLVED]
  2. As you can see from the image the sentence is put onto a new line before the word "hard" and after it. This corresponds with the location of the <div> tags. So i am wondering how do i stop it from doing that. I have included the html and css if someone could help please. HTML <div class="raidlist_zonetitle"> Karagga's Palace (8 Man <div class="hard">Hard</div>) </div> <div class="raidlist"> <BR /> Bonethrasher <BR /> Foreman Crusher <BR /> G4-B3 Heavy Fabricator <BR /> Jarg and Sorno <BR /> Karagga the Unyielding <BR /> <BR /> <BR /> </div> CSS .hard { text-align: left; color: #ff6633; font-style: italic; font-size: 1.0em; }
  3. That is the post i actually found that i found to fix it.
  4. seems no matter how i rearranged the formatting after regexp it would always select upper and lower case, after stumbling across a page seems you have to add COLLATE into the mix $query = "SELECT * FROM template WHERE (title COLLATE latin1_general_cs) REGEXP '^[A-Z]+$'";
  5. Hi there, im looking for a little bit of help, could someone who knows how to use REXEXP properly tell me how i would select only the uppercase titles from title column and display them +------------+-----------+ | id | title | +------------+-----------+ | 1 | one | | 2 | TWO | | 3 | three | | 4 | FOUR | +------------+-----------+ <?php $username="user"; $password="pw"; $database="db"; mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query = "SELECT title FROM template WHERE name REGEXP '^(A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z)'"; $result = mysql_query($query); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo "Custom Template Name : {$row['title']} <br><br>"; } mysql_close(); ?> This was an attempt i made but it did not work i got the following error: I did attempt to do a search on it but if im honest i didnt fully understand what they were saying. Im using php 5.3.5 and mysql 5.5.8 Thanks for your help
  6. Thanks for the reply, But i eventually figured it out.
  7. While i appreciate what your saying and of course it makes sense. I was kind of in a hurry and did not want the hassle of setting up another test server. I had a backup so in reality if it had gone wrong it wasnt the end of the world
  8. This is fairly simple stuff im about to ask (well i hope it is) I have included a screen shot of my how my table looks from phpmyadmin as i fear my explanation following might suck a bit. Anyway i have a coloum there called "Colour" in it there are four possible colours "red/yellow/blue/white" It has come to my attention that some of the colours for some of the data entries are wrong so my question is how do i update say all the "red" coloured items in that coloum without effecting the other colours. I thought this might possibly do it. However i cant afford to run it without knowing if it will work or not. : "UPDATE $db_table SET colour = 'Blue' WHERE colour = 'Red' "); [attachment deleted by admin]
  9. Hi there, Firstly this is a link to my working code/script http://www.nexus-guild.eu/adornments/index.php When you click on one of the body images it pulls all the data from the database for that particular slot and feeds it into a table. I am wondering how i can make it so when you click on the table column descriptions such as the Name/Effect/Quality/Level/Colour/Faction Name/Faction Value it will reorder all the information in ascending order or descending order. Ive looked around quite a bit for this but i cant find anything on this. This is the code im currently using. It has alot of repeating code which makes up the majority of the file <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>neXus - Adornments Calculator</title> <style type="text/css"> <!-- body { background-color: #2f2626; } body,td,th { color: #000; font-family: Trebuchet MS, Arial, Helvetica, sans-serif; } --> </style></head> <body text="#FFFFFF" link="#ff8000" vlink="#ff8000" alink="#ff8000"> <center> <p> </p> <p> </p> <p><img src="character.png" border="0" usemap="#Map"/> <map name="Map" id="Map"> <area shape="rect" coords="2,2,44,44" href="index.php?slot=head" /> <area shape="rect" coords="45,2,85,44" href="index.php?slot=cloak" /> <area shape="rect" coords="2,46,44,86" href="index.php?slot=chest" /> <area shape="rect" coords="45,45,85,86" href="index.php?slot=shoulders" /> <area shape="rect" coords="45,87,85,129" href="index.php?slot=forearms" /> <area shape="rect" coords="2,87,44,129" href="index.php?slot=legs" /> <area shape="rect" coords="45,130,85,170" href="index.php?slot=hands" /> <area shape="rect" coords="3,130,44,170" href="index.php?slot=feet" /> <area shape="rect" coords="46,172,86,216" href="index.php?slot=charm" /> <area shape="rect" coords="3,172,45,215" href="index.php?slot=charm" /> <area shape="rect" coords="45,216,85,257" href="index.php?slot=drink" /> <area shape="rect" coords="3,216,44,256" href="index.php?slot=food" /> <area shape="rect" coords="362,2,403,43" href="index.php?slot=waist" /> <area shape="rect" coords="405,2,443,43" href="index.php?slot=neck" /> <area shape="rect" coords="362,45,403,86" href="index.php?slot=ear" /> <area shape="rect" coords="405,45,444,87" href="index.php?slot=ear" /> <area shape="rect" coords="363,88,402,129" href="index.php?slot=finger" /> <area shape="rect" coords="405,89,444,128" href="index.php?slot=finger" /> <area shape="rect" coords="363,131,402,171" href="index.php?slot=wrist" /> <area shape="rect" coords="405,130,443,170" href="index.php?slot=wrist" /> <area shape="rect" coords="362,174,404,213" href="index.php?slot=ranged" /> <area shape="rect" coords="405,173,443,212" href="index.php?slot=ammo" /> <area shape="rect" coords="362,216,404,256" href="index.php?slot=primary" /> <area shape="rect" coords="405,216,444,256" href="index.php?slot=secondary" /> </map> <br> <br> <p> <?php include 'db_connect.php'; if (isset($_GET["slot"])) { $slot = $_GET["slot"]; } else { $slot=startpage; }; $color1 = "#E1FAE2"; $color2 = "#ffffff"; $row_count = 0; //////////////////////////////////////////////////////////////////////////////// /////////////////////////////STARTPAGE - START////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// if ( $slot == "startpage" ) { echo "This is still in beta. If you find any bugs please send them to <a href=\"mailto:sosia@nexus-guild.eu\">Sosia</a>"; } //////////////////////////////////////////////////////////////////////////////// /////////////////////////////STARTPAGE - END//////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /////////////////////////////HEAD SLOT - START////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// elseif ( $slot == "head" ) { $sql = "SELECT * FROM $db_table WHERE for_head = '1' ORDER BY name"; $result = mysql_query ($sql,$db); echo "<table cellpadding=\"5\" cellspacing=\"0\" border=\"0\" width=\"90%\" bgcolor=\"#FFDCCC\">"; echo "<tr> <th align=\"left\">Name</th> <th align=\"left\">Effect</th> <th align=\"left\">Quality</th> <th align=\"left\">Level</th> <th align=\"left\">Colour</th> <th align=\"left\">Faction Name</th> <th align=\"left\">Faction Value</th></tr>"; while($row = mysql_fetch_array( $result )) { $row_color = ($row_count % 2) ? $color1 : $color2; // Print out the contents of each row into a table echo " <tr> <td bgcolor=\"$row_color\">" . $row["name"] . "</td> <td bgcolor=\"$row_color\">" . $row["effect"] . "</td> <td bgcolor=\"$row_color\">" . $row["quality"] . "</td> <td bgcolor=\"$row_color\">" . $row["level"] . "</td> <td bgcolor=\"$row_color\">" . $row["colour"] . "</td> <td bgcolor=\"$row_color\">" . $row["factionname"] . "</td> <td bgcolor=\"$row_color\">" . $row["factionvalue"] . "</td> </tr> "; $row_count++; } echo "</table>"; } //////////////////////////////////////////////////////////////////////////////// /////////////////////////////HEAD SLOT - END//////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /////////////////////////////CLOAK - START////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// elseif ( $slot == "cloak" ) { $sql = "SELECT * FROM $db_table WHERE for_cloak = '1' ORDER BY name"; $result = mysql_query ($sql,$db); echo "<table cellpadding=\"5\" cellspacing=\"0\" border=\"0\" width=\"90%\" bgcolor=\"#FFDCCC\">"; echo "<tr> <th align=\"left\">Name</th> <th align=\"left\">Effect</th> <th align=\"left\">Quality</th> <th align=\"left\">Level</th> <th align=\"left\">Colour</th> <th align=\"left\">Faction Name</th> <th align=\"left\">Faction Value</th></tr>"; while($row = mysql_fetch_array( $result )) { $row_color = ($row_count % 2) ? $color1 : $color2; // Print out the contents of each row into a table echo " <tr> <td bgcolor=\"$row_color\">" . $row["name"] . "</td> <td bgcolor=\"$row_color\">" . $row["effect"] . "</td> <td bgcolor=\"$row_color\">" . $row["quality"] . "</td> <td bgcolor=\"$row_color\">" . $row["level"] . "</td> <td bgcolor=\"$row_color\">" . $row["colour"] . "</td> <td bgcolor=\"$row_color\">" . $row["factionname"] . "</td> <td bgcolor=\"$row_color\">" . $row["factionvalue"] . "</td> </tr> "; $row_count++; } echo "</table>"; } //////////////////////////////////////////////////////////////////////////////// /////////////////////////////CLOAK SLOT - END//////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /////////////////////////////CHEST SLOT - START////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// elseif ( $slot == "chest" ) { $sql = "SELECT * FROM $db_table WHERE for_chest = '1' ORDER BY name"; $result = mysql_query ($sql,$db); echo "<table cellpadding=\"5\" cellspacing=\"0\" border=\"0\" width=\"90%\" bgcolor=\"#FFDCCC\">"; echo "<tr> <th align=\"left\">Name</th> <th align=\"left\">Effect</th> <th align=\"left\">Quality</th> <th align=\"left\">Level</th> <th align=\"left\">Colour</th> <th align=\"left\">Faction Name</th> <th align=\"left\">Faction Value</th></tr>"; while($row = mysql_fetch_array( $result )) { $row_color = ($row_count % 2) ? $color1 : $color2; // Print out the contents of each row into a table echo " <tr> <td bgcolor=\"$row_color\">" . $row["name"] . "</td> <td bgcolor=\"$row_color\">" . $row["effect"] . "</td> <td bgcolor=\"$row_color\">" . $row["quality"] . "</td> <td bgcolor=\"$row_color\">" . $row["level"] . "</td> <td bgcolor=\"$row_color\">" . $row["colour"] . "</td> <td bgcolor=\"$row_color\">" . $row["factionname"] . "</td> <td bgcolor=\"$row_color\">" . $row["factionvalue"] . "</td> </tr> "; $row_count++; } echo "</table>"; } //////////////////////////////////////////////////////////////////////////////// /////////////////////////////CHEST SLOT - END//////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /////////////////////////////SHOULDERS SLOT - START////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// elseif ( $slot == "shoulders" ) { $sql = "SELECT * FROM $db_table WHERE for_shoulders = '1' ORDER BY name"; $result = mysql_query ($sql,$db); echo "<table cellpadding=\"5\" cellspacing=\"0\" border=\"0\" width=\"90%\" bgcolor=\"#FFDCCC\">"; echo "<tr> <th align=\"left\">Name</th> <th align=\"left\">Effect</th> <th align=\"left\">Quality</th> <th align=\"left\">Level</th> <th align=\"left\">Colour</th> <th align=\"left\">Faction Name</th> <th align=\"left\">Faction Value</th></tr>"; while($row = mysql_fetch_array( $result )) { $row_color = ($row_count % 2) ? $color1 : $color2; // Print out the contents of each row into a table echo " <tr> <td bgcolor=\"$row_color\">" . $row["name"] . "</td> <td bgcolor=\"$row_color\">" . $row["effect"] . "</td> <td bgcolor=\"$row_color\">" . $row["quality"] . "</td> <td bgcolor=\"$row_color\">" . $row["level"] . "</td> <td bgcolor=\"$row_color\">" . $row["colour"] . "</td> <td bgcolor=\"$row_color\">" . $row["factionname"] . "</td> <td bgcolor=\"$row_color\">" . $row["factionvalue"] . "</td> </tr> "; $row_count++; } echo "</table>"; } //////////////////////////////////////////////////////////////////////////////// /////////////////////////////SHOULDERS SLOT - END//////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /////////////////////////////FOREARMS SLOT - START////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// elseif ( $slot == "forearms" ) { $sql = "SELECT * FROM $db_table WHERE for_forearms = '1' ORDER BY name"; $result = mysql_query ($sql,$db); echo "<table cellpadding=\"5\" cellspacing=\"0\" border=\"0\" width=\"90%\" bgcolor=\"#FFDCCC\">"; echo "<tr> <th align=\"left\">Name</th> <th align=\"left\">Effect</th> <th align=\"left\">Quality</th> <th align=\"left\">Level</th> <th align=\"left\">Colour</th> <th align=\"left\">Faction Name</th> <th align=\"left\">Faction Value</th></tr>"; while($row = mysql_fetch_array( $result )) { $row_color = ($row_count % 2) ? $color1 : $color2; // Print out the contents of each row into a table echo " <tr> <td bgcolor=\"$row_color\">" . $row["name"] . "</td> <td bgcolor=\"$row_color\">" . $row["effect"] . "</td> <td bgcolor=\"$row_color\">" . $row["quality"] . "</td> <td bgcolor=\"$row_color\">" . $row["level"] . "</td> <td bgcolor=\"$row_color\">" . $row["colour"] . "</td> <td bgcolor=\"$row_color\">" . $row["factionname"] . "</td> <td bgcolor=\"$row_color\">" . $row["factionvalue"] . "</td> </tr> "; $row_count++; } echo "</table>"; } //////////////////////////////////////////////////////////////////////////////// /////////////////////////////FOREARMS SLOT - END//////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /////////////////////////////LEGS SLOT - START////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// elseif ( $slot == "legs" ) { $sql = "SELECT * FROM $db_table WHERE for_legs = '1' ORDER BY name"; $result = mysql_query ($sql,$db); echo "<table cellpadding=\"5\" cellspacing=\"0\" border=\"0\" width=\"90%\" bgcolor=\"#FFDCCC\">"; echo "<tr> <th align=\"left\">Name</th> <th align=\"left\">Effect</th> <th align=\"left\">Quality</th> <th align=\"left\">Level</th> <th align=\"left\">Colour</th> <th align=\"left\">Faction Name</th> <th align=\"left\">Faction Value</th></tr>"; while($row = mysql_fetch_array( $result )) { $row_color = ($row_count % 2) ? $color1 : $color2; // Print out the contents of each row into a table echo " <tr> <td bgcolor=\"$row_color\">" . $row["name"] . "</td> <td bgcolor=\"$row_color\">" . $row["effect"] . "</td> <td bgcolor=\"$row_color\">" . $row["quality"] . "</td> <td bgcolor=\"$row_color\">" . $row["level"] . "</td> <td bgcolor=\"$row_color\">" . $row["colour"] . "</td> <td bgcolor=\"$row_color\">" . $row["factionname"] . "</td> <td bgcolor=\"$row_color\">" . $row["factionvalue"] . "</td> </tr> "; $row_count++; } echo "</table>"; } //////////////////////////////////////////////////////////////////////////////// /////////////////////////////LEGS SLOT - END//////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /////////////////////////////HANDS SLOT - START////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// elseif ( $slot == "hands" ) { $sql = "SELECT * FROM $db_table WHERE for_hands = '1' ORDER BY name"; $result = mysql_query ($sql,$db); echo "<table cellpadding=\"5\" cellspacing=\"0\" border=\"0\" width=\"90%\" bgcolor=\"#FFDCCC\">"; echo "<tr> <th align=\"left\">Name</th> <th align=\"left\">Effect</th> <th align=\"left\">Quality</th> <th align=\"left\">Level</th> <th align=\"left\">Colour</th> <th align=\"left\">Faction Name</th> <th align=\"left\">Faction Value</th></tr>"; while($row = mysql_fetch_array( $result )) { $row_color = ($row_count % 2) ? $color1 : $color2; // Print out the contents of each row into a table echo " <tr> <td bgcolor=\"$row_color\">" . $row["name"] . "</td> <td bgcolor=\"$row_color\">" . $row["effect"] . "</td> <td bgcolor=\"$row_color\">" . $row["quality"] . "</td> <td bgcolor=\"$row_color\">" . $row["level"] . "</td> <td bgcolor=\"$row_color\">" . $row["colour"] . "</td> <td bgcolor=\"$row_color\">" . $row["factionname"] . "</td> <td bgcolor=\"$row_color\">" . $row["factionvalue"] . "</td> </tr> "; $row_count++; } echo "</table>"; } //////////////////////////////////////////////////////////////////////////////// /////////////////////////////HANDS SLOT - END//////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /////////////////////////////FEET SLOT - START////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// elseif ( $slot == "feet" ) { $sql = "SELECT * FROM $db_table WHERE for_feet = '1' ORDER BY name"; $result = mysql_query ($sql,$db); echo "<table cellpadding=\"5\" cellspacing=\"0\" border=\"0\" width=\"90%\" bgcolor=\"#FFDCCC\">"; echo "<tr> <th align=\"left\">Name</th> <th align=\"left\">Effect</th> <th align=\"left\">Quality</th> <th align=\"left\">Level</th> <th align=\"left\">Colour</th> <th align=\"left\">Faction Name</th> <th align=\"left\">Faction Value</th></tr>"; while($row = mysql_fetch_array( $result )) { $row_color = ($row_count % 2) ? $color1 : $color2; // Print out the contents of each row into a table echo " <tr> <td bgcolor=\"$row_color\">" . $row["name"] . "</td> <td bgcolor=\"$row_color\">" . $row["effect"] . "</td> <td bgcolor=\"$row_color\">" . $row["quality"] . "</td> <td bgcolor=\"$row_color\">" . $row["level"] . "</td> <td bgcolor=\"$row_color\">" . $row["colour"] . "</td> <td bgcolor=\"$row_color\">" . $row["factionname"] . "</td> <td bgcolor=\"$row_color\">" . $row["factionvalue"] . "</td> </tr> "; $row_count++; } echo "</table>"; } //////////////////////////////////////////////////////////////////////////////// /////////////////////////////FEET SLOT - END//////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /////////////////////////////WAIST SLOT - START////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// elseif ( $slot == "waist" ) { $sql = "SELECT * FROM $db_table WHERE for_waist = '1' ORDER BY name"; $result = mysql_query ($sql,$db); echo "<table cellpadding=\"5\" cellspacing=\"0\" border=\"0\" width=\"90%\" bgcolor=\"#FFDCCC\">"; echo "<tr> <th align=\"left\">Name</th> <th align=\"left\">Effect</th> <th align=\"left\">Quality</th> <th align=\"left\">Level</th> <th align=\"left\">Colour</th> <th align=\"left\">Faction Name</th> <th align=\"left\">Faction Value</th></tr>"; while($row = mysql_fetch_array( $result )) { $row_color = ($row_count % 2) ? $color1 : $color2; // Print out the contents of each row into a table echo " <tr> <td bgcolor=\"$row_color\">" . $row["name"] . "</td> <td bgcolor=\"$row_color\">" . $row["effect"] . "</td> <td bgcolor=\"$row_color\">" . $row["quality"] . "</td> <td bgcolor=\"$row_color\">" . $row["level"] . "</td> <td bgcolor=\"$row_color\">" . $row["colour"] . "</td> <td bgcolor=\"$row_color\">" . $row["factionname"] . "</td> <td bgcolor=\"$row_color\">" . $row["factionvalue"] . "</td> </tr> "; $row_count++; } echo "</table>"; } //////////////////////////////////////////////////////////////////////////////// /////////////////////////////WAIST SLOT - END//////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /////////////////////////////NECK SLOT - START////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// elseif ( $slot == "neck" ) { $sql = "SELECT * FROM $db_table WHERE for_head = '1' ORDER BY name"; $result = mysql_query ($sql,$db); echo "<table cellpadding=\"5\" cellspacing=\"0\" border=\"0\" width=\"90%\" bgcolor=\"#FFDCCC\">"; echo "<tr> <th align=\"left\">Name</th> <th align=\"left\">Effect</th> <th align=\"left\">Quality</th> <th align=\"left\">Level</th> <th align=\"left\">Colour</th> <th align=\"left\">Faction Name</th> <th align=\"left\">Faction Value</th></tr>"; while($row = mysql_fetch_array( $result )) { $row_color = ($row_count % 2) ? $color1 : $color2; // Print out the contents of each row into a table echo " <tr> <td bgcolor=\"$row_color\">" . $row["name"] . "</td> <td bgcolor=\"$row_color\">" . $row["effect"] . "</td> <td bgcolor=\"$row_color\">" . $row["quality"] . "</td> <td bgcolor=\"$row_color\">" . $row["level"] . "</td> <td bgcolor=\"$row_color\">" . $row["colour"] . "</td> <td bgcolor=\"$row_color\">" . $row["factionname"] . "</td> <td bgcolor=\"$row_color\">" . $row["factionvalue"] . "</td> </tr> "; $row_count++; } echo "</table>"; } //////////////////////////////////////////////////////////////////////////////// /////////////////////////////NECK SLOT - END//////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /////////////////////////////EAR SLOT - START////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// elseif ( $slot == "ear" ) { $sql = "SELECT * FROM $db_table WHERE for_head = '1' ORDER BY name"; $result = mysql_query ($sql,$db); echo "<table cellpadding=\"5\" cellspacing=\"0\" border=\"0\" width=\"90%\" bgcolor=\"#FFDCCC\">"; echo "<tr> <th align=\"left\">Name</th> <th align=\"left\">Effect</th> <th align=\"left\">Quality</th> <th align=\"left\">Level</th> <th align=\"left\">Colour</th> <th align=\"left\">Faction Name</th> <th align=\"left\">Faction Value</th></tr>"; while($row = mysql_fetch_array( $result )) { $row_color = ($row_count % 2) ? $color1 : $color2; // Print out the contents of each row into a table echo " <tr> <td bgcolor=\"$row_color\">" . $row["name"] . "</td> <td bgcolor=\"$row_color\">" . $row["effect"] . "</td> <td bgcolor=\"$row_color\">" . $row["quality"] . "</td> <td bgcolor=\"$row_color\">" . $row["level"] . "</td> <td bgcolor=\"$row_color\">" . $row["colour"] . "</td> <td bgcolor=\"$row_color\">" . $row["factionname"] . "</td> <td bgcolor=\"$row_color\">" . $row["factionvalue"] . "</td> </tr> "; $row_count++; } echo "</table>"; } //////////////////////////////////////////////////////////////////////////////// /////////////////////////////EAR SLOT - END//////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /////////////////////////////FINGER SLOT - START////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// elseif ( $slot == "finger" ) { $sql = "SELECT * FROM $db_table WHERE for_finger = '1' ORDER BY name"; $result = mysql_query ($sql,$db); echo "<table cellpadding=\"5\" cellspacing=\"0\" border=\"0\" width=\"90%\" bgcolor=\"#FFDCCC\">"; echo "<tr> <th align=\"left\">Name</th> <th align=\"left\">Effect</th> <th align=\"left\">Quality</th> <th align=\"left\">Level</th> <th align=\"left\">Colour</th> <th align=\"left\">Faction Name</th> <th align=\"left\">Faction Value</th></tr>"; while($row = mysql_fetch_array( $result )) { $row_color = ($row_count % 2) ? $color1 : $color2; // Print out the contents of each row into a table echo " <tr> <td bgcolor=\"$row_color\">" . $row["name"] . "</td> <td bgcolor=\"$row_color\">" . $row["effect"] . "</td> <td bgcolor=\"$row_color\">" . $row["quality"] . "</td> <td bgcolor=\"$row_color\">" . $row["level"] . "</td> <td bgcolor=\"$row_color\">" . $row["colour"] . "</td> <td bgcolor=\"$row_color\">" . $row["factionname"] . "</td> <td bgcolor=\"$row_color\">" . $row["factionvalue"] . "</td> </tr> "; $row_count++; } echo "</table>"; } //////////////////////////////////////////////////////////////////////////////// /////////////////////////////FINGER SLOT - END//////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// /////////////////////////////WRIST SLOT - START////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// elseif ( $slot == "wrist" ) { $sql = "SELECT * FROM $db_table WHERE for_head = '1' ORDER BY name"; $result = mysql_query ($sql,$db); echo "<table cellpadding=\"5\" cellspacing=\"0\" border=\"0\" width=\"90%\" bgcolor=\"#FFDCCC\">"; echo "<tr> <th align=\"left\">Name</th> <th align=\"left\">Effect</th> <th align=\"left\">Quality</th> <th align=\"left\">Level</th> <th align=\"left\">Colour</th> <th align=\"left\">Faction Name</th> <th align=\"left\">Faction Value</th></tr>"; while($row = mysql_fetch_array( $result )) { $row_color = ($row_count % 2) ? $color1 : $color2; // Print out the contents of each row into a table echo " <tr> <td bgcolor=\"$row_color\">" . $row["name"] . "</td> <td bgcolor=\"$row_color\">" . $row["effect"] . "</td> <td bgcolor=\"$row_color\">" . $row["quality"] . "</td> <td bgcolor=\"$row_color\">" . $row["level"] . "</td> <td bgcolor=\"$row_color\">" . $row["colour"] . "</td> <td bgcolor=\"$row_color\">" . $row["factionname"] . "</td> <td bgcolor=\"$row_color\">" . $row["factionvalue"] . "</td> </tr> "; $row_count++; } echo "</table>"; } //////////////////////////////////////////////////////////////////////////////// /////////////////////////////WRIST SLOT - END//////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /////////////////////////////CHARM SLOT - START////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// elseif ( $slot == "charm" ) { $sql = "SELECT * FROM $db_table WHERE for_charm = '1' ORDER BY name"; $result = mysql_query ($sql,$db); echo "<table cellpadding=\"5\" cellspacing=\"0\" border=\"0\" width=\"90%\" bgcolor=\"#FFDCCC\">"; echo "<tr> <th align=\"left\">Name</th> <th align=\"left\">Effect</th> <th align=\"left\">Quality</th> <th align=\"left\">Level</th> <th align=\"left\">Colour</th> <th align=\"left\">Faction Name</th> <th align=\"left\">Faction Value</th></tr>"; while($row = mysql_fetch_array( $result )) { $row_color = ($row_count % 2) ? $color1 : $color2; // Print out the contents of each row into a table echo " <tr> <td bgcolor=\"$row_color\">" . $row["name"] . "</td> <td bgcolor=\"$row_color\">" . $row["effect"] . "</td> <td bgcolor=\"$row_color\">" . $row["quality"] . "</td> <td bgcolor=\"$row_color\">" . $row["level"] . "</td> <td bgcolor=\"$row_color\">" . $row["colour"] . "</td> <td bgcolor=\"$row_color\">" . $row["factionname"] . "</td> <td bgcolor=\"$row_color\">" . $row["factionvalue"] . "</td> </tr> "; $row_count++; } echo "</table>"; } //////////////////////////////////////////////////////////////////////////////// /////////////////////////////CHARM SLOT - END//////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /////////////////////////////PRIMARY SLOT - START////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// elseif ( $slot == "primary" ) { $sql = "SELECT * FROM $db_table WHERE for_primary = '1' ORDER BY name"; $result = mysql_query ($sql,$db); echo "<table cellpadding=\"5\" cellspacing=\"0\" border=\"0\" width=\"90%\" bgcolor=\"#FFDCCC\">"; echo "<tr> <th align=\"left\">Name</th> <th align=\"left\">Effect</th> <th align=\"left\">Quality</th> <th align=\"left\">Level</th> <th align=\"left\">Colour</th> <th align=\"left\">Faction Name</th> <th align=\"left\">Faction Value</th></tr>"; while($row = mysql_fetch_array( $result )) { $row_color = ($row_count % 2) ? $color1 : $color2; // Print out the contents of each row into a table echo " <tr> <td bgcolor=\"$row_color\">" . $row["name"] . "</td> <td bgcolor=\"$row_color\">" . $row["effect"] . "</td> <td bgcolor=\"$row_color\">" . $row["quality"] . "</td> <td bgcolor=\"$row_color\">" . $row["level"] . "</td> <td bgcolor=\"$row_color\">" . $row["colour"] . "</td> <td bgcolor=\"$row_color\">" . $row["factionname"] . "</td> <td bgcolor=\"$row_color\">" . $row["factionvalue"] . "</td> </tr> "; $row_count++; } echo "</table>"; } //////////////////////////////////////////////////////////////////////////////// /////////////////////////////PRIMARY SLOT - END//////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////SECONDARY SLOT - START////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// elseif ( $slot == "secondary" ) { $sql = "SELECT * FROM $db_table WHERE for_head = '1' ORDER BY name"; $result = mysql_query ($sql,$db); echo "<table cellpadding=\"5\" cellspacing=\"0\" border=\"0\" width=\"90%\" bgcolor=\"#FFDCCC\">"; echo "<tr> <th align=\"left\">Name</th> <th align=\"left\">Effect</th> <th align=\"left\">Quality</th> <th align=\"left\">Level</th> <th align=\"left\">Colour</th> <th align=\"left\">Faction Name</th> <th align=\"left\">Faction Value</th></tr>"; while($row = mysql_fetch_array( $result )) { $row_color = ($row_count % 2) ? $color1 : $color2; // Print out the contents of each row into a table echo " <tr> <td bgcolor=\"$row_color\">" . $row["name"] . "</td> <td bgcolor=\"$row_color\">" . $row["effect"] . "</td> <td bgcolor=\"$row_color\">" . $row["quality"] . "</td> <td bgcolor=\"$row_color\">" . $row["level"] . "</td> <td bgcolor=\"$row_color\">" . $row["colour"] . "</td> <td bgcolor=\"$row_color\">" . $row["factionname"] . "</td> <td bgcolor=\"$row_color\">" . $row["factionvalue"] . "</td> </tr> "; $row_count++; } echo "</table>"; } //////////////////////////////////////////////////////////////////////////////// /////////////////////////////SECONDARY SLOT - END//////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /////////////////////////////RANGED SLOT - START////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// elseif ( $slot == "ranged" ) { $sql = "SELECT * FROM $db_table WHERE for_head = '1' ORDER BY name"; $result = mysql_query ($sql,$db); echo "<table cellpadding=\"5\" cellspacing=\"0\" border=\"0\" width=\"90%\" bgcolor=\"#FFDCCC\">"; echo "<tr> <th align=\"left\">Name</th> <th align=\"left\">Effect</th> <th align=\"left\">Quality</th> <th align=\"left\">Level</th> <th align=\"left\">Colour</th> <th align=\"left\">Faction Name</th> <th align=\"left\">Faction Value</th></tr>"; while($row = mysql_fetch_array( $result )) { $row_color = ($row_count % 2) ? $color1 : $color2; // Print out the contents of each row into a table echo " <tr> <td bgcolor=\"$row_color\">" . $row["name"] . "</td> <td bgcolor=\"$row_color\">" . $row["effect"] . "</td> <td bgcolor=\"$row_color\">" . $row["quality"] . "</td> <td bgcolor=\"$row_color\">" . $row["level"] . "</td> <td bgcolor=\"$row_color\">" . $row["colour"] . "</td> <td bgcolor=\"$row_color\">" . $row["factionname"] . "</td> <td bgcolor=\"$row_color\">" . $row["factionvalue"] . "</td> </tr> "; $row_count++; } echo "</table>"; } //////////////////////////////////////////////////////////////////////////////// /////////////////////////////RANGED SLOT - END//////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /////////////////////////////FOOD SLOT - START////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// elseif ( $slot == "food" ) { echo "<font color=#ffffff>Dream on sunshine there aint no food adorns yet</font>"; } //////////////////////////////////////////////////////////////////////////////// /////////////////////////////FOOD SLOT - END//////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /////////////////////////////DRINK SLOT - START////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// elseif ( $slot == "drink" ) { echo "<font color=#ffffff>Dream on sunshine there aint no drink adorns yet</font>"; } //////////////////////////////////////////////////////////////////////////////// /////////////////////////////DRINK SLOT - END//////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /////////////////////////////DRINK SLOT - START////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// elseif ( $slot == "ammo" ) { echo "<font color=#ffffff>Dream on sunshine there aint no ammo adorns yet</font>"; } //////////////////////////////////////////////////////////////////////////////// /////////////////////////////DRINK SLOT - END//////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// else { echo "<font color=#ffffff>Either you have clicked something stupidly or edited the url or there is a bug with this script. You should never see this error message. If you do please contact Sosia :No Slot Choosen</font>"; } ?> </center> </body> </html>
  10. The header redirect worked great, Guess i should of tried it after reading about it. You mention possible error handlers? have you got an example of what you mean to clarify
  11. The 1 record added was actually part of a code snippet i had used that i never removed its not actually meant to be there. I guess i dint explain it very well. rather than having the page go to insert.php on submit to process it i was hoping there was a way to keep it on add.php (even though it still needs to process insert.php)I did think about using the get method instead of put but i have long variables and some things i don't want visible in the url path. I had read about the header redirect thing, However wouldn't that redirect before it processes the php in the page
  12. Hi there, I wrote a pretty simple html form that inputs data into my database. I've included a truncated version of it, There are a lot more fields. Basically when i hit the submit it processes input.php but after its been successful the page is still at input.php in the browser Is there anyway to take the page back to the page i was using to input data <form action="insert.php" method="post"> <p>Adornment Name: <br> <input type="text" name="name"> <br> <br> Quality: <br> <select name="quality"> <option value="Other">Other Not Listed</option> <option value="Superior">Superior</option> <option value="Greater">Greater</option> <option value="Lesser">Lesser</option> <option value="Raid">Raid</option> <option value="Faction">Faction</option> </select> </form> include 'db_connect.php'; $sql="INSERT INTO $db_table (name, quality) VALUES ( '$_POST[name]', '$_POST[quality]')"; if (!mysql_query($sql,$db)) { die('Error: ' . mysql_error()); } echo "1 record added"; mysql_close($db) ?>
  13. Hello there, Ive been using a forum boars software called phpbb which supports modifications. I used such one and in an attempt to remove it it went horribly wrong. Anyways i attempted to get support from the support forum for it. However it hasnt seen any hits since 2007 so i doubt i'm going to see a reply to my post there. So ive come here to ask if someone could help me solve the following. Bascially i want to remove the tables and data that was created by this mod. I have the install script which is pretty small. I was wondering if anyone could reverse it to completely remove what it installed. It was written into an install.php file but if anyone can give me just the raw sql to run it would be better. However this is the code that installed it: <?php /** * * @author Tom (Tom Catullo) tom@cortello.com * @package umil * @version $Id install_legend_repositioning.php 1.0.3 2010-02-16 17:45:00GMT Tom $ * @copyright (c) 2009 Cortello Group * @license http://opensource.org/licenses/gpl-license.php GNU Public License * */ /** * @ignore */ define('IN_PHPBB', true); $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include($phpbb_root_path . 'common.' . $phpEx); // Start session management $user->session_begin(); $auth->acl($user->data); $user->setup('mods/umil_legend_repositioning_mod'); if (!file_exists($phpbb_root_path . 'umil/umil.' . $phpEx)) { trigger_error('Please download the latest UMIL (Unified MOD Install Library) from: <a href="http://www.phpbb.com/mods/umil/">phpBB.com/mods/umil</a>', E_USER_ERROR); } // We only allow a founder to install this MOD if ($user->data['user_type'] != USER_FOUNDER) { if ($user->data['user_id'] == ANONYMOUS) { login_box('', 'LOGIN'); } trigger_error('NOT_AUTHORISED'); } if (!class_exists('umil')) { include($phpbb_root_path . 'umil/umil.' . $phpEx); } $umil = new umil(true); $mod = array( 'name' => 'Legend Repositioning', 'version' => '1.0.3', 'config' => 'legend_repositioning_version', 'enable' => 'legend_repositioning_enable', ); if (confirm_box(true)) { // Install the base 1.0.3 version if (!$umil->config_exists($mod['config'])) { // Lets add a config setting for enabling/disabling the MOD and set it to true $umil->config_add($mod['enable'], true); // We must handle the version number ourselves. $umil->config_add($mod['config'], $mod['version']); $umil->table_column_add('phpbb_groups', 'group_position', array('UINT', '0')); // Select all groups that have no set position $sql = 'SELECT group_id FROM ' . GROUPS_TABLE . ' WHERE group_position = 0'; $result = $db->sql_query($sql); // Set default positions for groups (so that all positions are not set to 0) $group_position = 0; while ($row = $db->sql_fetchrow($result)) { $group_position++; $sql = 'UPDATE ' . GROUPS_TABLE . ' SET group_position = ' . $group_position . ' WHERE group_id = ' . $row['group_id']; $db->sql_query($sql); } $db->sql_freeresult($result); // Our final action, we purge the board cache $umil->cache_purge(); } // We are done trigger_error('Done!'); } else { confirm_box(false, 'INSTALL_TEST_MOD'); } // Shouldn't get here. redirect($phpbb_root_path . $user->page['page_name']); ?> Apologies if i have posted this in the wrong area or i have not included something.
  14. Seems the NULL part was my fault i was trying to run the file directly which ran the insert sql part without any valid details. i was only then when i ran it through the web form did it work correctly. This brings me onto another question how to you stop someone directly viewing an include file and causing execution of code as ive done. I know you can use define or somethign at the top but ive only glanced at it before i have no iea how to implement.
  15. It only seems to add the date when i use the echo "Query: $query"; if i comment it out it sets it to NULL why is that i dont understand and i dont actually want it to print anything to the screen.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.