Jump to content

help me process this incoming sms message(s) :D


Indrasaputra

Recommended Posts

hello :D ,

 

-I am making a STORE website with sms gateway feature

-all incoming and outgoing sms are saved in mysql tables

-GAMMU is the application for my sms gateway

 

please help me solve this problem :

-the incoming sms should be like this [for instance]

ABC 5,CBA 8,CAB 100

note : ABC,CBA and CAB are known as CODES that refer to product name in mysql table

and the following numbers are amount of item of each (well I just want you to know :P )

 

1.how to check that incoming sms whether it is in the right format like that I mentioned or not

-so if you :

add more space after comma

use other than comma such as ; or :

write down the CODES more or less than 3 character

or something else that is differ from the predefined format

, such message will be known as wrong message

 

2.how to know whether the CODES such as ABC,CBA and CAB are available in the table called 'products' in the column called 'product code',

 

-thanks alotttt :D

I'll be pleased to know your replies

Link to comment
Share on other sites

please help me solve this problem :

-the incoming sms should be like this [for instance]

ABC 5,CBA 8,CAB 100

note : ABC,CBA and CAB are known as CODES that refer to product name in mysql table

and the following numbers are amount of item of each (well I just want you to know :P )

 

1.how to check that incoming sms whether it is in the right format like that I mentioned or not

-so if you :

add more space after comma

use other than comma such as ; or :

write down the CODES more or less than 3 character

or something else that is differ from the predefined format

, such message will be known as wrong message

 

2.how to know whether the CODES such as ABC,CBA and CAB are available in the table called 'products' in the column called 'product code',

 

For number 1 you might want to look at using regular expressions to make sure the code is right. Take a look at his website:

http://www.regular-expressions.info/php.html

 

For number 2 you can use the explode function twice to get the codes to use in the mysql query.

E.g. ABC 5,CBA 8,CAB 100

explode using "," and get this

ABC 5

CBA 8

CAB 100

now explode using " "

to separate codes and numbers.

Now run a query to make sure all of the codes are right.

the explode function:

http://ca3.php.net/explode

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.