FrontlineSMS

FrontlineSMS let users send, receive and manage SMS over a mobile network.

*it included some fruites with price

*no

*oracle

*ya i can

Views: 280

Reply to This

Replies to This Discussion

Thanks for answering my query at http://frontlinesms.ning.com/forum/topics/2052630:Topic:8063?commen...

 

You can use the external command functionality in FrontlineSMS to call a script.  You will then need to write a script to query your database and pass the result back to FrontlineSMS.

thanks for ur kind reply.......I used wamp software to my data base. n i got reply back from FSMS

but speed s very low.   can u plz tell me how can i achieve great speed.....    

Hi Mahantesh,

 

If you can give some more detail on your exact setup, which part of the system is working slowly, and how slowly it is working then maybe we can help.


Thanks!

 

Alex

Hi alex,am yet to be conversant with the http trigger. when i send sms to FLSMS i get a blank autoreply sms from FLMS. where might be the problem? even when i have checked the 'include the command response'

The configuration is as follows:

FRONTLINE CONFIGURATION:

SERVER URL: http://localhost/htdocs/market.php? $keyword

KEYWORD:MARKET (TABAKA)

BELOW IS THE PHP SCRIPT:

<?php
$server="localhost";
$user="root";
$pass="NANOTECHZ";
$db="bidhaa";
$market=$_GET['TABAKA'];
mysql_connect("$server","$user","$pass");
mysql_select_db("$db") or die('CANNOT CONNECT TO MYSQL DATABASE');

$query = mysql_query( "SELECT * FROM `prices` WHERE market=\'TABAKA\';)");
$msg=$market;
While ($result=mysql_fetch_array($query,MYSQL_ASSOC))
{
$msg= $msg." ".$result['maize']." ".$result['onions']." ". $result['rice']."";
}
echo $msg;
?>

MYSQL CONFG:

dbname:bidhaa

table: prices

fields: id|MARKET|MAIZE|ONIONS|RICE|

            1|TABAKA|50.00|200.00   |200 |

Thanks in advance.

Attachments:

Hi,

 

there are a few mistakes here.

First of all, your sql query isn't dynamic, as you always pass 'TABAKA' as the product name. Change it so it looks like:

$query = mysql_query( "SELECT * FROM `prices` WHERE market=\'$market\';)");

 

Then, you can see your $market variable is getting the value of the 'TABAKA' parameter. But you never fill it when calling your script. Start by renaming it like this:

$market=$_GET['product'];

 

The FrontlineSMS http request should look like this:

http://localhost/htdocs/market.php?product=${message_content}

 

Then the users should send this kind of SMS:

MARKET TABAKA

MARKET RICE

 

Hope that helps.

Morgan

 

Watch out for SQL injection though!
Haha... :]
Thanks indeed for the reply, i will get back immediately i try it.

Hi Morgan,

i tried to edit the script,but frontline  sends a blank sms as an autoreply when i send a message with the keyword 'MARKET' or 'RICE'.below is the edited script:

WHERE MIGHT BE THE PROBLEM? Help to edit please.


<?php
$server="localhost";
$user="root";
$pass="NANOTECHZ";
$db="bidhaa";
$market=$_GET['product'];
mysql_connect("$server","$user","$pass");
mysql_select_db("$db") or die('CANNOT CONNECT TO Bidhaa DATABASE');

$query = mysql_query( "SELECT * FROM `prices` WHERE market=\'$market\';)");
$msg=$market;
While ($result=mysql_fetch_array($query,MYSQL_ASSOC))
{
$msg= $msg." ".$result['maize']." ".$result['onions']." ".$result['rice']." ";
}
echo $msg;
?>

the frontline confg is:

http://localhost/htdocs/market.php?product=${message_content}

(i am using xampp server)

HOW I WANT IT TO BE:

when FLSMS recieves an sms with a keyword either the name of the market for example 'TABAKA', or the name of the commodity e.g. 'MAIZE' , it calls the php script which returns the various commodity prices which FLSMS inturn sends the result to the sender as an autoreply.

THIS IS THE 'PRICES' TABLE:

<div id="displayoptions" />
Full Texts id MARKET MAIZE ONIONS RICE
Edit Delete 1 TABAKA 50 200 180
Edit Delete 2 RONGO 55 220 185
Edit Delete 3 SUNEKA 60 250 190

RSS

Photos

  • Add Photos
  • View All

© 2014   Created by FrontlineSMS Admin.   Powered by

Badges  |  Report an Issue  |  Terms of Service