ElectricShaka Posted January 1, 2008 Share Posted January 1, 2008 This is my code: <?php /* Function addNewType * Desc Adds a new pet type and description to the * ThemeType table. Checks for the new theme type * first and does not add it to the table if * it is already there. */ function addNewType($themeType,$typeDescription,$conn) { $query = "SELECT themeType FROM theme WHERE themeType= '$themeType'"; $result = mysql_query($query) or die(“Couldn’t execute select query”); $ntype = mysql_num_rows($result); if ($ntype < 1) // if new type is not in table { $themeType = ucfirst(strip_tags(trim($themeType))); $typeDescription = ucfirst(strip_tags(trim($typeDescription))); $themeType = mysqli_real_escape_string($conn,$themeType); $typeDescription = mysqli_real_escape_string($conn,$typeDescription); $query=”INSERT INTO themeType (themeType,typeDescription) VALUES ('$themeType','$typeDescription')”; $result = mysqli_query($conn,$query) or die(“Couldn’t execute insert query”); } return; } ?> The error I get is: Parse error: parse error, unexpected T_STRING in /homepages/9/d209608306/htdocs/epiklayouts/functions.inc on line 11 Any help is greatly appreciated. The above code is actually a file named functions.inc which I include in other php files when it is needed. I can post the other coded files if necessary. Quote Link to comment https://forums.phpfreaks.com/topic/84009-solved-please-help-with-unexpected-t_string-error/ Share on other sites More sharing options...
trq Posted January 1, 2008 Share Posted January 1, 2008 The problem appears to be that your using “smart quotes” instead of the standard " Quote Link to comment https://forums.phpfreaks.com/topic/84009-solved-please-help-with-unexpected-t_string-error/#findComment-427497 Share on other sites More sharing options...
ElectricShaka Posted January 1, 2008 Author Share Posted January 1, 2008 Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/84009-solved-please-help-with-unexpected-t_string-error/#findComment-427537 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.