I'm submitting a form and inserting the valuse into my mysql db. One of the form elements it a select with option values like 11#120#12 (id#cost#months).
I perform the following:
$plan = explode("#", $_POST['symb']);
$plan = $plan[0];
$cost = $plan[1];
and then submit to my db
echo $insertSQL = sprintf("INSERT INTO users (username, plan, cost) VALUES (%s, %s, %s)",
GetSQLValueString($_POST['username'], "text"),
GetSQLValueString($plan, "text"),
GetSQLValueString($cost, "int"));
The problem is that $cost is getting the wrong value, instead of 120 it's getting 1 as a value. Where's the error? (the posted sql statement is only part of the actual query, for demonstration purposes only)
$planin line 2