DontheCat Posted August 22, 2007 Share Posted August 22, 2007 Dreamweaver creates this code automatically when using the Form creation options. Can someone pls explain what the code actually does ? Thanks <?php function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue; switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } Quote Link to comment https://forums.phpfreaks.com/topic/66207-mmdw-function-what-does-it-do/ Share on other sites More sharing options...
chronister Posted August 28, 2007 Share Posted August 28, 2007 Sorry that I am not gonna help with your original question, but my advice is don't let dreamweaver do any coding for you except for HTML. I use DW8 / CS3 (Depending on which of my pc's I am using at that time) to develop and I learned real quick that DW is not very good at making clean easy to read code. In the end, your better off coding it yourself so you learn and also so you know what the code does. Nate Quote Link to comment https://forums.phpfreaks.com/topic/66207-mmdw-function-what-does-it-do/#findComment-335963 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.