House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  Ajax

Ajax Request not working

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
joaquin henriquez
03/31/2008 10:42 AM

Hi there I am trying to get a value form the mysql DB. I have in the js: var high = new Ajax.Request('highnumberdb.php'); an in the highnumberdb.php: <?php $con = mysql_connect('127.0.0.1', 'root', 'assmee20'); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("cannabis", $con); $sql="SELECT MAX(cloneref) FROM com_clone_list"; $result = mysql_query($sql); $row = mysql_result($result,0); mysql_close($con); echo $row; ?> And my request never goes back to var high, why? (I also tried with return $row instead of echo $row)

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Andrew Scott
08/16/2008 11:47 PM

Not sure what framework you are using, but you should try something like this. new Ajax.Request('${createLink(controller: 'myController, action: 'update', id: id)}', {               method: 'post',               parameters: 'pageUrl=${pageUrl},               onFailure: function(transport) {                   alert("There was a problem with updating your layout, please try again later.");               }       onSuccess: function(/* not sure */) {       alert('do success code');       }             }           ); -- Senior Coldfusion Developer Aegeon Pty. Ltd. www.aegeon.com.au Phone: +613 9015 8628 Mobile: 0404 998 273 Hi there I am trying to get a value form the mysql DB. I have in the js: var high = new Ajax.Request('highnumberdb.php'); an in the highnumberdb.php: <?php $con = mysql_connect('127.0.0.1', 'root', 'assmee20'); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("cannabis", $con); $sql="SELECT MAX(cloneref) FROM com_clone_list"; $result = mysql_query($sql); $row = mysql_result($result,0); mysql_close($con); echo $row; ?> And my request never goes back to var high, why? (I also tried with return $row instead of echo $row)


<< Previous Thread Today's Threads Next Thread >>

Search ajax

May 20, 2013

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Designer, Developer and mobile workflow conference