MySQL example code

Coordinator
Nov 19, 2010 at 10:38 PM

Here is the example code for http://www.thetechconsult.com/test/default.aspx?action=mysqllist :

CASE oProp.Action=='mysqllist'
LOCAL lcLast
oSQL = CREATEOBJECT("AVFPsql")
lcLast=NVL(oRequest.Form("lastname"),"")
oSQL.LogIn(['Driver={MySQL ODBC 3.51 Driver}; Server=thetechconsult.db.6054633.hostedresource.com; Database=thetechconsult; Uid=yourUID; Pwd=yourPW;'])
oSQL.cSQLCursor = "tCursor"
oSQL.Execute([SELECT option_id as First,option_name as Last,option_value as City ]+;
[ FROM wp_options ]+;
[ WHERE option_name like '] +lcLast +[%' order by option_id] )
lcHTMLfile = 'mysqllist.htm'
lcHTMLout= FILETOSTR(oProp.HtmlPath+lcHTMLfile)
lcHTMLout= oHTML.htmlTable('authors',lcHTMLout,10,10,'#E5E5E5',.F.;
,VAL(oRequest.querystring("page")),oRequest.querystring("nav"))
lcHTMLout= oHTML.mergetext(lcHTMLout)