Ajax AutoComplete Support Product Page

PHP / MSSQL Server (not MySQL)

Asked 20 Jan 2009 20:07:13
1
has this question
20 Jan 2009 20:07:13 bruno bocco posted:
Hello,
I'm using Dreamweaver CS4 with a PHP/SQL Server site (and not PHP/MySql).
Because Dreamweaver does not support this feature, I add manually all MSSQL query and mssql php function.
Because no DB link exists in Dreamweaver, Ajax AutoComplete don't give me the possibility to retrieve data from the DB, logic.
My question is : Where and which syntax does I need to add/change to the scripts automatic added and created under ajax AutoComplete with the "generate autocomplete manually" option choosed ??
the script is
jQuery('#autocomplete2').autocomplete('autocomplete-ajaxtest-php-2.txt',
{
.....
}

instead of 'autocomplete-ajaxtest-php-2.txt', what should I do to retrieve data from a mssql query ??

Thanks for your help !!!!!!!!<b></b><b></b>

Replies

Replied 24 Apr 2011 19:29:39
24 Apr 2011 19:29:39 David Cunningham replied:
Hi all,

I thought rather than starting a new thread, I would jump on this one. I assume (judging by the amount of views, this is a common-ish problem).

Like Bruno above, I have been using the Ajax Autocomplete extension (the most recent one - Great extension by the way!!!) and wish to convert the autocomplete.php output to pull data from Micro$oft SQL server 2008 R2.

With most of my Dreamweaver code on other pages I have been able to fairly easily replace mysql_*** with sqlsrv_*** and with a few other code rehashes have got most functions working.

The issues I have come across with the ajax autocomplete extension appears to be;

1) 'mysql_real_escape_string' has no sqlsrv_ equivalent. What should I be using instead?
2) 'while ($row = mysql_fetch_array($res, mysql_NUM))'
a) converting this code to sqlsrv_ brings up errors (resource, boolean, etc... expected).
b) 'mysqlnum' has two equivelants in sqlsrv. My assumption is that sqlsrv_num_rows should be used, but statements are required. What should these be?

If anyone has had any luck with this. Please let me know!

Thanks in advance.

Paladindc

Reply to this topic