Using Post tData?

Andrew Kluthe andrew at ctech.me
Mon Sep 23 09:36:40 EDT 2013


Also, as far as I know:

 $result = mysql_query("SELECT urladdress, urltitle FROM urllist WHERE
docid = '$doccode'");

$doccode won't evaluate to anything but the string $doccode in this query
because you have encased it in ' ' I believe.

I'm not sure what version of PHP on-rev is using, but if it's one of the
newer versions and you want to build a php based api for your database, I
can't recommend this enough.

http://net.tutsplus.com/tutorials/php/laravel-4-a-start-at-a-restful-api/

Regards,

Andrew


On Mon, Sep 23, 2013 at 8:28 AM, Andrew Kluthe <andrew at ctech.me> wrote:

> Hmmm.
>
> echo "<td><. $row['urladdress'] . </td>";
>
> That line there doesn't quite look right.
>
> I'm not sure if you pasted this out directly or not.
>
> What's your reasoning for the table in the script? If I were going to use
> this as an http interface I would likely just use <br> tags to put them all
> in a nice list that livecode could process easily.
>
> The syntactcaly correct version of that echo would be.
>
> echo "<td>" . $row['urladdress']  . "</td>";
>
> Also I believe you have an extra orphan </td> in the last line of the
> script you posted.
>
> You are getting something back from the url so livecode's url commands are
> fetching the right stuff, and you say this query works fine when peeked at
> from a browser window.
>
> I'd look at your loop a little closer.
>
> Andrew
>
>
> On Mon, Sep 23, 2013 at 12:20 AM, Earthednet-wp <prothero at earthednet.org>wrote:
>
>> John,
>> I use post and php for remote MySQL database interaction. To use the LC
>> MySQL commands directly, you have to open permissions to the database to
>> the world (assuming your app accesses it). This makes an extremely insecure
>> system. You can open an ssh tunnel using shell commands, but I find the php
>> solution more to my liking.
>> Good luck,
>> Bill
>>
>> William Prothero
>> http://es.earthednet.org
>>
>> On Sep 22, 2013, at 8:42 PM, JOHN PATTEN <johnpatten at me.com> wrote:
>>
>> > Hi All…
>> >
>> > I would like to be able to pull data into a livecode project from an
>> on-rev mysql database. It currently works in a  browser as a simple web app
>> and is built all on in php.
>> >
>> > I thought I may be able to just use the post command, however when I
>> try to post some data to a php url that executes a query on the database
>> and then echoes back the results all I get in an "answer it" is the first
>> header line, "Assigned Resources," and no array results. Here is the
>> abbreviated php code:
>> >
>> > mysql_connect;
>> > $result = mysql_query("SELECT urladdress, urltitle FROM urllist WHERE
>> docid = '$doccode'");
>> >
>> > echo "<table border='1'>
>> > <tr>
>> > <th>Assigned Resources</th>
>> > </tr>";
>> >
>> > while($row = mysql_fetch_array($result))
>> >  {
>> >  echo "<tr>";
>> >
>> >  echo "<td><. $row['urladdress'] . </td>";
>> >  echo "</tr>";
>> >  }
>> > echo "</td></table>";
>> >
>> > This works fine in the browser, but I was hoping to use all these php
>> database connections in the web app within a stack and an iOS app. Any
>> recommendations, or should I abandon ship, and go in a different direction
>> to access the mysql data from within a lc stack?
>> >
>> > Thanks in advance!
>> >
>> > John Patten
>> > SUSD
>> > _______________________________________________
>> > use-livecode mailing list
>> > use-livecode at lists.runrev.com
>> > Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> > http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
>
>
> --
> Regards,
>
> Andrew Kluthe
> andrew at ctech.me
>



-- 
Regards,

Andrew Kluthe
andrew at ctech.me



More information about the use-livecode mailing list