Hi everyone :)
I am working on a small error message, but i can not seem to get it to work correctly.
Basically, what I am trying to do, is check the account balance field from a mysql database
against a variable of $smsnum
smsnum is automatically populated based on the number of charatcers entered.
this is working as it should do.
The problem I am facing is if the account balance is less than the number of messages being sent, the error message should be displayed and the script should stop working and display the error message.
What I am trying to do is display an error message if the account balance is less than the number of message being sent against a variable of $smsnum
So if $smsnum is greater than account balance - display the error
Here is the code for my error message.
This has been driving me mad for the last few days now, hope someone can point me in the right direction or explain to me what I am doing wrong
if($smsnum != '') {
if( strlen($smsnum) > 1 )
$qryt = "SELECT accbala, securecode FROM table WHERE securecode='$securecode'";
$result = mysql_query($qryt);
if($result) {
//if($result['accbala'] < $smsnum) {
if(mysql_num_rows($result) < $smsnum) {
$msg_lowtexts = '<img src="images/loadingsms.gif" width="16" height="16"
hspace="2" vspace="2" align="left" title="Low message" alt="Low message" />
<font color="#FF0000" size="-3"> Can not send your message<br />
You do not have enough texts - Try shortening you message below or <strong>top up with more texts</strong></a>
</font>';
@mysql_free_result($result);
$b1=false;
}
}
}