Useful to set one of the columns as the primary key. To make the primary key an auto generated number create the column as type 'int' then in its properties : Identity Specification = Yes Identity Increment = 1 Identity Seed = 1
All posts by
Sanitizing Queries
Use parameter based queries instead of trying to sanitize strings – its much safer and easier. Good resources: http://stackoverflow.com/questions/249567/algorithm-to-avoid-sql-injection-on-mssql-server-from-c-sharp-code C++ .Net example of a parameter based query SqlConnection1->Open(); SqlClient::SqlDataAdapter ^SqlDataAdaptor1 = gcnew SqlClient::SqlDataAdapter(); SqlDataAdaptor1->MissingSchemaAction = MissingSchemaAction::AddWithKey; DataSet ^DataSet1 = gcnew DataSet(); SqlClient::SqlCommand ^SqlCommand1 = gcnew SqlClient::SqlCommand(); SqlCommand1->Connection = SqlConnection1; SqlClient::SqlCommandBuilder ^CmdBuilder1 = gcnew SqlClient::SqlCommandBuilder(); CmdBuilder1->DataAdapter […]
Favicon
favicon size One item to note is that in the article above, Google now says not to provide a 16×16 pixel favicon. Once upon a time, a 16×16 pixel favicon was the only size you were supposed to provide. However, now they should be much larger (e.g. 512×512) as Google and others now routinely show […]
Integrating Twitter
This guide and library works great: http://stackoverflow.com/questions/12916539/simplest-php-example-for-retrieving-user-timeline-with-twitter-api-version-1-1
json decode-convert to PHP array
Check for json values present Reading json from a file json stored within json fields When you decode remember that you will need to decode the nested json field as a separate decode operation, you won’t get a single array which automatically nests the sub json.
Redirect to new domain
Note – browsers cache redirects – if you change a redirect and then try again your browser may not be hitting the old domain when you return!!! Try using temporary redirect code 307 when you debug in place of 301 permanent redirect??? Redirect codes 301 – permanent redirect 307 – Temporary redirect Redirect from old domain to […]
Turn Off Commenting
Turning Off Commenting For New Posts Settings > Discussion > uncheck "Allow people to post comments on new articles" To turn off commenting for already publish posts Posts > select them all and "Edit" under bulk actions and hit apply > choose "do not allow" next to comments and hit update posts.
Template Themes
Knowledgebase Theme Templates athemes.com/collections/best-knowledge-base-wiki-wordpress-themes/ KnowHow
Post
Individual Post File single.php Showing the posts featured image Use this in single.php: <?php //>>>>> SPECIAL – SHOW THE FEATURED IMAGE if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it. the_post_thumbnail( ); /*Size is set in style.css*/ } //<<<<< ?> To set the size and use […]
Homepage
Path to homepage Altering default homepage To create a customised homepage copy your index.php file and call it home.php. WordPress will use home.php for the home page of your site if it finds one, otherwise it will use index.php (there is also a more complicated way by changing settings). Showing posts from a specific category […]