Basic SQL Syntax & Statement with Example

Posted by php | SQL | Thursday 26 November 2009 11:25 pm

Retrieving Data from Database:
The SQL statement that retrieves data from the database is called SELECT.

Basic Syntax: SELECT field1, field2, fieldn FROM table_name;

example:
select name, email, phone from friends;

Adding Data to the Database:

Basic Syntax:
INSERT INTO table_name (filed1, field2, filedn)
VALUES (‘filed1-value’, ‘field2-value’, ‘fieldn-value’);

Example:
INSERT INTO OFFICES (name, phone, email)
VALUES (‘trivuz’, ‘01010101′, ‘mailid@gmail.com);

Delete Data from Database:

Basic Syntax:
DELETE FROM table_name WHERE field = ‘value’; (condition)

Example:
DELETE FROM friends WHERE name=’trivuz’;

Updating Data:

Basic Syntax:
UPDATE table_name
SET field = ‘value’
WHERE field = ‘value’; (condition)

Example:
UPDATE friends
SET email = ‘info@trivuz.com’
WHERE name = ‘trivuz’;

Lesson 7

Posted by saad | Uncategorized | Saturday 28 March 2009 12:13 pm

Inserting a picture using HTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>

 

<img src="1.jpg" />
</body>
</html>

With the above written in the code part of the Dreamweaver version will result in a picture on your design view. Please remember to put your pictures in a relative path, meaning: all your html, pictures and other files should be kept in one single folder. Or else you won’t be able to see the pictures of other files in output.

Example: You have your file 1.html on your desktop and the image 1.jpg in My pictures in My Documents. When you look for the output, you might not be able to see the picture. Thus it is best to put both 1.html and 1.jpg in the same folder and then carry out the work.

Hope I could make my things clear. If not, please feel free to ask me questions. In the next topics I will try to end the basics of website building with simple tools. I will give ideas on how lists are to be made and what other simple tags can do to make the page look better.

Till then, keep on practicing. Cheers.

Lesson 6

Posted by saad | Uncategorized | Tuesday 24 March 2009 5:19 am

Personally I don’t like using codes while making tables, so I am going to show you an automated version of how you can make tables in Dreamweaver 8.

Click on new HTML document. After that follow the steps I write down:

View -> Design (This will take the window to design view. You will see the difference once you do it.)

Then:

Insert -> Tables

After that a box will come showing the rows, columns, table width, border thickness, cell padding, cell spacing, header and others. The best ways to get used to these things is by trying out different numbers in those boxes and then see the difference in the results. Seeing things practically gives more experience than something read theoretically.

This sort of sums up, using tables in a webpage. Fiddle with more options and learn more.

To know what the code looks like, you can go into the code view of your page to learn the codes.

For a table with 3 rows, 3 columns, border 2 and 800 width, here is the code:

<table width="800" border="1">
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>

Always remember that whatever you write in

<body> </body>

section, will be shown on the design view.

Hope I could make creating tables very clear to you. Please feel free to ask any kind of questions regarding this topic if you have any. Till next time… have a great day.

Lesson 5

Posted by saad | Uncategorized | Sunday 22 March 2009 5:35 am

Hi everyone. Hope each and everyone of you are doing well
and hope you have practiced some of the things I have gone through in my past
writings. Before progressing forward, I would ask you to always try the site

www.w3schools.com
. This site has almost all the information you need to
become a good website builder.

Today I will show something related to creating tables in a
website. If you want to become a coder, then it would be better if you use
Dreamweaver or any kind of suitable program and use the code section in it. I
prefer using Dreamweaver for both coding and automated website making. In this
whole series, I will be using codes more than anything else. If you want to know
how to do the automated one, please let me know and I will solve your problems.

Here is an example how to create a 2 row and 2 column
tables in your webpage.

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>

<title>Homepage </title>

</head>

<table width="697" height="457" border="1">

  <tr>

    <td>&nbsp;</td>

    <td>&nbsp;</td>

  </tr>

  <tr>

    <td>&nbsp;</td>

    <td>&nbsp;</td>

  </tr>

</table>

<body>

</body>

</html>

 

The first three lines are normally used while making any
kind of website now-a-days. This will be discusses more in future lectures.
Besides this, you can see a symbol &nbsp; – this means non-blank space.  This is
used to add spaces in a webpage between words or letters. You can try this out.
To me it is very useful. Though there are a lot of programs to write codes in,
but I prefer Dreamweaver 8. It is very much handy in some cases for advanced
designing.

Lesson 4

Posted by saad | Uncategorized | Saturday 21 March 2009 3:17 pm

I am back everyone for giving you more knowledge on what I am trying to prove as basic knowledge in web designing. Today I will talk more about some of the tags that are needed to make the pages of a basic website more flashy and colorful.

Before newer languages like XML, xHTML or CSS came into being, people used to use this HTML to build most of the sites.

Here are some new tags I am going to go on with today: (To note: all these tags are used in the body section. Examples of each will be shown as we progress)

[font face="Arial" size="3"] [/font] – Font face relates to the type of font that will be used in the text and the size related to the size of that particular font.

[body bgcolor="red"] – This is an inline tag. Inline means that it is used inside a parent tag. This bgcolor helps the page to change colors into red.

[a href="sunny.html"] [/a] – This is an anchor tag. It is used to link different pages with one another. Slowly I will be using it in examples so that it is further clear to all of you.

