From: Erik **AdobeCommunityExpert** on
Look at the GetLine function. You can specify the delimiter - so just
place that delimiter between each record via your PHP script. The
default delimiter is a Return character. That may be more difficult to
place between each record, so use something unusual, perhaps a tilde ~.
Then you can do:
GetLine(strResult, x, "~")
in a loop to place each line into a list or string.
Erik

kjedwards wrote:
> Hi Mike
>
> At the moment I am just trying to test the approach so the return string can
> be in any format that can be provided by manipulating it in PHP
>
> What I want to do is have a dynamic quiz with the question bank stored in
> MySQL. So I need a way to retrieve questions and then populate the relevant
> quiz in AW.
>
> I am sure this has been done before. I am just looking for the correct way to
> approach this.
>
> Yours
>
> Kevin
>
>

--
Erik Lord
http://www.capemedia.net
Adobe Community Expert - Authorware
http://www.adobe.com/communities/experts/
------------------------------------------------------------------------
http://www.awaretips.net - samples, tips, products, faqs, and links!
*Search the A'ware newsgroup archives*
http://groups.google.com/group/macromedia.authorware
From: mike-stalkfleet.com on
My reply is not much different from Erik's. In my PHP code I would have used a
loop to print out the questions with a "\r" separating each question.

Then when you read that into Authorware
questions:=Readurl(yoursite)
--should look like "Question1\rQuestion2\rQuestion3"

Then loop to transfer that info to a list:
questionlist:=[]
repeat with x:=1 to Linecount(questions)
questionlist[x]:=Getline(questions, x)
end repeat



Will you be retrieving the answers from the database as well?


From: kjedwards on
Thanks Erik and Mike I am playing around with these functions at the moment.

It's a pity there isn't any way to connect AW to a database other than via
ODBC most hosting companies (mine at least) don't like ODBC prefering OLEDB
connectivity.

Mike, yes I will be storing all questions, answer options and correct answers
in a db. Eventually I want to populate AW quizzes with random questions drawn
from catagorised question banks

Yours

Kevin

From: Amy Blankenship *AdobeCommunityExpert* on

"kjedwards" <webforumsuser(a)macromedia.com> wrote in message
news:ee98pu$j52$1(a)forums.macromedia.com...
> Thanks Erik and Mike I am playing around with these functions at the
> moment.
>
> It's a pity there isn't any way to connect AW to a database other than via
> ODBC most hosting companies (mine at least) don't like ODBC prefering
> OLEDB
> connectivity.

If you are going to try to use ODBC to connect to a data source on a server,
it doesn't matter what is on the server, because the connection would be
made by the client machine if you were trying to use Authorware's ODBC.u32.
Typically when it is on the web, you're not going to be using a direct ODBC
connection. Though in theory you can do this, more often people choose to
have some back end logic that makes the connection using one of the various
connection types/connection strings available on the host. This back end
"thing" will then format the information it got from the database and return
it to Authorware.

Some examples of back-end technologies you might use are ASP, PHP, Java,
Coldfusion, or Perl (CGI). It sounds like you're already using PHP.
Therefore, the fact that Authorware comes with ODBC.u32 is irrelevant at
this point. I suspect it is also irrelevant which kind of DSN your host
prefers, since you can create a dsn-less connection with an appropriate
connection string, and the host won't have much to say about it.

HTH;

Amy


From: kjedwards on
Hi Amy

My host provides Windows Server hosting as well as UNIX and so it would be
possible to connect AW through to say MS Access or MSSQL.

The AW app I am thinking about developing would be hosted on the web so client
connectivity should not be a problem.

I have to say that although I have developed several dynamic web sites using
php/mysql, I have never developed anything using Coldfusion, ASP or MSSQL.

I do understand that my host may very well provide some kind of ODBC
connectivity (hosted web sites to hosted access/mssql) but judging by the
number of issues ODBC has raised on the hosts support forum it seems to be a
undesireable way forward. Almost everyone suggests using OLEDB connections
rather than ODBC. So I am rather put off.

I can work with PHP reasonably well but (although played around with AW on and
off for some time) don't know AW that well. The lack of a good scripting
/programming guide is a real downer for an app like AW which costs so much.


Yours

Kevin


First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5
Prev: unable to execute user function
Next: Shell Error 5