Skip to main content
January 22, 2008
Question

asp to php info

  • January 22, 2008
  • 5 replies
  • 512 views
ASP:

<%
if Request.QueryString("affid") <> "" then

set rsAffiliateClicks = Server.CreateObject("ADODB.Recordset")
rsAffiliateClicks.ActiveConnection = MM_cnConnection_STRING
rsAffiliateClicks.Source = "SELECT id, date, affid, referURL FROM affiliateClicks"
rsAffiliateClicks.CursorType = 0
rsAffiliateClicks.CursorLocation = 2
rsAffiliateClicks.LockType = 3
rsAffiliateClicks.Open()
rsAffiliateClicks_numRows = 0
rsAffiliateClicks.addnew

rsAffiliateClicks("date") = date()
rsAffiliateClicks("affid") = Request.QueryString("affid")
rsAffiliateClicks("referURL") = Request.ServerVariables("HTTP_REFERER")

rsAffiliateClicks.update
rsAffiliateClicks.close
end if
%>

PHP:?
How do I initiate the update and addition of a record in the database from within the recordset as I have done here in ASP.


This topic has been closed for replies.

5 replies

Inspiring
January 26, 2008
"jsteinmann" <webforumsuser@macromedia.com> wrote in message
news:fne6i0$qaf$1@forums.macromedia.com...
> good luck with that.
>
> i wonder what could be done in php as a work around, accomplishing the
> same thing but with mysql?

A lot can be done there are many activerecord implementations but none are
supported by dreamweaver afaik.

http://en.wikipedia.org/wiki/List_of_object-relational_mapping_software

There's a feature request for an object datasource serverbehavior which if
implemented could be used to provide UI support for ActiveRecord
implementations
http://sourceforge.net/tracker/index.php?func=detail&aid=1776864&group_id=201846&atid=979195




January 26, 2008
good luck with that.

i wonder what could be done in php as a work around, accomplishing the same thing but with mysql?
Inspiring
January 25, 2008
"jsteinmann" <webforumsuser@macromedia.com> wrote in message
news:fnaf5b$fp0$1@forums.macromedia.com...
> Is this not something you can do in PHP?

The magic word for this type of database interaction is "ActiveRecord"
I've posted a small example at
http://www.dmxzone.nl/showDetail.asp?TypeId=25&NewsId=12415

Inspiring
January 25, 2008


"jsteinmann" <webforumsuser@macromedia.com> wrote in message
news:fn4a15$hp3$1@forums.macromedia.com...
> ASP:
>
> <%
> if Request.QueryString("affid") <> "" then
>
> set rsAffiliateClicks = Server.CreateObject("ADODB.Recordset")
> rsAffiliateClicks.ActiveConnection = MM_cnConnection_STRING
> rsAffiliateClicks.Source = "SELECT id, date, affid, referURL FROM
> affiliateClicks"
> rsAffiliateClicks.CursorType = 0
> rsAffiliateClicks.CursorLocation = 2
> rsAffiliateClicks.LockType = 3
> rsAffiliateClicks.Open()
> rsAffiliateClicks_numRows = 0
> rsAffiliateClicks.addnew
>
> rsAffiliateClicks("date") = date()
> rsAffiliateClicks("affid") = Request.QueryString("affid")
> rsAffiliateClicks("referURL") = Request.ServerVariables("HTTP_REFERER")
>
> rsAffiliateClicks.update
> rsAffiliateClicks.close
> end if
> %>
>
> PHP:?
> How do I initiate the update and addition of a record in the database from
> within the recordset as I have done here in ASP.

To use similar syntax in PHP you can use the ADOdb PHP Database abstraction
layer,
InterAKT (who made the ADDT) have developed the dreamweaver extension phAKT
that adds a new server-model PHP ADODB to dreamweaver and replicates the
standard dreamweaver ServerBehaviors up to Dreamweaver 8, however after the
merger with adobe the project was discontinued and not available for
download anymore. Since the project was released under the LGPL licence I've
setup a project on sourceforge with the aim of continuing distribution and
possibly development of the phaKT server model, to differentiate this
project from the original version we deceided to name it openphakt.
You can access the project website and source code repository from
http://openphakt.sourceforge.net ; to download the MXP look in the SVN
repository under the release folder

While the goal of continued distribution has been reached, nobody has
reported bugs/issues to the sourceforge project and development hasn't
started yet. If you have questions about the project I would be happy to
answer them.

Joris van Lier

January 24, 2008
Is this not something you can do in PHP?