Is this code correct?
It is supposed to get input from SMS messaging API and save it to database. Mysql database is created with Table inbox and 2 columns called ID & Msg.
I want to know if this code is going to do the job? Else help me in correcting the code.
Thanks in advance...
Regards,
Righthe.
<?php
// database
$db_host = “localhost”;
$db_user = “username”;
$db_pass = “password”;
$db_name = “database name”;
// connect to mysql
$link = mysql_pconnect ($db_host, $db_user, $db_pass) or die (“can’t connect”);
mysql_select_db ($db_name) 0or die (“can’t select database”);
$msg = trim($msg);
//input to table inbox
$sql = “INSERT INTO inbox
SET id=”,
msg=’$msg’”;
$query = mysql_query($sql) ;
?>