Search Results

Search found 46 results on 2 pages for 'jpro'.

Page 1/2 | 1 2  | Next Page >

  • using jquery in mysql php

    - by JPro
    I am new to using Jquery using mysql and PHP I am using the following code to pull the data. But there is not data or error displayed. JQUERY: <html> <head> <script> function doAjaxPost() { // get the form values var field_a = $("#field_a").val(); $("#loadthisimage").show(); $.ajax({ type: "POST", url: "serverscript.php", data: "ID="+field_a, success: function(resp){ $("#resposnse").html(resp); $("#loadthisimage").hide(); }, error: function(e){ alert('Error: ' + e); } }); } </script> </head> <body> <select id="field_a"> <option value="data_1">data_1</option> <option value="data_2">data_2</option> </select> <input type="button" value="Ajax Request" onClick="doAjaxPost()"> <a href="#" onClick="doAjaxPost()">Here</a> </form> <div id="resposnse"> <img src="ajax-loader.gif" style="display:none" id="loadthisimage"> </div> </body> and now serverscript.php <?php if(isset($_POST['ID'])) { $nm = $_POST['ID']; echo $nm; //insert your code here for the display. mysql_connect("localhost", "root", "pop") or die(mysql_error()); mysql_select_db("JPro") or die(mysql_error()); $result1 = mysql_query("select Name from results where ID = \"$nm\" ") or die(mysql_error()); // store the record of the "example" table into $row while($row1 = mysql_fetch_array( $result1 )) { $tc = $row1['Name']; echo $tc; } } ?>

    Read the article

  • Registering InputListener in libGDX

    - by JPRO
    I'm just getting started with libGDX and have run into a snag registering an InputListener for a button. I've gone through many examples and this code appears correct to me but the associated callback never triggers ("touched" is not printed to console). I'm just posting the code with the abstract game screen and the implementing screen. The application starts successfully with a label of "Exit" in the bottom left hand corner, but clicking the button/label does nothing. I'm guessing the fix is something simple. What am I overlooking? public abstract class GameScreen<T> implements Screen { protected final T game; protected final SpriteBatch batch; protected final Stage stage; public GameScreen(T game) { this.game = game; this.batch = new SpriteBatch(); this.stage = new Stage(0, 0, true); } @Override public final void render(float delta) { update(delta); // Clear the screen with the given RGB color (black) Gdx.gl.glClearColor(0f, 0f, 0f, 1f); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); stage.act(delta); stage.draw(); } public abstract void update(float delta); @Override public void resize(int width, int height) { stage.setViewport(width, height, true); } @Override public void show() { Gdx.input.setInputProcessor(stage); } // hide, pause, resume, dipose } public class ExampleScreen extends GameScreen<MyGame> { private TextButton exitButton; public ExampleScreen(MyGame game) { super(game); } @Override public void show() { super.show(); TextButton.TextButtonStyle buttonStyle = new TextButton.TextButtonStyle(); buttonStyle.font = Font.getFont("Origicide", 32); buttonStyle.fontColor = Color.WHITE; exitButton = new TextButton("Exit", buttonStyle); exitButton.addListener(new InputListener() { @Override public void touchUp (InputEvent event, float x, float y, int pointer, int button) { System.out.println("touched"); } }); stage.addActor(exitButton); } @Override public void update(float delta) { } }

    Read the article

  • linksys pap2t latest model

    - by JPro
    Hi guys, can anyone please tell me what is the latest version of linksys pap2t/pap2-na and does this work with any provider? I want to be able to use SIPGATE. Any ideas? Thanks.

    Read the article

  • flushing database cache in SWI-Prolog

    - by JPro
    We are using swi-prolog to run our testcases. Whenever the test starts, I am opening the connection to MYSQL database and storing the Name of the Test hat is being done and then closing the DB. These tests run for about 2 days continuously. After the tests are done, the results basically gets stored in folder in the server. There is a predicate in another prolog file that is called to update the results to the MYSQL database. The code is simple, I use odbc library and just call odbc_* predicates to connect and update the mysql by issuing direct queries. The actual problem is : If I try to call the Predicate from the same Prolog window, where the test just got completed, I get an error as updating to the DB server. Although I do not get any error in the connection. If I close the session of that prolog with halt and closing all the open prolog windows , then open an other complete new instance of Prolog and run the predicate the update goes well. I have a feeling that there is some connection reference to the MySQL DB in Prolog database. Is there any way to clear the database in prolog so that I can run the same predicate without closing any existing prolog windows? Any ideas appreciated. Thanks.

    Read the article

  • how to delete duplicates in mysql using case

    - by JPro
    Right now I am using something like this to delete duplicates in mysql table : delete t2 from my_table1 as t1, my_table1 as t2 where t1.TestCase = t2.TestCase and t2.id > t1.id; say I have a structure like this : ID TestCAse Result 1 T1 PASS 2 T2 FAIL 3 T3 FAIL 4 T3 PASS now, in the above case T3 is duplicate entry, and if I use the SQL that I mentioned above, it would delete 4th row where the result is PASS, but this is the row that I want to keep and I want row 3 to get deleted which is FAIL. Any help please? Thank you.

    Read the article

  • simple jquery fetch from mysql

    - by JPro
    I am trying to use jQuery with MYSQL and I wrote something like this : <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script> function example_ajax_request() { $('#example-placeholder').html('<p>Loading results ... <img src="ajax-loader.gif" /></p>'); $('#example-placeholder').load("loadres.php"); } </script> </head> <body> <div id="query"> <select name="show" id="box" > <option value="0">Select A Test</option> <option value="All">--All--</option> <option value="M1">Model1</option> </select> <input type="button" onclick="example_ajax_request()" value="Click Me!" /> </div> <div id="example-placeholder"> <p>Placeholding text</p> </div></body> </html> Basically I want to pass parameters to the loadres.php file. But unable to figure out the exact way to do. Any help is appreciated. Thanks.

    Read the article

  • jquery GET and POST confusion

    - by JPro
    Hi, I am not quiet sure how jquery works. I want to know few things about the GET and POST in terms of jQuery. I use the following code in my app : <script> function example_ajax_request() { $('#example-placeholder').html('<p>Loading results ... <img src="ajax-loader.gif" /></p>'); $('#example-placeholder').load("ind.php?show=" + $('#box option:selected').val()); } </script> I am not using either GET or POST in this method. I am using a button to call the example_ajax_request to process the request and get the results. Sometimes I see code like this: $.ajax({ url: 'loader.php', data: 'somedata', method: 'GET', success: function(data){ $('#er').text(data); } }); My doubt is, is it required or not that we use a method to post the data? (either GET or POST) while send and getting the data in PHP webapps? The code that I use first works fine even though I do not use any POST or GET methods. Any inputs? Thanks.

    Read the article

  • Reading a CSV with file_get_contents in PHP

    - by JPro
    I am reading a 'kind' of csv file and exploding it and storing it in array. The file I am reading has this structure Id,Log,Res,File mydb('Test1','log1','Pass','lo1.txt'). mydb('Test2','log2','Pass','lo2.txt'). mydb('Test3','log3','Pass','lo3.txt'). Now what I am trying to do is : reading the last record in my database, get the Name, lets say in this case 'Test1' and then I am searching through my file and where I can find the position of 'Test1' and get the next lines in the file, extract the ID,s and add it to database. I am getting the position of desired string in the file, but I am not sure how to get the next lines too. Here's my code so far. <?php mysql_connect("localhost", "root", "") or die(mysql_error()); mysql_select_db("testing") or die(mysql_error()); $result = mysql_query("select ID from table_1 order by S_no DESC limit 1") or die(mysql_error()); $row = mysql_fetch_array( $result ); $a = $row['ID']; echo 'Present Top Row is '.$a.'<br>'; $addresses = explode("\n", file_get_contents('\\\\fil1\\logs\\tes.pl')); foreach($addresses as $val) { $pos = strstr($val, $a); if ($pos === false) { } else { echo "The string <br> '$a' <br>was found in the string <br>'$val' <br>"; echo " and exists at position <br>$pos<br>"; } }

    Read the article

  • being able to solve google code jam problem sets

    - by JPro
    This is not a homework question, but rather my intention to know if this is what it takes to learn programming. I keep loggin into TopCoder not to actually participate but to get the basic understand of how the problems are solved. But to my knowledge I don't understand what the problem is and how to translate the problem into an algorithm that can solve it. Just now I happen to look at ACM ICPC 2010 World Finals which is being held in china. The teams were given problem sets and one of them is this: Given at most 100 points on a plan with distinct x-coordinates, find the shortest cycle that passes through each point exactly once, goes from the leftmost point always to the right until it reaches the rightmost point, then goes always to the left until it gets back to the leftmost point. Additionally, two points are given such that the the path from left to right contains the first point, and the path from right to left contains the second point. This seems to be a very simple DP: after processing the last k points, and with the first path ending in point a and the second path ending in point b, what is the smallest total length to achieve that? This is O(n^2) states, transitions in O(n). We deal with the two special points by forcing the first path to contain the first one, and the second path contain the second one. Now I have no idea what I am supposed to solve after reading the problem set. and there's an other one from google code jam: Problem In a big, square room there are two point light sources: one is red and the other is green. There are also n circular pillars. Light travels in straight lines and is absorbed by walls and pillars. The pillars therefore cast shadows: they do not let light through. There are places in the room where no light reaches (black), where only one of the two light sources reaches (red or green), and places where both lights reach (yellow). Compute the total area of each of the four colors in the room. Do not include the area of the pillars. Input * One line containing the number of test cases, T. Each test case contains, in order: * One line containing the coordinates x, y of the red light source. * One line containing the coordinates x, y of the green light source. * One line containing the number of pillars n. * n lines describing the pillars. Each contains 3 numbers x, y, r. The pillar is a disk with the center (x, y) and radius r. The room is the square described by 0 = x, y = 100. Pillars, room walls and light sources are all disjoint, they do not overlap or touch. Output For each test case, output: Case #X: black area red area green area yellow area Is it required that people who program should be should be able to solve these type of problems? I would apprecite if anyone can help me interpret the google code jam problem set as I wish to participate in this years Code Jam to see if I can do anthing or not. Thanks.

    Read the article

  • mysql query clarification

    - by JPro
    I have a query which I am wondering if the result I am getting is the one that I am expecting. The table structure goes like this : Table : results ID TestCase Set Analyzed Verdict StartTime Platform 1 1010101 ros2 false fail 18/04/2010 20:23:44 P1 2 1010101 ros3 false fail 19/04/2010 22:22:33 P1 3 1232323 ros2 true pass 19/04/2010 22:22:33 P1 4 1232323 ros3 false fail 29/04/2010 22:22:33 P2 Table : testcases ID TestCase type 1 1010101 NOSNOS 2 1232323 N212NS is there any way to display only the latest fails on each platform? in the above case Result shoud be : ID TestCase Set Analyzed Verdict StartTime Platform type 2 1010101 ros3 false fail 19/04/2010 22:22:33 P1 NOSNOS 4 1232323 ros3 false fail 29/04/2010 22:22:33 P2 N212NS

    Read the article

  • javascript function not working in IE 7

    - by JPro
    Hi, Can anyone please tell me how do I make this script run in IE 7? When I run this , nothing happens. <html> <body> <script language="JavaScript"> function moveSelectedOption() { // Fetch references to the <select> elements. var origin = document.getElementById('origin_select'); var target = document.getElementById('target_select'); // Fetch the selected option and clone it. var option = origin.options[origin.selectedIndex]; var copy = option.cloneNode(true); // Add the clone to the target element. target.add(copy, null); } </script> <select id="origin_select" multiple> <option value="A">A</option> <option value="B">B</option> <option value="C">C</option> </select> <select id="target_select" multiple> <option value="C1">C1</option> </select> <button onclick="moveSelectedOption()">Add</button> </body> </html>

    Read the article

  • displaying a group once in php mysql

    - by JPro
    I have some data like this : 1 TC1 PASS 2 TC2 FAIL 3 TC3 INCONC 4 TC1 FAIL 5 TC21 FAIL 6 TC4 PASS 7 TC3 PASS 8 TC2 FAIL 9 TC1 TIMEOUT 10 TC21 FAIL If I try the below code : <?php mysql_connect("localhost", "root", "pop") or die(mysql_error()); mysql_select_db("jpd") or die(mysql_error()); $oustanding_fails = mysql_query("select * from SELECT_PASS ") or die(mysql_error()); $resultSetArray = array(); $platform; while($row1 = mysql_fetch_array( $oustanding_fails )) { if(trim($row1['TESTCASE']) <> trim($platform)) { echo $row1['TESTCASE']."-"; $platform = $row1['TESTCASE']; } echo $row1['RESULT'] ."<br>"; } ?> to get a result like this : TC1 PASS FAIL TIMEOUT TC2 FAIL FAIL TC3 INCONC PASS TC4 PASS AND SO ON. I am unable to get the result I want. Any ideas where exactly I am making mistake? Thanks.

    Read the article

  • extern and global in c

    - by JPro
    Can anyone please tell me is there any special requirement to use either EXTERN or GLOBAL variables in a C program? I do not see any difference in a program like below, if I change from gloabl to extern. #include <stdio.h> #include <stdlib.h> int myGlobalvar = 10; int main(int argc, char *argv[]) { int myFunc(int); int i; i = 12; myGlobalvar = 100; printf("Value of myGlobalvar is %d , i = %d\n", myGlobalvar, i); i = myFunc(10); printf("Value of passed value : %d\n",i); printf("again Value of myGlobalvar is %d , i = %d\n", myGlobalvar, i); system("PAUSE"); return 0; } int myFunc(int i) { i = 20 + 1000; //extern int myGlobalvar; myGlobalvar = 20000; // printf("Value of passed value : %d",i); return i; } If uncomment extern int myGlobalvar, the value does not change. Is there any correct difference between both? Can anyone please correct me?

    Read the article

  • connect to mssql from batch script

    - by JPro
    Hi, I am supplying a batch script to create a DSN connection in the user computer before they start to use my application. I am using this in a .bat file. ODBCConf ConfigSysDSN "SQL Server" "DSN=CONNAME|SERVER=PCNAME\INSTANCENAME But I want to make sure they will be able to connect to the database, considering the fact that proper drivers may not be installed in their systems. So, is there any way to check the connection from the same batch file and inform the user if something unable to connect to the database? thanks.

    Read the article

  • sending email in php unable to use HTML tags

    - by JPro
    I am trying to send an email through the result sets generated in MySQL in PHP This is the code. <?php $txtMsg = '<table><th>Name</th>'; $txtMsg = ''; mysql_connect("localhost", "root", "pop") or die(mysql_error()); mysql_select_db("jpd") or die(mysql_error()); $oustanding = mysql_query("select Name from results") or die(mysql_error()); $num=mysql_num_rows($oustanding); while($row1 = mysql_fetch_array( $oustanding )) { ?> <tr> <td><h3><?php echo $row1['Name']; ?></h3></td> </tr> <?php $txtMsg .= "<tr><td>".$row1['Name']."</td></tr>"; } ini_set ( "SMTP", "xy.domain.com" ); $mail_to= '[email protected]'; $mail_from='[email protected]'; $mail_sub='OutStanding Results'; $mail_mesg=$txtMsg; //Check for success/failure of delivery if(mail($mail_to,$mail_sub,$mail_mesg,"From: $mail_from")) echo "<br><br>Email Successfully Sent!"; else echo "<br><br>Error Sending Email!"; } ?> The problem is , I want the results to be displayed in table format. But instead of processing the html tags, they are getting printed as well. How to get the email with table format? Thanks.

    Read the article

  • can we use something IN and something NOT in mysql

    - by JPro
    I want to know if I can use something like this : If yes, then what will be order ? I dont seem to understand quite well the explain plan of mysql Select * from results where TestCase NOT IN (select TestCase from results where Verdict <> 'PASS' and StartTime > DATE_SUB(NOW(), INTERVAL 2 MONTHS)) and TestCase IN (Select TestCase from testcases where Type = 'NONOS') EDIT : Also how can I order by StartTime to display the latest first?

    Read the article

  • regular expression help

    - by JPro
    I always get confused using regular expressions. Can anyone please suggest me a tutorial? I need help with checking for a string which, cannot contain any wild characters except colon, comma, full stop. It will be better to replace these if found. Any help? Thanks.

    Read the article

  • splitting strings in php

    - by JPro
    I have some testcases/strings in this format: o201_01_01a_Testing_to_see_If_this_testcases_passes:without_data o201_01_01b_Testing_to_see_If_this_testcases_passes:data rx01_01_03d_Testing_the_reconfiguration/Retest: Actually this testcase name consists of the actual name and the description. So, I want to split them like this : o201_01_01a Testing_to_see_If_this_testcases_passes:without_data o201_01_01b Testing_to_see_If_this_testcases_passes:data rx01_01_03d Testing_the_reconfiguration/Retest: I am unable to figure out the exact way to do this in explode in php Can anyone help please? Thanks.

    Read the article

1 2  | Next Page >