tied your code its not different from the one i had before and still am getting 
the same problem only the number field is the one being updated...
thanks in advance..

Date: Mon, 11 Jun 2012 00:14:50 +0300
Subject: Re: php script
From: kipponthe...@gmail.com
To: bgk...@hotmail.com
CC: spame...@gmail.com; users@kannel.org

Try the following code and tell if it works:

<?phpdefine("DBHOST","localhost",true);
define("DBUSERNAME","root",true);define("DBPASSWORD","",true);
define("DBNAME","kannel_sms",true);function insertSms($sender,$text)
{       $con = 'mysql:dbname='.DBNAME.';host='.DBHOST;
    try {        $cmd = new PDO($con,DBUSERNAME,DBPASSWORD);
        $stmt = $cmd->prepare("INSERT INTO tablename (number,message) VALUES 
(:sender,:message)");        $stmt->bindParam(':sender',$sender);
        $stmt->bindParam(':message',$text);        $stmt->execute();
        $cmd = null;    if($stmt->rowCount()>0)
        {               echo "Hello ".$text.". Welcome to NairobiLiving.net!.";
        }        else
        {            echo "Sorry an error has occured";
        }        }        
        catch (PDOException $e) {            echo 'Connection failed: ' . 
$e->getMessage();
        }} insertSms($_GET['sender'],$_GET['text']);
?>

On Sun, Jun 10, 2012 at 7:17 PM, bilal kamoto <bgk...@hotmail.com> wrote:






changed it to text but am still getting the same error!.
Date: Sun, 10 Jun 2012 20:03:33 +0400
Subject: Re: php script
From: spame...@gmail.com

To: cyberja...@gmail.com
CC: bgk...@hotmail.com; users@kannel.org


It's better to use message as a text type instead of varchar(50) because 
message could be more than 50 chars.

2012/6/10 Jacob Mansfield <cyberja...@gmail.com>


Looks like you have an extra closing bracket in that first SQL statement, which 
would be causing your error massage.



        
                
                        
                
                
                        Jacob Mansfield / Lead Developer



                        Blue Sapphire Media



                        email:  ja...@bluesapphiremedia.co.uk



                        skype:  jacob.mansfield 
                
        
        
                
                        
                
        




On 10 Jun 2012, at 16:45, bilal kamoto wrote:


yep managed to download going through the examples am finding it hard to 
comprehend am not good with codes to follow it step by step with no 
documentation its gonna take a while i think. i wish there was a way php and 
mysql...



i,ve figured out one thing when i use;

`bilz` ( `number` varchar(50) NOT NULL, 
  `message` varchar(50) NOT NULL)), 
it replies that there is an error
but when i create table bilz using,



