|
|
Home /
Groups /
Ajax
Ajax Request not working
Hi there I am trying to get a value form the mysql DB.joaquin henriquez 03/31/08 10:42 A Not sure what framework you are using, but you should try something likeAndrew Scott 08/16/08 11:47 P 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) 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)
|
Mailing Lists
|
Latest Fusion Authority Articles
|
||||||