Forum Moderators: coopster
Example, \'
Below is the Mysql query to insert data into the db. Is there any way to streamline this before the insert is complete?
$result=MYSQL_QUERY("INSERT INTO $table (wf_FirstName1,wf_LastName3)".
"VALUES ('$wf_FirstName1', '$wf_LastName3')");
$result=mysql_query("INSERT INTO $table wf_FirstName1,wf_LastName3) VALUES ('".mysql_real_escape_string($wf_FirstName1)."', '".mysql_real_escape_string($wf_LastName3)."')";
:)
Yes you are, however, I was unsure if
$table was defined from the client or by you in the script before the query. If any variable is put into a query where its value comes from user input then it must be escaped first.
$result=mysql_query("INSERT INTO $table wf_FirstName1,wf_LastName3) VALUES ('".mysql_real_escape_string($wf_FirstName1)."', '".mysql_real_escape_string($wf_LastName3)."')"[b])[/b];
Good luck!
$result=mysql_query("INSERT INTO $table [b]([/b]wf_FirstName1,wf_LastName3) VALUES ('".mysql_real_escape_string($wf_FirstName1)."', '".mysql_real_escape_string($wf_LastName3)."')");