Pirate
02-03-2006, 09:13 AM
This should be a simple one. But it's got me stumped.
I've got this SMS sending script which I use at work (thanks heaps to those who helped me get this going). I've learnt a bit since then and now the script logs everything into a mysql database which has filters, search etc.. its fully sick.. *proud*
Anyway, I just found and damn bug and I am not sure how to fix it.
This is the portion of the script I use to dump the data into the database.mysql_connect("localhost", "#####", "####") or die(mysql_error());
mysql_select_db("smslog") or die(mysql_error());
mysql_query("INSERT INTO thelog (txt_Phone, txt_Ref, date_time, DTnumber, txt_Message) VALUES ('$strAddress', '$strReference', '$date_time', '$strDTReference', '$strContent' ) ");The problem lies in the $strContent. It takes normal text fine, but when someone uses a ' ie: Tom's it spits the dummy.
Anyone know the cause?
I've got this SMS sending script which I use at work (thanks heaps to those who helped me get this going). I've learnt a bit since then and now the script logs everything into a mysql database which has filters, search etc.. its fully sick.. *proud*
Anyway, I just found and damn bug and I am not sure how to fix it.
This is the portion of the script I use to dump the data into the database.mysql_connect("localhost", "#####", "####") or die(mysql_error());
mysql_select_db("smslog") or die(mysql_error());
mysql_query("INSERT INTO thelog (txt_Phone, txt_Ref, date_time, DTnumber, txt_Message) VALUES ('$strAddress', '$strReference', '$date_time', '$strDTReference', '$strContent' ) ");The problem lies in the $strContent. It takes normal text fine, but when someone uses a ' ie: Tom's it spits the dummy.
Anyone know the cause?