Delphi For PHP Forums    


Go Back   Delphi-PHP Forums > Programming > Javascript and Ajax
Forum Jump Register FAQ Members List Downloads Search Today's Posts Mark Forums Read

Javascript and Ajax Questions and information about working with Ajax and Javascript in Delphi for PHP.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 19th March 2009, 17:17
D4PHP User
 
Join Date: Jan 2009
Posts: 11
Lucas.frey is on a distinguished road
Default AJAX and MSSQL

Hello,

I've got a new database problem, when i try to use Ajax Example with my database (MSSQL), I've got huge javascript error with some MySql error (and i never use mysql in my code)
this is the example :

function Button1Click($sender, $params)
{

$this->Button1->Caption="clicked Ajax ".date("Y-m-d H:i:s");
$this->Label1->Caption="Hello from Ajax!! ".date("Y-m-d H:i:s");
$this->Label1->Color="#".dechex(rand(0,0xFFFFFF));

}
function Button1JSClick($sender, $params)
{
//Dump the call using Ajax to the Button1Click event
echo $this->Button1->ajaxCall("Button1Click");
?>
//Return false to prevent the button submit the form
return(false);
<?php


So, i've install a MySql database to test, and it work, i conclude that I cannot use Ajax with MSSQL Database, is it true ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 19th March 2009, 23:52
405hp's Avatar
Firebug Fanatic
 
Join Date: Dec 2007
Location: State of Confusion
Posts: 3,480
405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute
Default

Quote:
Originally Posted by Lucas.frey View Post
So, i've install a MySql database to test, and it work, i conclude that I cannot use Ajax with MSSQL Database, is it true ?
I'm sure it should (has to) work, I just don't know a thing about it as I've never used it.

Ajaxcall is not any different than a button push except it doesn't reload the browser. AFAIK anything you can do with a normal postback can be done with ajax.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 20th March 2009, 08:15
D4PHP User
 
Join Date: Jan 2009
Posts: 11
Lucas.frey is on a distinguished road
Default

I'm not that sure, have a look, this example is really basic, nothing else on the code :

First i try with my MySQL Database and the Label/Button :



Second time i drop my MSSQL Database :



And then, huge error :


So it must be a Ajax database option or something else?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 20th March 2009, 12:48
405hp's Avatar
Firebug Fanatic
 
Join Date: Dec 2007
Location: State of Confusion
Posts: 3,480
405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute
Default

Use firebug in firefox and you can get at the entire response code. Look through the response and somewhere farther down you will see something that looks abnormal ( it will be the standard error output) That will tell you what is going wrong.

Xajax pops that error whenever there is 'junk' in the response.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 23rd March 2009, 08:36
D4PHP User
 
Join Date: Jan 2009
Posts: 11
Lucas.frey is on a distinguished road
Default

Firebug tell me the same error :

Mon Mar 23 2009 08:33:19 GMT+0100: Received: <br /> <b>Warning</b>: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Can't connect to MySQL server on 'server_sql2' (10061) [...]

I don't understand why Delphi will connect me on a MySQL Database while I don't use any component MySQL ...

Is there a Framework to install for it works good ? All people don't work with MySQL...


Edit: I try to run the AjaxDatabase with my database, and it's work for the first time, the data change good, and when i change row for a second time, it call a MySQL function... don't understand...

Last edited by Lucas.frey; 23rd March 2009 at 09:41.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 23rd March 2009, 10:53
D4PHP User
 
Join Date: Jan 2009
Posts: 11
Lucas.frey is on a distinguished road
Default

ok i've got my response :

in dbtables.inc.php you've got a defaultdatabase and drivername ... by default it's mysql, just rename it

protected $_drivername="mssql";


and it's work good !!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 23rd March 2009, 16:45
405hp's Avatar
Firebug Fanatic
 
Join Date: Dec 2007
Location: State of Confusion
Posts: 3,480
405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute
Default

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT +1. The time now is 04:52.




Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 ©2009, Crawlability, Inc.
Copyright © 2004 - 2009, G&J Solutions Ltd. All Rights Reserved. terms of use