1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Javascript Coder Needed - Simple Task

Discussion in 'Hire a Freelancer' started by fahey, Nov 30, 2011.

  1. fahey

    fahey Newbie

    Joined:
    Oct 28, 2011
    Messages:
    20
    Likes Received:
    10
    I am looking for someone experienced in javascript. The job I need done is very simple and it should not take long if your experienced.
    It will grab a line from a database, feed it into a table that holds 10 lines, and rotate through the lines.

    Please message me if interested
     
  2. surender.singal

    surender.singal Registered Member

    Joined:
    Jun 4, 2011
    Messages:
    89
    Likes Received:
    3
    Occupation:
    Web Programmer
    Location:
    DL
    Hi ,

    I am interested in this task .Please send me more details or add me on skype at surender.singal1
     
  3. fahey

    fahey Newbie

    Joined:
    Oct 28, 2011
    Messages:
    20
    Likes Received:
    10
    I have added you on skype
     
  4. fahey

    fahey Newbie

    Joined:
    Oct 28, 2011
    Messages:
    20
    Likes Received:
    10
    Still looking for someone... I would prefer an American that actually knows what they are doing please.
     
  5. fahey

    fahey Newbie

    Joined:
    Oct 28, 2011
    Messages:
    20
    Likes Received:
    10
    Still looking... super easy task.. too bad all thats on this forum is indians -_-
     
  6. xpwizard

    xpwizard Junior Member

    Joined:
    Nov 6, 2010
    Messages:
    198
    Likes Received:
    122
    Pure PHP solution:
    Code:
    <html>
    <head>
    </head>
    <body>
    	<table border="1">
    		<tr>
    			<th>Emails</th>
    			<th>Password</th>
    		</tr>
    		<?php
    		// Mysql settings
    		$dbserver = "localhost";
    		$user = "root";
    		$password = "password";
    		$database = "emails";
    		
    		// connect to Mysql
    		mysql_connect($dbserver, $user, $password) or die(mysql_error());
    		mysql_select_db($database) or die(mysql_error());
    		
    		// query table & grab 10 random rows
    		$query = "SELECT * FROM accounts ORDER BY RAND() LIMIT 10"; 
    		$result = mysql_query($query) or die(mysql_error());
    		
    		// loop through array
    		while($row = mysql_fetch_array($result)){
    			// start new row of table
    			echo "<tr>";
    			// start new column of current row
    			echo "<td>".$row['email']."</td>";
    			echo "<td>".$row['pass']."</td>";
    			// end row
    			echo "</tr>";
    		}
    		
    		// close Mysql
    		mysql_close();
    		?>
    	</table>
    <body>
    </html>
    



    Using ajax to just output table (javascript does not build table, only includes it in the current page).

    Page #1 - Main html page.
    Code:
    <html>
    <head>
    	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
    	<script type="text/javascript">
    		$(document).ready(function() {
    			$("#submit").click(function() {
                    var dataString = '';
                    $.ajax({
                        type: "POST",
                        cache: false,
                        url: "sqltotable.php",
                        data: dataString,
                        success: function(data){
                            $("#table").html(data);
                        }
                    });
                    return false;
                });
    		});
    	</script>
    </head>
    <body>
    	<form action="" method="post" onsubmit="">
    		<input id="submit" type="submit" value="Submit" />
    	</form>
    	<p></p>
    	<div id="table"></div>
    </body>
    </html>
    Page #2 - PHP page where table is filled (name sqltotable.php for example above to work).
    Code:
    <table border="1">
    	<tr>
    		<th>Emails</th>
    		<th>Password</th>
    	</tr>
    	<?php
    	// Mysql settings
    	$dbserver = "localhost";
    	$user = "root";
    	$password = "password";
    	$database = "emails";
    	
    	// connect to Mysql
    	mysql_connect($dbserver, $user, $password) or die(mysql_error());
    	mysql_select_db($database) or die(mysql_error());
    	
    	// query table & grab 10 random rows
    	$query = "SELECT * FROM accounts ORDER BY RAND() LIMIT 10"; 
    	$result = mysql_query($query) or die(mysql_error());
    	
    	// loop through array
    	while($row = mysql_fetch_array($result)){
    		// start new row of table
    		echo "<tr>";
    		// start new column of current row
    		echo "<td>".$row['email']."</td>";
    		echo "<td>".$row['pass']."</td>";
    		// end row
    		echo "</tr>";
    	}
    	
    	// close Mysql
    	mysql_close();
    	?>
    </table>
     
  7. Jared255

    Jared255 Jr. Executive VIP Jr. VIP Premium Member

    Joined:
    May 10, 2009
    Messages:
    1,907
    Likes Received:
    1,662
    Location:
    Boston, MA
    Google "newsticker script" if you haven't already found someone, your post describes a newsticker word for word if i'm reading it correctly
     
  8. fahey

    fahey Newbie

    Joined:
    Oct 28, 2011
    Messages:
    20
    Likes Received:
    10
    wizard
    Thanks for the detailed reply but where does the timing come in? If you could send me a message it would be appreciated
     
  9. fahey

    fahey Newbie

    Joined:
    Oct 28, 2011
    Messages:
    20
    Likes Received:
    10
    Still looking since no one on this thread knows how to pm -_-... except indians
     
  10. YoutubeSlanger

    YoutubeSlanger Junior Member

    Joined:
    Nov 9, 2011
    Messages:
    184
    Likes Received:
    22
    LOl they ready and willings at any jobs
     
  11. fahey

    fahey Newbie

    Joined:
    Oct 28, 2011
    Messages:
    20
    Likes Received:
    10
    yea they say they can do anything... then 5 days later they say they cant do it and run off
     
  12. xpwizard

    xpwizard Junior Member

    Joined:
    Nov 6, 2010
    Messages:
    198
    Likes Received:
    122
    When using Jquery to add a delay, all you have to do is:

    Code:
    setTimeout(function() {
    ** You're JS code **
    }, 1500);
    The above will add 1.5seconds delay to the code within the function.
     
  13. fahey

    fahey Newbie

    Joined:
    Oct 28, 2011
    Messages:
    20
    Likes Received:
    10
    I would appreciate it if you sent me a pm so you could perhaps help me implement this.
     
  14. fahey

    fahey Newbie

    Joined:
    Oct 28, 2011
    Messages:
    20
    Likes Received:
    10
    Well despite 4 more indians contacting me and then confidently saying they can do it only to respond the next day saying they dont know wtf they are doing, I am still looking for someone to do this simple task. Easy cash if you know code and your american.