Recursive Function to output Category / Sub-category Breadcrumb

/// Recursive function to output the breadcrumb function breadcrumb($id,$layer=0,$out=”){ /// If id = 0 outputs that it is Root Category. No need to go any further. if($id ==0){ return “Root Category”; } /// if id > 0 fetches the details of the category first $crumbsql = mysql_query(“Select * From category Where cat_id = ‘”.$id.”‘ “);… Continue reading Recursive Function to output Category / Sub-category Breadcrumb

MySQL single and double quotes insertion

More than often while inserting some description into MySQL from a form input one faces a ‘single and double quote’ problem. For example while inserting the following text – I have both ‘ and ” quotes in my description To make the text safe for a MySQL insertion parse it with mysql_real_escape_string() That would make… Continue reading MySQL single and double quotes insertion