bilz` ( `number` varchar(50), 
  `message` varchar(50) ), 
it works but the only problem is that the message field does not update..is it 
related to my problem...
thanks in advance..



> Date: Sun, 10 Jun 2012 15:28:18 +0100
> Subject: Re: php script
> From: nb...@backup.sh
> To: bgk...@hotmail.com


> 
> DALMP is an application designed to query/cache mysql something like
> adodb but specially for mysql and memcache/redis as cache backends.
> 
> "git clone git://github.com/nbari/DALMP.git damp" is for geting the


> source. git is a command
> 
> within 'damp' follow the examples inside the /examples after
> downloading the source and in less than 5 min you will get it up and
> running.


> 
> On Sun, Jun 10, 2012 at 2:07 PM, bilal kamoto <bgk...@hotmail.com> wrote:
> > Dalmp git clone its a php script or an application, been to the website


> > managed to search a php script popped-up
> >
> >> Date: Sun, 10 Jun 2012 13:03:56 +0100
> >> Subject: Re: php script
> >> From: nb...@backup.sh


> >> To: bgk...@hotmail.com
> >
> >>
> >> Your issues seems to be more a php/mysql problem
> >>


> >> I would recommend a simpler way using something like this:
> >>
> >> $db = new
> >> DALMP('utf8://root:'.rawurlencode('pass-?/:word').'@your.mysql.host:3306/dalmptest?redis:127.0.0.1:6379');


> >> $rs = $db->PExecute("INSERT INTO bilz (number,message) VALUES (?,?)",
> >> $sender, $text);
> >> if ($rs) {
> >> …
> >> }
> >>
> >> for this you will need DALMP git clone git://github.com/nbari/DALMP.git


> >> damp
> >>
> >> give a try maybe could save you some headaches
> >>
> >> On Sun, Jun 10, 2012 at 12:55 PM, bilal kamoto <bgk...@hotmail.com> wrote:


> >> > I've tried that and nothing happens just the number is being updated. i
> >> > want
> >> > to use what is in the text to query for data in the database and send it

> >> > back to sender if it finds a match.

> >> > thanks in advance
> >> >
> >> >> Date: Sat, 9 Jun 2012 23:56:00 +0300
> >> >> From: ami...@arabmobilecontent.com


> >> >> To: bgk...@hotmail.com
> >> >> CC: spame...@gmail.com; us...@vm1.kannel.org


> >> >> Subject: Re: php script
> >> >
> >> >>
> >> >> hello there,
> >> >>
> >> >> there is an error in you php code, just change this line:


> >> >>
> >> >> $stmt->bindParam(':message',$text);
> >> >>
> >> >> into this:
> >> >>
> >> >> $stmt->bindParam(':text',$text);


> >> >>
> >> >> then hopefully it works out for you :D if not, tell us more about it.
> >> >>
> >> >> note you might also want to store more information about the SMS, such


> >> >> as time and the SMS center it came from ... etc.
> >> >>
> >> >> best wishes.
> >> >>
> >> >> Quoting bilal kamoto <bgk...@hotmail.com>:


> >> >>
> >> >> >
> >> >> > hi users,
> >> >> > I've successfully managed to install kannel it is able to send as
> >> >> > well as receive sms, i got the following script on the online it is


> >> >> > supposed to update database fields, message and sender and then send
> >> >> > a reply but i can only see the sender in the database the message
> >> >> > does show...


> >> >> > here is the php code
> >> >> > <?php
> >> >> >
> >> >> > define("DBHOST","localhost",true);
> >> >> >


> >> >> > define("DBUSERNAME","root",true);
> >> >> >
> >> >> > define("DBPASSWORD","bookert",true);
> >> >> >


> >> >> > define("DBNAME","kannel",true);
> >> >> >
> >> >> > $con=mysql_connect("localhost","root","bookert");


> >> >> >
> >> >> > if(! $con)
> >> >> >
> >> >> > {
> >> >> >
> >> >> > echo die('Connection Failed'.mysql_error());


> >> >> >
> >> >> > }
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >> > function insertSms($sender,$text)


> >> >> >
> >> >> > {
> >> >> >
> >> >> > $con = 'mysql:dbname='.kannel.';host='.localhost;
> >> >> >


> >> >> > try {
> >> >> >
> >> >> > $cmd = new PDO($con,root,bookert);
> >> >> >
> >> >> > $stmt = $cmd->prepare("INSERT INTO bilz (number,message)


> >> >> > VALUES (:sender,:text)");
> >> >> >
> >> >> > $stmt->bindParam(':sender',$sender);
> >> >> >
> >> >> > $stmt->bindParam(':message',$text);


> >> >> >
> >> >> > $stmt->execute();
> >> >> >
> >> >> > $cmd = null;
> >> >> >
> >> >> >

> >> >> >

> >> >> > if($stmt->rowCount()>0)
> >> >> >
> >> >> > {
> >> >> >
> >> >> > echo "Hello ".$text.". Thank you for your registration.";


> >> >> >
> >> >> > }
> >> >> >
> >> >> > else
> >> >> >
> >> >> > {
> >> >> >


> >> >> > echo "Sorry an error has occured";
> >> >> >
> >> >> > }
> >> >> >
> >> >> >
> >> >> >


> >> >> > }
> >> >> >
> >> >> > catch (PDOException $e) {
> >> >> >
> >> >> > echo 'Connection failed: ' . $e->getMessage();


> >> >> >
> >> >> > }
> >> >> >
> >> >> > }
> >> >> >
> >> >> >
> >> >> >


> >> >> >
> >> >> >
> >> >> > insertSms($_GET['sender'],$_GET['text']);
> >> >> >
> >> >> > ?>
> >> >> >


> >> >> > my sms-service group
> >> >> > get-url = "http://localhost/receivesms.php?sender=%p&amp; text=%a"


> >> >> >
> >> >> > please help
> >> >> >
> >> >> > Date: Tue, 22 May 2012 16:44:52 +0400
> >> >> > Subject: Re: kannel able to send but not receiving sms


> >> >> > From: spame...@gmail.com
> >> >> > To: bgk...@hotmail.com


> >> >> > CC: cornejo.alv...@gmail.com; users@kannel.org

> >> >> >

> >> >> > Please don't spam the list with the same messages.
> >> >> >
> >> >> > Thanks.
> >> >> >
> >> >> > 2012/5/22 bilal kamoto <bgk...@hotmail.com>


> >> >> >
> >> >> >
> >> >> > Thanks the bind error managed to sort it out, forwarding the sms to
> >> >> > an application then to database is what I need to crack


> >> >> >
> >> >> > From: users-boun...@kannel.org [mailto:users-boun...@kannel.org] On


> >> >> > Behalf Of bilal kamoto
> >> >> >
> >> >> > Sent: 19 May 2012 17:09
> >> >> > To: cornejo.alv...@gmail.com


> >> >> > Cc: users@kannel.org
> >> >> > Subject: RE: kannel able to send but not receiving sms
> >> >> > i have installed gnome admin network to deal with the bind am able


> >> >> > to see other applications running on it but i cant stop them really
> >> >> > dont have a clue how..
> >> >> >
> >> >> >
> >> >> > another thing i want to be forwarding the messages from the kannel


> >> >> > to mysql database and what is in the text field should be used to
> >> >> > query information and it should automatically return the values to
> >> >> > the initiator of sms.. please help


> >> >> >
> >> >> >
> >> >> > # HTTP administration is disabled by default. Make sure you set the
> >> >> > # password if you enable it.


> >> >> >
> >> >> > group = core
> >> >> > admin-port = 80
> >> >> > admin-password = bar
> >> >> > admin-deny-ip = "*.*.*.*"


> >> >> > admin-allow-ip = "127.0.0.1;192.168.0.*"
> >> >> >
> >> >> > smsbox-port = 84
> >> >> > #wapbox-port = 13004
> >> >> > wdp-interface-name = "*"


> >> >> > log-file = "/var/log/kannel/bearerbox.log"
> >> >> > access-log="/var/log/kannel/access.log"
> >> >> > box-deny-ip = "*.*.*.*"


> >> >> >
> >> >> > box-allow-ip = "127.0.0.1;192.168.0.*"
> >> >> >
> >> >> > group = wapbox
> >> >> > bearerbox-host = localhost


> >> >> > log-file = "/var/log/kannel/wapbox.log"
> >> >> >
> >> >> > # My modem
> >> >> > group = smsc
> >> >> > smsc = at


> >> >> > smsc-id = Nokia 5800 XpressMusic
> >> >> >
> >> >> > modemtype = Nokia
> >> >> > device = /dev/ttyUSB0
> >> >> > speed = 0


> >> >> > #pin = 2345
> >> >> > sim-buffering = true
> >> >> > #message-storage = MT
> >> >> >
> >> >> > # My modem group


> >> >> > group = modems
> >> >> > id = Nokia
> >> >> > name = Nokia
> >> >> > #detect-string = NOKIA
> >> >> >
> >> >> > #keepalive-cmd = "AT+CBC;+CSQ"


> >> >> > #init-string = "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
> >> >> > #init-string = "AT S7=45 S0=0 L1 V1 X4 &c1 E1 Q0"
> >> >> > #init-string = "AT+CMGL=0,1,2"


> >> >> >
> >> >> > #init-string = "AT+CNMI=1,1,0,2,1;+CMEE=1"
> >> >> > init-string = "AT+CNMI=2,1,2,2,0;+CMEE=1"
> >> >> > #enable-mms = true


> >> >> > #sim-buffering = true
> >> >> >
> >> >> > # fake smsc
> >> >> > group = smsbox-route
> >> >> > smsbox-id = bil


> >> >> > smsc-id = Nokia 5800 XpressMusic
> >> >> >
> >> >> > #port = 10000
> >> >> > #connect-allow-ip = 127.0.0.1
> >> >> >


> >> >> > #Send SMS
> >> >> > group = smsbox
> >> >> > smsbox-id = bil
> >> >> > bearerbox-host = localhost
> >> >> > sendsms-port = 13131


> >> >> > #receivesms-port = 13132
> >> >> > sendsms-chars = "0123456789 "
> >> >> >
> >> >> > global-sender = +255659375093

> >> >> > access-log = "kannel.access"

> >> >> > log-file = "smsbox.log"
> >> >> > log-level = 0
> >> >> >
> >> >> > #Receive SMS
> >> >> > group = sms-service


> >> >> > #keyword =
> >> >> > keyword-regex = .*
> >> >> > catch-all = yes
> >> >> >
> >> >> > #get-url = "http://localhost/kannel/receivesms.php?sender=%p&amp;


> >> >> > text=%b"
> >> >> > accept-x-kannel-headers = true
> >> >> >
> >> >> > max-messages = 0
> >> >> >
> >> >> > #Authentication


> >> >> > group = sendsms-user
> >> >> > username = jones
> >> >> > password = jones
> >> >> > Date: Mon, 14 May 2012 21:10:16 -0500
> >> >> > Subject: Re: kannel able to send but not receiving sms


> >> >> > From: cornejo.al...@gmail.com
> >> >> >
> >> >> > To: bgk...@hotmail.com


> >> >> > CC: us...@vm1.kannel.org
> >> >> >
> >> >> > Allways cc list. Others can benefiy from it


> >> >> >
> >> >> >
> >> >> > I have no experience with huawei modems. Seach the list for coments.
> >> >> >
> >> >> > Bind error is because you have another instance of the offending box


> >> >> > running. You can either use the http admin interface or use a init
> >> >> > script to handle this. Check userguide for detail.
> >> >> >
> >> >> >


> >> >> > Regards
> >> >> >
> >> >> > Alvaro
> >> >> >
> >> >> > On Monday, May 14, 2012, bilal kamoto <bgk...@hotmail.com> wrote:


> >> >> >> Hi
> >> >> >> I've tried sim-buffering still doesn't work. Am thinking of changing
> >> >> >> the
> >> >> >

> >> >> >> modem to Huawei but am not sure of the model that will support

> >> >> >> commands
> >> >> >> to
> >> >> >> receive sms in the kannel.
> >> >> >> Another problem every time I re-run the the bearerbox it show


> >> >> >> address
> >> >> >> already in use: bind system error do you have a permanent solution
> >> >> >> rather
> >> >> >
> >> >> >> than using < kill pid... to kill the processes


> >> >> >>
> >> >> >> -----Original Message-----
> >> >> >> From: Alvaro Cornejo [mailto:cornejo.alv...@gmail.com]


> >> >> >
> >> >> >> Sent: 11 May 2012 18:41
> >> >> >> To: bilal kamoto
> >> >> >> Cc: users@kannel.org


> >> >> >> Subject: Re: kannel able to send but not receiving sms
> >> >> >>
> >> >> >> Hi
> >> >> >
> >> >> >>


> >> >> >> If your modem does not support CNMI command --common in nokia
> >> >> >> phones--,
> >> >> >> it
> >> >> >> is not possible to configure it to fwd messages to kannel and form


> >> >> >> there to
> >> >> >> your app.
> >> >> >>
> >> >> >> Try with sim-buffering=true in your modem config so kannel will


> >> >> >> search
> >> >> >> for
> >> >> >
> >> >> >> inc messages in the modem from time to time.
> >> >> >>


> >> >> >> Regards
> >> >> >>
> >> >> >> Alvaro
> >> >> >>
> >> >> >>
> >> >> >>


> >> >> >>
> >> >> >> |---------------------------------------------------------------------------
> >> >> >> --------------------------------------|


> >> >> >
> >> >> >> Envíe y Reciba Datos y mensajes de Texto (SMS) hacia y desde
> >> >> >> cualquier
> >> >> >> celular y Nextel en el Perú, México y en mas de 180 paises. Use


> >> >> >> aplicaciones
> >> >> >> 2 vias via SMS y GPRS online
> >> >> >> Visitenos en www.perusms.NET www.smsglobal.com.mx y


> >> >> >
> >> >> >> www.pravcom.com
> >> >> >>
> >> >> >>
> >> >> >> On Fri, May 11, 2012 at 8:01 AM, bilal kamoto <bgk...@hotmail.com>


> >> >> >> wrote:
> >> >> >
> >> >> >>> Hi am using Nokia 5800 xpressmusic, I tried using Mincom to
> >> >> >>> initialize


> >> >> >>> the modem with AT+CNM=? It gave me an error what should be my next
> >> >> >>> move
> >> >> >>>
> >> >> >>> Please help


> >> >> >>
> >> >> >
> >> >> >>
> >> >> >
> >> >> > --
> >> >> >
> >> >> >


> >> >> > |-----------------------------------------------------------------------------------------------------------------|
> >> >> > Envíe y Reciba Datos y mensajes de Texto (SMS) hacia y desde


> >> >> > cualquier celular y Nextel
> >> >> >
> >> >> > en el Perú, México y en mas de 180 paises. Use aplicaciones 2 vias
> >> >> > via SMS y GPRS online


> >> >> > Visitenos en www.perusms.NET www.smsglobal.com.mx y


> >> >> > www.pravcom.com
> >> >> >
> >> >> >
> >> >>
> >> >>




                                          

                                          

Reply via email to