473,386 Members | 1,793 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Send $row from table to ajax script

Good days guys,

in my main.php page I select data from mysql db and then if selected on any rows send data to ajax script, so everything is ok but when I click in any rows I receive one data.

Expand|Select|Wrap|Line Numbers
  1. <table cellpadding="0" cellspacing="0" border="0" class="display mobile_dt1 dt2">
  2.  
  3.                                                          <thead>
  4.                                                            <tr>
  5.                                                            <th class="essential">Звук</th>
  6.                                                            <th class="essential">Время звонка</th>
  7.  
  8.                                                            </tr>
  9.                                                            </thead>
  10.                                                            <tbody>
  11.                                                            <?php
  12.  
  13.  
  14.                                                             $stmt = "SELECT a, b, u FROM asteriskdb.cdr ORDER BY calldate desc";
  15.                                                             $result = mysql_query( $stmt, $conn );
  16.                                                             while($row = mysql_fetch_array($result, MYSQL_ASSOC)){
  17.                                                            $src= $row['b];
  18.  
  19.                                                             ?>
  20.                                                                    <tr class="gradeX">
  21.  
  22.                                                                    <td><a href="http://localhost/voice/<?php echo $row['u'];?>.wav" class="sm2_button"></a></td>
  23.                                                                    <td><?php echo $row['a'];?></td>
  24.                                                                    <td><span id="someVal"><?php echo $src; ?></span></td>
  25.  
  26.                                                                    <td>
  27.                                                       <a href="#" class="sepV_a fd2" title="Change"><img src="img/ico/pencil_gray.png" alt="" /></a>
  28.                                                       <a href="#" class="sepV_a chist" title="View"><img src="img/ico/preview_gray.png" alt="" /></a>
  29.                                                       <!--a href="#" title="Del"><img src="img/ico/trashcan_gray.png" alt="" /></a-->
  30.                                                                    </td>
  31.                                                                    </tr>
  32.                                                           <?php
  33.                                                           }
  34.                                                           ?>
  35.                                                          </tbody>
  36.                                                          </table>
  37.  

and my JS script

Expand|Select|Wrap|Line Numbers
  1. <script>
  2.                                             var name="<?php echo $src; ?>"
  3.                                              $(document).ready(function() {
  4.                                                  //* common functions
  5.                                                  prth_common.init();
  6.                                                 prth_dialogs.init();
  7.                                                  if(!jQuery.browser.mobile) {
  8.                                                      //* collapsible sideabar
  9.                                                      prth_sidebar.init();
  10.                                                  }
  11.  
  12.                                                  // sticky footer
  13.                                                  prth_stickyFooter.init();
  14.                                                  $("html").removeClass("js");
  15.                                                  if(!jQuery.browser.mobile){
  16.                                                                   prth_datatable.dt1();
  17.                                                                   prth_datatable.dt2();
  18.                                                                   prth_datatable.ct();
  19.                                                                   prth_datatable.dt_actions();
  20.                                                                   prth_datatable.dte_1();
  21.                                                                   prth_datatable.dte_2();
  22.                                                                   }else{
  23.                                                                   prth_datatable.mobile_dt();
  24.                                                                   };
  25.  
  26.  
  27.                                             });
  28.                                          </script>
  29.  
  30.  

Please help me with find my error. Thank You
Jun 25 '14 #1
0 1039

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: hobbzilla | last post by:
After running: SELECT , B.rows, O.name FROM (select sum(convert(decimal(10,0),dpages)*8129/1024) , id FROM sysindexes group by id) A INNER JOIN sysindexes B ON A.id = B.id and B.indid in (0,1)...
1
by: Mel Apiso | last post by:
Hi, I want to know if I can detect exactly what row table is locked. My application is locked and I get valuable information (table, application, lock mode...) with "get snapshot for locks..."...
2
by: funkychicken818 | last post by:
This is the script. var reqTopCont; var reqBotCont; function changeTopContent(newUrl) { reqTopCont = false; // branch for native XMLHttpRequest object if (window.XMLHttpRequest) {
2
by: brakai295 | last post by:
Hi there, I need someone to customise an autocompletion AJAX script a little bit. This free script here (demo | info & download) offers you auto-completion when typing in a country's name. I...
2
by: tuktik | last post by:
Hello everyone, I want to notify user if he modifies some data in the form and leaves the page without saving. So I use onunload event to call ajax file to check if the data in the form elements...
2
by: =?Utf-8?B?REo=?= | last post by:
I have a peculiar problem here that I did not have until I migrated from ASP.NET 2.0 to 3.5. I use a master page for my application. Because the master page uses update panels I have the...
13
by: canabatz | last post by:
I got an idea and i want to know if its possible! i got a php file with ajax script that calling other php file to display it in a div ,the file size is 7 KB ,in this file there is a code that...
7
by: mike57 | last post by:
The minimal AJAX script below works in Firefox, but not in IE, Opera, or Chrome. I could use some suggestions or referrals to resources that will help me get the script working in other browsers. ...
3
by: kkshansid | last post by:
in ajax script select box is repeated state 2 times district 2 times kindly suggest me to correct this error <html> <head> <script languphase="javascript" type="text/javascript"> var...
2
by: Bruce1969 | last post by:
I have the following Ajax script to process a form within my DIV: <script type="text/javascript"> // we will add our javascript code here ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.