CGI MySQL Drivers What next?
Björnke von Gierke
bvg at mac.com
Wed Dec 17 18:15:02 EST 2008
I'm using the following code in my cgi databases (example for mac os
x), I think mr. waddingham once posted something similar to the
improve list. The db externals are all in the same folder for me (and
executable). Debugging could also include a check for the externals of
the stack, instead of the sql stuff within a try/catch. Watch out for
linewraps, wrong line endings, and false paths/names of relevant files/
apps.
#!rev3.0 -ui
on startup
try
--setup SQL as externals of a stack. necessary!
--I do this by using a "fake" stack, using a complete and
nonrelative path to external file
set the externals of the templatestack to "/Library/WebServer/CGI-
Executables/revdb.so"
create stack "externals"
start using stack "externals"
--use correct mysql call instead of sqlite here
put revOpenDatabase("sqlite", "db.sqlite") into buffer
catch buffer
put "Error:" & cr before buffer
end try
if buffer is a number then
put "Success:" & cr before buffer
end if
put "content-type: text/plain; charset=ISO-8859-1" & cr
put "Content-Length:" && the length of buffer & cr & cr
put buffer
--completely remove all stacks from memory. necessary!
--either of the following should do, I'm using both for being
paranoid
close stack "externals"
quit
end startup
On 17 Dec 2008, at 18:37, Jim Sims wrote:
>
> On Dec 17, 2008, at 6:15 PM, J. Landman Gay wrote:
>
>> I'm no expert on databases, but some posts I've saved over the
>> years suggest you need to use "SetDriverPath" early in your script
>> to tell the engine where to find the drivers.
>
> Tried that.
>
> Made a sub-dir to the cgi-bin named database_drivers
>
> At the beginning of the cgi script I added:
> revSetDatabaseDriverPath "./database_drivers/"
> No luck.
> <severe banging of head sounds>
>
>
> sims
>
> sims at ezpzapps.com
> Skype: sims.jim
> iChat: techietours
> ______________________
> Opportunity by Design
>
>
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
More information about the use-livecode
mailing list