background preloader

PHP

Facebook Twitter

Add a column to an existing MySQL table. MySQL tables are easy to extend with additional columns.

Add a column to an existing MySQL table

To add a column called email to the contacts table created in Create a basic MySQL table with a datatype of VARCHAR(80), use the following SQL statement: ALTER TABLE contacts ADD email VARCHAR(60); This first statement will add the email column to the end of the table. To insert the new column after a specific column, such as name, use this statement: ALTER TABLE contacts ADD email VARCHAR(60) AFTER name; If you want the new column to be first, use this statement: ALTER TABLE contacts ADD email VARCHAR(60) FIRST; Share this article If this article helped you, please THANK the author by sharing. The Conversation Follow the reactions below and share your own thoughts. Hover popups - Wickham's HTML & CSS tutorial. Wickham's HTML & CSS tutorial Sitemap | Home | Search View in Firefox, Safari, Opera and IE but IE6 often needs different solutions.

Hover popups - Wickham's HTML & CSS tutorial

In general IE7 and IE8 display like Firefox apart from the HTML5 and CSS3 features. The IE9 & above updates are mainly related to HTML 5 and CSS3 issues and display to a large extent like other main browsers. Google Chrome is based on the same WebKit engine as Safari. Some of the examples are provided just to show problems, others show solutions that work in most major browsers.

Problems warning: works in some situations or some browsers or needs care to display as you wish OK in Firefox, Safari, Opera, Google Chrome and IE. Controlling spell checking in HTML forms. Firefox 2 introduces spell checking support to text areas and text fields in web forms.

Controlling spell checking in HTML forms

The user can specify using the about:config interface whether or not spellchecking is enabled and whether to check both text areas and text fields or only text areas. By default, text areas and designMode documents get spell checked while single-line input boxes do not. This is because it would be distracting to users if Firefox marked things like user IDs, and e-mail addresses as errors. However, there may be situations in which this behavior is not necessarily appropriate.

For instance, if a text area is intended to be used for editing HTML or other non-prose data, the spell checker would be a hindrance rather than a help. PHP Tutorial - Quotes - Single and Double. Topics on this page: In javascript, you can use either single (') or double (") quotes and they behave the same.

PHP Tutorial - Quotes - Single and Double

In php, it is different. Double quotes and single quotes aren't exactly the same. $something="Oh something"; echo "My answer is $something. <br>"; //result is: My answer is Oh something In the above, using double quotes, the variable $something is evaluated within the quotes and the result isn't what is expected: the variable is evaluated to Oh something. Echo 'My answer is $something. When single quotes are used, as above, the variable isn't evaluated and is printed on the screen literally as $something. Escaping with the backslash \ The backslash character (\) can be used to escape quotes and variables. $something="Oh something! " So nothing new here, just a reminder. Single Quotes PHP - Double Quotes PHP.

Send, pass, get variables with PHP, Form, HTML & JavaScript code. Skytopia > Projects > Technology/science/misc articles > HTML Forms in a nutshell All code on this page is considered by us to contain the most basic and important aspects of form sending.

Send, pass, get variables with PHP, Form, HTML & JavaScript code

This page basically shows in the shortest possible way how you can:Test your PHP offline - Test your PHP pages offline easily, without installing your own web server.Send variables between Javascript, Form and PHP on the same page:Send variables from one page to another: * URL variables to PHP/JavaScript page - Allow sending different variables via the URL string to the new page (readable through PHP or Javascript). HTML - PHP Form Example. Use this example as a form walkthrough.

HTML - PHP Form Example

We will briefly build an HTML form, and call the form data using PHP. PHP offers several methods for achieving this goal, so feel free to substitute alternative methods as you follow along. Our example will show you a method using a single .php file, combining both PHP and HTML in one simple text file, to retrieve the data and display the results. Below is a quick review of bullets, check boxes, text fields, and input fields and using them to build a form to retrieve some personal information about our user. Step 1 is to build the form document to retrieve user date. Input fields are the simplest forms to grasp. Code: <html> <head> <title>Personal INFO</title> </head> <body> <form method="post" action="<? The catch with radio buttons lies with the value attribute. Check boxes require the use of an array. ...

In reality, textareas are oversized input fields. ... ... PHP - How Do I generate new text-fields based upon a select option field value.