Indrasaputra Posted November 22, 2008 Share Posted November 22, 2008 hello , -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 ) 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 I'll be pleased to know your replies Quote Link to comment Share on other sites More sharing options...
Indrasaputra Posted November 22, 2008 Author Share Posted November 22, 2008 how to MOVE data from a table called 'inbox' in a database called 'sms' to a table called 'inbox' in a database named 'minimarket' , Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted November 22, 2008 Share Posted November 22, 2008 run a query to make sure its valid. Quote Link to comment Share on other sites More sharing options...
curt22 Posted November 23, 2008 Share Posted November 23, 2008 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 ) 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.