Jump to content

real escape


serverman

Recommended Posts

how do i add the mysql real escape string to this

	<?php
//this is just a snippet 
// Check for a description
if (strlen($trimmed['desc']) > 1) {
	$d = $db->sql_escape($trimmed['desc']);
}
else {
	$d = FALSE;
	$err .= '<div class="err">The description is invalid!</div>';
}

// Check for tutorial content
if (strlen($trimmed['tut']) > 1) {
	$con = $db->sql_escape($trimmed['tut']);
}
else {
	$con = FALSE;
	$err .= '<div class="err">The tutorial content is invalid!</div>';
}

if ($t && $cat && $d && $con) {
	$db->sql_query("insert into tut (title,cat_id,description,usr_id,content,time) values('$t','$cat','$d','$uid','$con',now())");
}
}
?>

Link to comment
https://forums.phpfreaks.com/topic/110841-real-escape/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.