Jump to content

hyster

Members
  • Posts

    253
  • Joined

  • Last visited

Everything posted by hyster

  1. i used dreamweavers spry accordian to do a page. the panels are populated from a mysql database, each tab is a list of tanks a player owns. the list is a diffrent size for each player. im trying to make it so each panel is the height of the list ie if only 5 tanks then its 5 lines deep, 10 tanks then 10 lines deep. at the moment i can only set the height manualy in px so the data fills the tab without a scroll bar but it looks a bit daft with a short list as theres a large white space. the tabs and content are created from the database and there will be a lot more datasets added soon so it will grow pretty large. i want it to be dynamic so it fits the datasets automaticly without empty lines in a short data set and without a scroll bar in a larger 1. test page http://nbn-gaming.co...layertanks1.php if u click on the diffrent tabs u will see what i mean. thx
  2. thanks once again barand. ur a star
  3. i carnt get my head round this lol. the xml im reading is laid out like this <channel> <item> <title>data</title> <description>data</description> <link>data</link> <pubDate>data</pubDate> <guid>data</guid> </item> <item> <title>data</title> <description>data</description> <link>data</link> <pubDate>data</pubDate> <guid>data</guid> </item> <channel> using following code i get the php to loop the correct amount of times ( but the echo'd value is "item" <?php $xml = new SimpleXMLElement('http://api.wot-blackdeath.ru/wot-news/eu/wot-news.xml', null, true); echo "<table border='1'>" ; foreach($xml->channel->item as $data => $value){ ?> <tr><td>1</td><td><b> <?php echo $data ?></b></td></tr> <tr><td>2</td><td> <?php echo $data ?></td></tr> <tr><td>3</td><td> <?php echo $data ?></td></tr> <tr><td>4</td><td> <?php echo $data ?></td></tr> <tr><td>5</td><td> <?php echo $data ?></td></tr> <?php } echo "</table>"; ?>
  4. i followed the guide on this site for the rss tutorial. i altered it to what i wanted but i can not get it to loop. it will only display the first line. the tutorial says to use echo <<<EOF but they caused the script to not work. any help would be gratefull. <?php $xml = new SimpleXMLElement('http://api.wot-blackdeath.ru/wot-news/eu/wot-news.xml', null, true); echo "<table border='1'>" ; foreach($xml as $data){ // loop through our xml ?> <tr><td> <?php echo $data->title ?></td></tr> <tr><td> <?php echo $data->description ?></td></tr> <tr><td> <?php echo $data->link ?></td></tr> <tr><td> <?php echo $data->pubDate ?></td></tr> <?php } echo "</table>"; ?>
  5. thinks its a problem with the database im using as now its showing all entrys twice
  6. there can be only 1 record in tanks_own - tanks from tanks - list. currently i only have 1 record in tanks_own for testing so the same record is being displayed twice
  7. im going to get the script working as i want it then go over the code and tidy it up. ive done a lot of stuff in it ive never done before so its very untidy atm. 1st thing i tryed was to use the sql directly in phpmyadmin (echo'ed it so i got what the php was doing) and it displays the content only once. tables tanks list - country - type - name - tier tanks_own player - tanks tanks_owned - tanks and tanks - list are the columns that tie together. again im doing this on the fly so things are not so well designed and will tidy it up when i get this step sorted.
  8. im using the code below as part of a larger script but im getting each result echo twice i carnt see where i gone wrong im 99% sure the problem is in this piece but it looks fine to me. think i need fresh eyes lol. thx <?php $sql7 = "SELECT * FROM tanks JOIN tanks_own ON tanks.list = tanks_own.tanks WHERE tanks_own.player ='$player'"; $result7=mysql_query($sql7); while($row7 = mysql_fetch_array( $result7 )) { ?> <option value="<?php echo $row7['list']; ?>" selected="selected"><?php echo $row7['tier']." - ".$row7['name']; ?></option> <?php } ?> full code <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><HTML><HEAD> <?php define('IN_PHPBB', true); $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '../phpbb3/'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include($phpbb_root_path . 'common.' . $phpEx); // Start session management $user->session_begin(); $auth->acl($user->data); $user->setup(); if ($user->data['user_id'] == ANONYMOUS) { echo 'Please login!'; } else { echo 'logged in as, ' . $user->data['username_clean']; } $player = $user->data['username_clean']; //database connection details $dbname =""; $username =""; $password =""; mysql_connect("localhost", "$username", "$password") or die(mysql_error()); mysql_select_db("$dbname") or die(mysql_error()); //do not edit below ?> </p> <p> </p> <form id="form1" name="form1" method="POST" action="list.php"> <div align="center"> <table width="200" border="1"> <tr> <td>UK</td> <td>USA</td> <td>German</td> <td>Soviet</td> <td>French</td> <td>Chinese</td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td><label> <input name="country[]" type="checkbox" id="country" value="uk" /></label></td> <td><input name="country[]" type="checkbox" id="country" value="usa"/></td> <td><input name="country[]" type="checkbox" id="country" value="german" /></td> <td><input name="country[]" type="checkbox" id="country" value="soviet" /></td> <td><input name="country[]" type="checkbox" id="country" value="french" /></td> <td><input name="country[]" type="checkbox" id="country" value="chinese" /></td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td>Light</td> <td>Medium</td> <td>Heavy</td> <td>TD</td> <td>SPG</td> </td> </tr> <tr> <td><input name="type[]" type="checkbox" id="type" value="light" /></td> <td><input name="type[]" type="checkbox" id="type" value="medium" /></td> <td><input name="type[]" type="checkbox" id="type" value="heavy" /></td> <td><input name="type[]" type="checkbox" id="type" value="td" /></td> <td><input name="type[]" type="checkbox" id="type" value="spg" /></td> </tr> <tr> <td>1</td> <td>2</td> <td>3</td> <td>4</td> <td>5</td> <td>6</td> <td>7</td> <td>8</td> <td>9</td> <td>10</td> </tr> <tr> <td><input name="tier[]" type="checkbox" value="I" /></td> <td><input name="tier[]" type="checkbox" value="II" /></td> <td><input name="tier[]" type="checkbox" value="III" /></td> <td><input name="tier[]" type="checkbox" value="IV" /></td> <td><input name="tier[]" type="checkbox" value="V" /></td> <td><input name="tier[]" type="checkbox" value="VI" /></td> <td><input name="tier[]" type="checkbox" value="VII" /></td> <td><input name="tier[]" type="checkbox" value="VIII" /></td> <td><input name="tier[]" type="checkbox" value="IX" /></td> <td><input name="tier[]" type="checkbox" value="X" /></td> </tr> <tr><td><input type="submit" id="submit" /></td> </tr></table> </div> </form> <p> </p> <div align="center"> <SCRIPT type="text/javascript" src="mixed2b.js"></SCRIPT> <SCRIPT type="text/javascript"> window.onload = setSubmitDebugOuput; function setSubmitDebugOuput() { document.getElementById('divOutput').innerHTML = window.location.search; } // Technique 1 function placeInHidden(delim, selStr, hidStr) { var selObj = document.getElementById(selStr); var hideObj = document.getElementById(hidStr); hideObj.value = ''; for (var i=0; i<selObj.options.length; i++) { hideObj.value = hideObj.value == '' ? selObj.options[i].value : hideObj.value + delim + selObj.options[i].value; } } // Technique 2 function selectAllOptions(selStr) { var selObj = document.getElementById(selStr); for (var i=0; i<selObj.options.length; i++) { selObj.options[i].selected = true; } } //--> </SCRIPT> <SCRIPT type="text/javascript"> _uacct = "UA-83058-1"; urchinTracker(); </SCRIPT> <META name="GENERATOR" content="MSHTML 9.00.8112.16457"></HEAD> <BODY> <DIV id="content"> <DIV id="innercontent"> <P></P> <TABLE border="0" align="center"> <TBODY> <TR> <TD> Hidden field<BR> <FORM onsubmit="placeInHidden('.', 'sel3', 'hide2');" method="post" action="insert_tanks.php"><SELECT id="sel3" multiple="multiple" size="5"> <?php $whereclause = ''; $where = array(); if (isset($_POST['country'])) { $countrylist = join ("','", $_POST['country']); $where[] = "(country IN ('$countrylist'))"; } if (isset($_POST['type'])) { $typelist = join ("','", $_POST['type']); $where[] = "(type IN ('$typelist'))"; } if (isset($_POST['tier'])) { $tierlist = join ("','", $_POST['tier']); $where[] = "(tier IN ('$tierlist'))"; } if (count($where) > 0) $whereclause = 'WHERE ' . join(' AND ', $where); $sql = "SELECT * FROM tanks $whereclause"; $result=mysql_query($sql); while($row = mysql_fetch_array( $result )) { ?> <option value="<?php echo $row['list']; ?>"><?php echo $row['tier']." - ".$row['name']; ?></option> <?php } ?> </SELECT><INPUT id="hide2" name="hide2Name" type="hidden"><BR></FORM></TD> <TD vAlign="middle" align="center"> <FORM><INPUT onclick="moveOptions(document.getElementById('sel3'), document.getElementById('sel4'));" value="-->" type="button"><BR><INPUT onclick="moveOptions(document.getElementById('sel4'), document.getElementById('sel3'));" value="<--" type="button"></FORM></TD> <TD> <FORM onsubmit="selectAllOptions('sel4');" method="get" action="insert_tank.php"> Auto-select<BR><SELECT id="sel4" multiple="multiple" size="5" name="sel[]"> <?php $sql7 = "SELECT * FROM tanks JOIN tanks_own ON tanks.list = tanks_own.tanks WHERE tanks_own.player ='$player'"; $result7=mysql_query($sql7); while($row7 = mysql_fetch_array( $result7 )) { ?> <option value="<?php echo $row7['list']; ?>" selected="selected"><?php echo $row7['tier']." - ".$row7['name']; ?></option> <?php } ?> </SELECT><BR><INPUT value="Submit" type="submit"> <label> <input name="player" type="hidden" id="player" value="<?php echo $player; ?>" /> </label> </FORM></TD></TR> </TBODY></TABLE> </DIV></DIV> </BODY></HTML>
  9. cheers david. got what i wanted using SELECT* FROM tanks JOIN tanks_own ON tanks.list = tanks_own.tanks WHERE tanks_own.player ='hyster' LIMIT 0 , 30 i been up since 7am yesterday and not thinking stright and i should use a better layout for my database bt im doing what i need a step at a time thne adding bits asi go lol
  10. i have 2 tables tanks list - country - type - name - tier tanks_own player - tanks list and tanks tie both the tables together. what i want to do is search "tanks_own" for a player, get the "tanks" value then search "tanks list" for "tanks_own tanks" result. SELECT * FROM tanks WHERE tanks IN (SELECT * FROM tanks_own WHERE player = 'hyster'
  11. from what ive read i need to pass the array from the form as ( name="sel[]" ) which results in .php?sel%5B%5D=225&sel%5B%5D=227&sel%5B%5D=232 if i remove the [] i get .php?sel=225&sel=227&sel=232 and can only get the last entry. from what i understand the %5B%5D represents the [] in the url. ive removed most of the php and left the java out as this part works ok. <FORM onsubmit="placeInHidden('.', 'sel3', 'hide2');" method="get" action="insert_tanks.php"><SELECT id="sel3" multiple="multiple" size="5"> <?php ?> <option value="<?php echo $row['list']; ?>"><?php echo $row['tier']." - ".$row['name']; ?></option> </SELECT><INPUT id="hide2" name="hide2Name" type="hidden"><BR></FORM></TD> <TD vAlign="middle" align="center"> <FORM><INPUT onclick="moveOptions(document.getElementById('sel3'), document.getElementById('sel4'));" value="-->" type="button"><BR><INPUT onclick="moveOptions(document.getElementById('sel4'), document.getElementById('sel3'));" value="<--" type="button"></FORM></TD> <TD> <FORM onsubmit="selectAllOptions('sel4');" method="get" action="insert_tank.php"> Auto-select<BR><SELECT id="sel4" multiple="multiple" size="5" name="sel"></SELECT><BR><INPUT value="Submit" type="submit"></FORM>
  12. i have a form that im trying to pass an array that can be a diffrent amount off values. the get string is .php?sel%5B%5D=225&sel%5B%5D=227&sel%5B%5D=232 the values need to be stored in a DB and used at a later date in another page to pull the data back so i need to pull it back out so i can loop the sql (select from database where id = 'array'). the code im trying to use to use the data is (just want to get the data atm) echo 'Hello ' . htmlspecialchars($_GET["sel"]) . '!' but i get an error htmlspecialchars() expects parameter 1 to be string. ive never had to work with an array this way and im pulling my hair out thanks
  13. this is a script i did using php,html and js. the php works to select the data into the 1st column and theres a button to move selected data from col1 to col 2 where i want to submit it to a database. the problem im having (as far as im aware anyway) is this line. <option selected="selected"></option> the data that is moved from col1 to col2 will not pass to the insert page (tested using get). but if i use <option selected="selected"></option> <option>test data</option> the "test data" is passed to the next page. the question is how do i get the data that is passed to col2 using JS to be passed to the insert script ?? <p> </p> <div align="center"> <form id="form2" name="form2" method="get" action="new.php"> <TABLE align="center"> <tr> <td>col 1</td> <td></td> <td>col 2</td></tr> <TR> <TD> <select size="5" name="lstBox" id="lstBox"> <option value="II - ICruiser Mk. I">ICruiser Mk. I</option> <option value="II - ICruiser Mk. ">ICruiser Mk. </option> <option value="II - ICruiser Mk. ">ICruiser Mk. </option> <option value="II - Cruiser Mk. I "> Cruiser Mk. I </option> <option value="IV - IV- Covenanter ">IV- Covenanter </option> <option value="IV - IV- Valentine ">IV- Valentine </option> <option value="V - Crusader ">Crusader </option> </select> </TD> <TD> <input name="add" type="button" value="Add" onclick="FirstListBox();" /> <input name="remove" type="button" value="Remove" onclick="SecondListBox();"/> </TD> <TD> <select name="ListBox1" size="5" multiple="multiple" id="ListBox1"> <option selected="selected"></option> </select> </TD> <TR> <TD> </TD> <TD><input type="submit" id="submit2" value="Update" /></TD> <TD> </TD></tr> </TABLE> </form> <SCRIPT type="text/javascript"> <!-- function SecListBox(ListBox,text,value) { try { var option=document.createElement("OPTION"); option.value=value; option.text=text; ListBox.options.add(option) } catch(er) { alert(er) } } function OutPut(){ for (var s=document.getElementById("ListBox1"),txt='',z0=0;z0<s.length;z0++){ txt+=s.options[z0].value+':'; } document.getElementById('ip').value=txt; } function FirstListBox(){ var count=document.getElementById("lstBox").options.length; for(var i=0;i<count;i++){ if(document.getElementById("lstBox").options[i].selected){ SecListBox(document.getElementById("ListBox1"),document.getElementById("lstBox").options[i].value,document.getElementById("lstBox").options[i].value);document.getElementById("lstBox").remove(i); break } } OutPut(); } function SortAllItems(){ var arr=new Array(); for(i=0;i<document.getElementById("lstBox").options.length;i++) { arr[i]=document.getElementById("lstBox").options[i].value}arr.sort(); RemoveAll(); for(var i=0;i<arr.length;i++){ SecListBox(document.getElementById("lstBox"),arr[i],arr[i])}}function RemoveAll(){try{document.getElementById("lstBox").options.length=0 } catch(er){ alert(er) } } function SecondListBox(){ var count=document.getElementById("ListBox1").options.length; for(var i=0;i<count;i++){ if(document.getElementById("ListBox1").options[i].selected){SecListBox(document.getElementById("lstBox"),document.getElementById("ListBox1").options[i].value,document.getElementById("ListBox1").options[i].value);document.getElementById("ListBox1").remove(i); break } } SortAllItems() OutPut(); } //--> </SCRIPT> </body> </html>
  14. thx for the help barand. much appreciate your time and help
  15. its still not picking up the values. i try to echo the post and/or get and nothing echo's when i try _get i get this in the url tier%5B1%5D=I&tier%5B2%5D=II&tier%5B3%5D=III </p> <p> </p> <form id="form1" name="form1" method="post" action="ttl.php"> <div align="center"> <table width="200" border="1"> <tr> <td>UK</td> <td>USA</td> <td>German</td> <td>Russ</td> <td>French</td> <td>Chinese</td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td><label> <input name="country[1]" type="checkbox" id="country[1]" value="uk" /></label></td> <td><input name="country[2]" type="checkbox" id="country[2]" value="usa"/></td> <td><input name="country[3]" type="checkbox" id="country[3]" value="german" /></td> <td><input name="country[4]" type="checkbox" id="country[4]" value="russian" /></td> <td><input name="country[5]" type="checkbox" id="country[5]" value="french" /></td> <td><input name="country[6]" type="checkbox" id="country[6]" value="chinese" /></td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td>Light</td> <td>Medium</td> <td>Heavy</td> <td>TD</td> <td>SPG</td> <td colspan="5" rowspan="2"> </td> </tr> <tr> <td><input name="type[1]" type="checkbox" id="type[1]" value="light" /></td> <td><input name="type[2]" type="checkbox" id="type[2]" value="medium" /></td> <td><input name="type[3]" type="checkbox" id="type[3]" value="heavy" /></td> <td><input name="type[4]" type="checkbox" id="type[4]" value="td" /></td> <td><input name="type[5]" type="checkbox" id="type[5]" value="spg" /></td> </tr> <tr> <td>1</td> <td>2</td> <td>3</td> <td>4</td> <td>5</td> <td>6</td> <td>7</td> <td>8</td> <td>9</td> <td>10</td> </tr> <tr> <td><input name="tier[1]" type="checkbox" id="t1" value="I" /></td> <td><input name="tier[2]" type="checkbox" id="t2" value="II" /></td> <td><input name="tier[3]" type="checkbox" id="t3" value="III" /></td> <td><input name="tier[4]" type="checkbox" id="t4" value="IV" /></td> <td><input name="tier[5]" type="checkbox" id="t5" value="V" /></td> <td><input name="tier[6]" type="checkbox" id="t6" value="VI" /></td> <td><input name="tier[7]" type="checkbox" id="t7" value="VII" /></td> <td><input name="tier[8]" type="checkbox" id="t8" value="VIII" /></td> <td><input name="tier[9]" type="checkbox" id="t9" value="IX" /></td> <td><input name="tier[10]" type="checkbox" id="t10" value="X" /></td> </tr> <tr><td><input type="submit" id="submit" /></td> </tr></table> </div> </form> <p> </p> <div align="center"> <TABLE> <tr> <td>col 1</td> <td></td> <td>col 2</td></tr> <TR> <TD> <select size="5" name="lstBox" id="lstBox"> <?php $whereclause = ''; $where = array(); if (isset($_post['country'])) { $countrylist = join ("','", $_post['country']); $where[] = "(country IN ('$countrylist'))"; } if (isset($_post['type'])) { $typelist = join ("','", $_post['type']); $where[] = "(type IN ('$typelist'))"; } if (isset($_post['tier'])) { $tierlist = join ("','", $_post["tier"]); $where[] = "(tier IN ('$tierlist'))"; } if (count($where) > 0) $whereclause = 'WHERE ' . join(' AND ', $where); $sql = "SELECT * FROM tanks $whereclause"; $result1=mysql_query($sql); while($row = mysql_fetch_array( $result1 )) { ?> <option value="<?php echo $row['tier']." - ".$row['name']; ?>"><?php echo $row['name']; ?></option> <?php // close while loop } ?> </select> </TD> <TD> <div align="center"> <input name="add" type="button" value="Add" onclick="FirstListBox();" /> <input name="remove" type="button" value="Remove" onclick="SecondListBox();"/> </div></TD> <TD> <select size="5" name="ListBox1" id="ListBox1"> </select> </TD> </TABLE> </form>
  16. ok so i got this far with no errors but the post data is not posting or being read. i tryed using get as well to see if its being sent and it is. the get reads as == ttl.php?country=uk&country=usa&type=td&type=spg&tier=I&tier=V&tier=X i carnt see where ive gone wrong the form at the bottom is incomplete as i removed most of the rest of the code. </p> <p> </p> <form id="form1" name="form1" method="post" action="ttl.php"> <div align="center"> <table width="200" border="1"> <tr> <td>UK</td> <td>USA</td> <td>German</td> <td>Russ</td> <td>French</td> <td>Chinese</td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td><label> <input name="country" type="checkbox" id="country" value="uk" /></label></td> <td><input name="country" type="checkbox" id="country" value="usa"/></td> <td><input name="country" type="checkbox" id="country" value="german" /></td> <td><input name="country" type="checkbox" id="country" value="russian" /></td> <td><input name="country" type="checkbox" id="country" value="french" /></td> <td><input name="country" type="checkbox" id="country" value="chinese" /></td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td>Light</td> <td>Medium</td> <td>Heavy</td> <td>TD</td> <td>SPG</td> <td colspan="5" rowspan="2"> </td> </tr> <tr> <td><input name="type" type="checkbox" id="type" value="light" /></td> <td><input name="type" type="checkbox" id="type" value="medium" /></td> <td><input name="type" type="checkbox" id="type" value="heavy" /></td> <td><input name="type" type="checkbox" id="type" value="td" /></td> <td><input name="type" type="checkbox" id="type" value="spg" /></td> </tr> <tr> <td>1</td> <td>2</td> <td>3</td> <td>4</td> <td>5</td> <td>6</td> <td>7</td> <td>8</td> <td>9</td> <td>10</td> </tr> <tr> <td><input name="tier" type="checkbox" id="t1" value="I" /></td> <td><input name="tier" type="checkbox" id="t2" value="II" /></td> <td><input name="tier" type="checkbox" id="t3" value="III" /></td> <td><input name="tier" type="checkbox" id="t4" value="IV" /></td> <td><input name="tier" type="checkbox" id="t5" value="V" /></td> <td><input name="tier" type="checkbox" id="t6" value="VI" /></td> <td><input name="tier" type="checkbox" id="t7" value="VII" /></td> <td><input name="tier" type="checkbox" id="t8" value="VIII" /></td> <td><input name="tier" type="checkbox" id="t9" value="IX" /></td> <td><input name="tier" type="checkbox" id="t10" value="X" /></td> </tr> <tr><td><input type="submit" id="submit" /></td> </tr></table> </div> </form> <p> </p> <div align="center"> <TABLE> <tr> <td>col 1</td> <td></td> <td>col 2</td></tr> <TR> <TD> <select size="5" name="lstBox" id="lstBox"> <?php $whereclause = ''; $where = array(); if (isset($_post['country'])) { $countrylist = join ("','", $_post['country']); $where[] = "(country IN ('$countryList'))"; } if (isset($_post['type'])) { $typelist = join ("','", $_post['type']); $where[] = "(type IN ('$typeList'))"; } if (isset($_post['tier'])) { $tierlist = join ("','", $_post["tier"]); $where[] = "(tier IN ('$tierList'))"; } if (count($where) > 0) $whereclause = 'WHERE ' . join(' AND ', $where); $sql = "SELECT * FROM tanks $whereclause"; $result1=mysql_query($sql); while($row = mysql_fetch_array( $result1 )) { ?> <option value="<?php echo $row['tier']." - ".$row['name']; ?>"><?php echo $row['name']; ?></option> <?php // close while loop } ?> </select> </TD> <TD> <div align="center"> <input name="add" type="button" value="Add" onclick="FirstListBox();" /> <input name="remove" type="button" value="Remove" onclick="SecondListBox();"/> </div></TD> <TD> <select size="5" name="ListBox1" id="ListBox1"> </select> </TD> </TABLE> </form>
  17. so can i also extend it like this? if (isset($_POST['country'])) { if (isset($_POST['type'])) { if (isset($_POST['tier'])) { $countryList = join ("','", $_POST['country']); $typeList = join ("','", $_POST['type']); $tierList = join ("','", $_POST['tier']); $sql = "SELECT whatever FROM tablename WHERE country IN ('$countryList') and type IN ('$typelist') and tier IN ('$tierlist')"; } } }
  18. i did say the form is incomplete. i dont want to work on it much more untill i no the query part of it is workable or if theres a better way than the way im doing it!!!!
  19. sorry. i want to be able to search for (0-6 countrys) + (0-6types) + (0-10 tiers) using tick box's (or is there a better way?). column (country ), (type ), (tier ) example1 = "french, german" + "light, td, heavy" + "10,6,3,1" example2 = "uk,usa, german" + "medium, td, heavy" + "9,6,5,4,3,1" hope this makes more sense
  20. i have a data base . layout = "id-country-type-tank-tier" i created a form using tick box's so u can search more than 1 for each of "country,type and tier" this dosent seem a good way to do this to me as i dont n how to write a query to handle this. is there a better way to be able to search for multple options for each column? thaks guys form layout (incomplete). <table width="200" border="1"> <tr> <td>UK</td> <td>USA</td> <td>Ger</td> <td>Russ</td> <td>French</td> <td>Chinese</td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td><label> <input type="checkbox" name="uk" id="uk" /> </label></td> <td><input type="checkbox" name="usa" id="usa" /></td> <td><input type="checkbox" name="german" id="german" /></td> <td><input type="checkbox" name="russ" id="russ" /></td> <td><input type="checkbox" name="french" id="french" /></td> <td><input type="checkbox" name="chinese" id="chinese" /></td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td>Light</td> <td>Medium</td> <td>Heavy</td> <td>TD</td> <td>SPG</td> <td colspan="5" rowspan="2"> </td> </tr> <tr> <td><input type="checkbox" name="light" id="light" /></td> <td><input type="checkbox" name="medium" id="medium" /></td> <td><input type="checkbox" name="heavy" id="heavy" /></td> <td><input type="checkbox" name="td" id="td" /></td> <td><input type="checkbox" name="spg" id="spg" /></td> </tr> <tr> <td>1</td> <td>2</td> <td>3</td> <td>4</td> <td>5</td> <td>6</td> <td>7</td> <td>8</td> <td>9</td> <td>10</td> </tr> <tr> <td><input type="checkbox" name="t1" id="t1" /></td> <td><input type="checkbox" name="t2" id="t2" /></td> <td><input type="checkbox" name="t3" id="t3" /></td> <td><input type="checkbox" name="t4" id="t4" /></td> <td><input type="checkbox" name="t5" id="t5" /></td> <td><input type="checkbox" name="t6" id="t6" /></td> <td><input type="checkbox" name="t7" id="t7" /></td> <td><input type="checkbox" name="t8" id="t8" /></td> <td><input type="checkbox" name="t9" id="t9" /></td> <td><input type="checkbox" name="t10" id="t10" /></td> </tr></table>
  21. massive thanks for the help guys. ill try and wade through it and make sense.
  22. this what i got so far. a friend who understands algebra more than me tryed to explain bit by bit and i tryed to code it as i went but i got lost quickly lol only thing missing is the form $bat = $_GET["battle"]; $win = $_GET["winr"]; echo "Battles :".$bat."</br>"; echo "Win Rate :".$win."%</br>"; $step1 = $bat * ($win/100); echo "Battle Won :".$step1."</br>"; $increase = 1; $step2 = $step1 * (1 + ($increase/10)); echo "</br>"; echo "</br>"; $step3 = $step2 - $win; echo $step3;
  23. is it possable to code this in php? its for a game and i want to be ale to work out how many battles i have to play to increase my winrate by 1% ive been old the equation below will do this but i have no idea how to code it. p and c comes from a html form p = Number of Battles played c = Win % w = Battles Won N = number of games need for 1% increase (w + N) = (C+1)/100 (p + N) thanks
  24. http://amp.net84.net/java/ i want to merge the 2 types of lists. the 3rd option at the top would replave the col 1 on the bottom. i want to be able to select a tank fom the top section. click add for each tank i own. so i may have 3 and some1 else may have 7. make an array of X amount of tanks. this is to be part of a larger form. hope thats more clear
  25. im very new to js and i dont no what im looking for so ill try and explain lol i dont need the code just a hint on where to start looking. im building a form 1 option is to be a drop down list where u select an option then click add which then puts the selection into a field. i want to do this a few times so i end up with an arrey of selected values. so insted of having 10 fields each with its own drop down i have 1 drop down that fills 1 field. so if u select "apple , orange" u will end up with "apple orange" in the text box hope this made sense
×
×
  • 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.