Jump to content

besly98

Members
  • Posts

    44
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

besly98's Achievements

Member

Member (2/5)

0

Reputation

  1. besly98

    mysql help

    Hi all, does anyone know of a good script or an easy way to generate a fixture list in mysql. so team 1 V team 2 and team 3V team 4 etc...
  2. i have this code, it works fine for normal refreshing... <script type="text/javascript"> var auto_refresh = setInterval( function () { $('#match_main').load('match_engin.php1?counter=<?echo $_GET['counter'];?>'); }, 10000); // refresh every 10000 milliseconds </script> but i want to add a counter, so each 10 seconds, when it reloads the DIV, it increments a counter by 1. is this possible? i have been trying for ages i cant fix it...
  3. well, instead of the following array, $s=array( "1", "2", "3", ); i want the array 1, 2, 3 to be populated by a id which is pulled out of my database.
  4. oh sorry, i stil dont understand really. this is my full code, what im trying to do is substitute the array at the top for a dynamic array from a table. can you help? $s=array( "1", "2", "3", ); $nums=sizeof($s); $days=array(); $_list=array_keys($s); $tmp_list=array_splice($_list,1,sizeof($_list)-1); $count=sizeof($tmp_list)+1; $days=array(); for($i=0;$i<$nums-1;$i++){ $days[$i]=array(); $day_list=array_merge(array($_list[0]),$tmp_list); for($j=0;$j<$count/2;$j++){ echo $s[$day_list[$j]].'V'.$s[$day_list[$count-$j-1]]."<br/>"; } //rotate$tmp_list $elm=array_shift($tmp_list); array_push($tmp_list,$elm); } print_r($days)."<br/>"; ?>
  5. hi all, how can i make this array dynamic. E.g, i want the numbers to be pulled from a database... $s=array( "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20" ); thanks in advance, i just cant work it out
  6. Hi All, can anybody tell me the code to refresh one div (only once) once the ajax code has executed. currently i can pas sin another value into a div with the code below. document.getElementById("addplayer").innerHTML = ajaxRequest.responseText; but i also wanted to refresh the content in another Div so it updates. hope this makes sense? Thanks
  7. besly98

    MYSQL Error

    hi all i am trying to pass a value into an update query in mysql but i cant seem to get it working. whta is the correct syntax for this? the code is below UPDATE `team` SET $_GET['type'] = '".$_GET['result']."' (incase you wondering) im passing the correct row name into the GET['type'] as i want that to be dynamic depending on what the user selects) Thanks
  8. hi all. I have the following code that i want to put in a loop. The problem is that i want the $_REQUEST['scorer'] to go up by one each time (ad din the counter number) so it would read $_REQUEST['scorer1' ] then the next loop $_REQUEST['scorer2'] and so on. how can i do this? $counter = 1; while ( $counter <= $_GET['goals'] ) {echo $_REQUEST['scorer']."--<br />"; $counter = $counter + 1; }
  9. Hi All, here is my basic code below. Once i call the ajax file a echo out a message how do i get it to appear in a div on the page i sent it from? <script language="javascript" type="text/javascript"> <!-- //Browser Support Code function ajaxFunctionhomescore_away(){ var ajaxRequest; // The variable that makes Ajax possible! try{ // Opera 8.0+, Firefox, Safari ajaxRequest = new XMLHttpRequest(); } catch (e){ // Internet Explorer Browsers try{ ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try{ ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ // Something went wrong alert("Your browser broke!"); return false; } } } // Create a function that will receive data sent from the server ajaxRequest.onreadystatechange = function(){ if(ajaxRequest.readyState == 4){ document.myForm_away.time.value = ajaxRequest.responseText; } } var away_score = document.getElementById('away_score').value; var matchidaway = document.getElementById('matchidaway').value; var queryString = "?away_score=" + away_score + "&matchidaway=" + matchidaway ; ajaxRequest.open("GET", "teamupdate.php" + queryString, true); ajaxRequest.send(null); } //--> </script> thanks
  10. Hi All, here is my basic code below. Once i call the ajaz file a echo out a message how do i get it to appear in a div on the page i sent it from? <script language="javascript" type="text/javascript"> <!-- //Browser Support Code function ajaxFunctionhomescore_away(){ var ajaxRequest; // The variable that makes Ajax possible! try{ // Opera 8.0+, Firefox, Safari ajaxRequest = new XMLHttpRequest(); } catch (e){ // Internet Explorer Browsers try{ ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try{ ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ // Something went wrong alert("Your browser broke!"); return false; } } } // Create a function that will receive data sent from the server ajaxRequest.onreadystatechange = function(){ if(ajaxRequest.readyState == 4){ document.myForm_away.time.value = ajaxRequest.responseText; } } var away_score = document.getElementById('away_score').value; var matchidaway = document.getElementById('matchidaway').value; var queryString = "?away_score=" + away_score + "&matchidaway=" + matchidaway ; ajaxRequest.open("GET", "teamupdate.php" + queryString, true); ajaxRequest.send(null); } //--> </script> thanks
  11. <form> <div> <h3>Band Name</h3> <input type="text" size="30" value="" id="inputString" onkeyup="lookup(this.value);" onblur="fill();" /> </div> <!-- hide our suggestion box to begin with--> <div class="suggestionsBox" id="suggestions" style="display: none;"> <img src="upArrow.png" style="position: relative; top: -18px; left: 30px;" alt="upArrow" /> <div class="suggestionList" id="autoSuggestionsList"></div> </div> </form> function lookup(inputString) { if(inputString.length == 0) { // Hide the suggestion box. $('#suggestions').hide(); } else { // post data to our php processing page and if there is a return greater than zero // show the suggestions box $.post("string_search.php", {mysearchString: ""+inputString+""}, function(data){ if(data.length >0) { $('#suggestions').show(); $('#autoSuggestionsList').html(data); } }); } } //end // if user clicks a suggestion, fill the text box. function fill(thisValue) { $('#inputString').val(thisValue); setTimeout("$('#suggestions').hide();", 200); } so basicaly i need to pass 2 bits of data to the submit form. but i cant get it to work. this is the original code.
  12. Hi All, i have used the following code on this tutorial, http://www.jeffadams.co.uk/2009/08/31/auto-suggest-with-php-jquery/ but when im querying my database, i need to send through another value as well as the search value. So basically i need to send 2 values through to the search page. I have tried many options but cant get this to work. Any ideas? Thanks
  13. hi all, below is my code, which works when updating the database, but i want to write a message out on its completion. I know you can write this to a div, but i cant get it to work. can anybody help me with this. thanks <script language="javascript" type="text/javascript"> <!-- //Browser Support Code function ajaxFunction(){ var ajaxRequest; // The variable that makes Ajax possible! try{ // Opera 8.0+, Firefox, Safari ajaxRequest = new XMLHttpRequest(); } catch (e){ // Internet Explorer Browsers try{ ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try{ ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ // Something went wrong alert("Your browser broke!"); return false; } } } // Create a function that will receive data sent from the server ajaxRequest.onreadystatechange = function(){ if(ajaxRequest.readyState == 4){ document.myForm.time.value = ajaxRequest.responseText; } xmlhttp.onreadystatechange=function() { } var welcometext = document.getElementById('welcometext').value; var queryString = "?welcometext=" + welcometext + "&teamid=" + <?echo $_GET['teamid'];?>; ajaxRequest.open("GET", "teamupdate.php" + queryString, true); ajaxRequest.send(null); } //--> </script>
  14. Hi Al, I have the following code below which will insert a value into a text box on click, but i want to clear the current vale of the input field as it inserts the new value. can anyone help? function populate (inElem) { var el = document.getElementById("country") // display in text box if (el) { // in case 'foo' does not exist el.value += " " + inElem.innerHTML } if (el2) { el2.value += inElem.innerHTML+"\n" } } Thanks in advance Jon
×
×
  • 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.