[img src="1.jpg"] [/img] or [img src="1.jpg" /] – This is used to add image into the page.

[br /] – This is used to insert a break in the middle of one line.

[p] [/p] – This is used to use a paragraph spacing between two paragraphs.

[form] [/form] – This is used to build any kind of form in a given page.

Besides these, the basic needs of building a websites are the tables sections, which I will go deeply in my next post.

Until then, have a super day.

*** Please use instead of [ ] while writing down your tags. Due to some problem, I am unable to provide you with accurate tag symbols. PLEASE KEEP A NOTE ON THIS.

Lesson 3 (Difference)

Posted by saad | Uncategorized | Tuesday 17 March 2009 8:03 am

Before we go deeper into let us know the difference between HTML’s Markup Language and Programming Language.

Markup Language is a language that is illogical, but the programming language has logics used in it.

Besides that, another difference is, Markup language works as an interpreter, but programming language needs a compiler to be worked out with. In easy words the compiler means an engine to run everything.

Now as we know the basic differences between a markup language and programming language, we can go deeper into basic html tags.

Hope you understand what I am trying to make clear.

Please feel free to ask any kind of questions and I will answer them in a flash.

Till next time, have a blast.

Lesson 2 (Basic HTML Tags)

Posted by saad | Uncategorized | Sunday 15 March 2009 5:22 pm

How to create a basic html page using notepad:

At first open a notepad anywhere you want to. Then write the following codes. After that, click on File and click on Save as. Give your file name as anything with an extension of .html at the end, e.g. sunny.html.

html

Later on wherever you have saved your file, you will see your file as ie if you are using internet explorer and ff for firefox browsers. Click on the page and there you will have your first webpage.

The elements I have used in are known as tags. All basic WebPages till now all around the world use the same tags as these for starting the work of a webpage. It should be clear that all tags have a beginning and an ending. E.g. . In this case, the body has both an opening tag and an ending tag. The ending tag needs to have a / before the particular info written in it or else the tags might not function properly. There are other types of tags that are called stand alone tags. They don’t need an ending tag. They open and close once they are written. E.g.  tag

Now, the page you have is totally a blank one. To add some content, I am providing you a little assistance.

html2

Whatever you write in the title section will be shown at a section at the left most top of your screen. Something like this: title and in the body section on the page, you will see Hello World written. In the next blogs I will show more tags that will come in handy for you to give your page a better look.

Till then, have a great time.

Lesson 1 (The Introduction)

Posted by saad | Uncategorized | Saturday 14 March 2009 7:19 am

At first, in this section, I will go on with some of the Terms of the things I will discuss in this blog.

HTML – Hyper Text Markup Language

xHTML – Extensible Markup Language

CSS – Cascading Style Sheets

XML – Extensive Markup Language

PHP – PHP Hypertext Preprocessors

& etc.

I will explain the rest as we go on into the topics in details.

Hope you will learn a lot from my blogs.

Best wishes to everyone.

The Beginning to Website Designing

Posted by saad | Uncategorized | Friday 13 March 2009 5:01 pm

Everyone wants to be a part of how a website can be made. There are many ways of building a website at present. Many use the old HTML, which is slowly transforming into xHTML. To add visual effects, people are using different resources including Flash (for animation), Photoshop (for designing logos, banners, etc), CSS for using visual styles into a website and others. In this modern world, people are even creating different languages to build websites such as XML, xHTML (something I have mentioned before), PHP, MySql (for database support), Joomla, Ajax and many others. All these programs are a mixture of different parent programs like C, C++, Dot Net and several others.

I have started going deep into some of these programs. To develop my websites before current times, I used mostly HTML, complete basic PHP, Flash and Dreamweaver. As I go deeper into new languages, I will be sharing my thoughts, the way I am working and how can things made be, to make a site on ones own. Besides my basic writing, one needs to do much more reading, practicing and implementing ideas to build what is called a perfect website for a beginner. I am a beginner too, but I want the people who don’t know much about building a website to have further knowledge on what websites are truly about.

Hope the readers of my blog post their comments and help out on my journey of becoming a successful website designer.

Thank you.

13 Vital PHP skills for every novice PHP developer and solutions

Posted by php | Reference, Tips & Tricks | Thursday 12 March 2009 1:58 pm

The most popular server-side scripting language. There are lots of articles & tutorials online that help novice PHP developers to learn PHP step by step. In this post I’ve listed some of the best PHP tutorials, articles & resources in some of the most important PHP skills. After reading the following tutorials and learning them (of course not all of them), you are free to name yourself a semi-professional PHP developer!

PHP Basics
Before getting started to improve your PHP skills, Just wait a moment and take a look to the two resources below to check whether you know the PHP basics or not.

* W3schools PHP tutorials – to learn PHP basics, is one of the most popular online resources
w3schools

* PHP 101: PHP For the Absolute Beginner – This 15-part series of PHP tutorials is intended for everyone new to PHP

# 1 – Object Oriented Programming (OOP) in PHP

OOP or Object oriented programming is one of the most intimidating aspects of programming in general and it’s not dedicated to PHP only. If you want to become a serious PHP developer, and you’re not going to make a simple contact form using PHP as your final goal!, You will definitely need to learn OOP in PHP. Here I’ve put together some of my favorite articles, tutorials and resources on OOP for you. (more…)

Next Page »