drjohn 56 Posting Pro in Training

PHP is server side only. All processing takes place there and only the results of the processing (an html page usually) are sent to the client.

drjohn 56 Posting Pro in Training

start with a browser reset. some people recommend huge resets, but I settle for the simplest one that works.

body {
margin:0;
padding:0
}

Next don't bother adding padding to any div itself, add it to the bits you add inside the div. That usually gets round lots of little problems.

drjohn 56 Posting Pro in Training

If you copy anything at all from a word doc, you must MUST MUST paste it into something like notepad (Or any decent text editor, which little old notepad is definitely not), the copy it from there into dreamweaver or any other program you happen to use.

This will dump all the dreadful word styles and formatting that will break your web page.

you can not copy from a word processor and get whatever styles you see there to work properly in a web page.

drjohn 56 Posting Pro in Training
drjohn 56 Posting Pro in Training

What type of application did you use to create you basic web page? A word processor? A text editor? A web page creation program?

From where I'm sitting just now I can see nothing wrong with your file, so we need a few clues.

drjohn 56 Posting Pro in Training

MySQL does not execute pairs of queries like that. Full stop.

drjohn 56 Posting Pro in Training

Sorry, but it crashes and burns when the content gets a bit long and then sits over the top of the footer which doesn't move downwards. Try adding 25 - 30 or so lines of fake content to see this. Number of lines depends on the size of your screen.

Crashed in Chrome, Firefox and IE.

drjohn 56 Posting Pro in Training

Well you can't expect to learn PHP and database theory overnight! There are a lot of basic concepts about programming, about database design, theory and normalisation, and using SQL that you have to learn. They will all take time, but learning is fun.

Some people jump straight in with, as their first plan, a project idea that would make many of us feel a bit out of our depth. Don't rush things, just practice, practice practice.

drjohn 56 Posting Pro in Training

In firefox File > Page Set-up > Format & Options, tick Print Background

drjohn 56 Posting Pro in Training

Hiding your menu in a tiny little line at the absolute bottom of the page is a bad idea. It's so bad that you've had to add a note to tell people where it is - put it near the top, make it bigger, and change your a:hover and a:visited code! Going to gray text on a gray background is a BAD idea - make it stand out on hover, not disappear.

ALSO do not use a gif image for a photograph, use a jpg. Using a jpg will give a more accurate rendition of the objects, and all your images will be about 40% smaller (the one I played with went from 63.3kB down to 36.3kB) thus giving faster page loading. Go back to your original images to make the jpg, using the gif will lead to any quality loss in the gif being transferred to the jpg made from it.

gif images are designed for line drawings, cartoons, areas with large blocks of the same colour. jpg are specifically for photographs. Use these image types the wrong way round and you have problems - make a large red square and save as a gif and then a jpg, to see what happens to image quality and file size.

drjohn 56 Posting Pro in Training

That's right, that's exactly how browsers print things.

Unless you tell them otherwise. You can't write it in the code, you have to tell your own personal browser to print the background image. Web pages aren't actually intended for printing, but for viewing on a PC. With a black and white printer, printing background images would mess up any printout, so excluding them is the default way browsers work.

drjohn 56 Posting Pro in Training

Technically that's not a hack, above, as a hack exploits an error to get a result. Filter is IE only proprietary code, the same way that when dealing with older browsers for shadows we use some proprietary code for them, like this

-moz-box-shadow: 4px 4px 4px #a6c6d1; <-- proprietary mozilla code
-webkit-box-shadow: 4px 4px 4px #a6c6d1; <--- proprietary webkit code
box-shadow: 4px 4px 4px #a6c6d1; <--- modern, css3 code

Then we'd add a conditional statement in the header to add IE filter effects for older IE.

Hacks may go wrong in the next new version of a browser if an error gets corrected, proprietary code and conditional statements can't go wrong, as they ONLY target the older dud browser.

drjohn 56 Posting Pro in Training

divs don't really inherit a width - they are all 100% wide unless you state otherwise. Okay, 100% of the width of their parent container, so it's sort of inheritance.

You should give your div a width that suits the image size you intend to use. Eg image is 350px wide, make div 360px and add padding of 5px, then a 1px border, to make it prettier.

Also float left or right can't work with a div UNLESS the div has a width - how can something that is 100% wide be moved to the left or right, it must always be touching the left and the right because it is filling all available space.

If you gave you div a background color or a border, you'd see it's true size and understand why you long captions just keep going on and on. This is also useful when other things go wrong as well.

EDIT when I scrolled down, I must have jumped past the post above, which says much the same thing.

drjohn 56 Posting Pro in Training

is UserID meant to be a field? because you're not creating that field in this table.

drjohn 56 Posting Pro in Training

The order of data in your table is totally and utterly irrelevant.
Extract you data as required via a query and include an ORDER BY clause.
Display it on your web page and fiddle around with the display using PHP.

No need at all to "re-order" a table. This is a basic tenet of relational database theory. And the same applies to the order that the columns appear in the table, even though most people like them to be in a semi-logical order.

Re query not seeming to work - test it at the command line or via phpmyadmin, or whatever db management tool you have. Then when you have a query that does what you want, start working on the web page version.

d5e5 commented: Well put. +2
drjohn 56 Posting Pro in Training

First, use an external stylesheet.
Then give the name a class - whatever name makes sense to you. eg .myCode
Give the div a width and a border, in the external style sheet.

Suggest you read up on css.

drjohn 56 Posting Pro in Training

One other helpful tip is when making a div, avoid adding padding to it as it will be inherited by the paragraphs, links, divs inside it as well. I find that if I add any padding required directly to the element in question - the paragraph or whatever inside it, it reduces cross-browser problems with how they handle inheritance. Also try to avoid state of the art effects, child selectors and the like.

However some of the latest effects can be applied via javascript for older IE, such as rounded corners, shadows on divs and text, and there are some good reliable scripts available. DD_Roundies (google it) gives reliable rounded corners in older IE, and conditional statements let you use IE's filters only in older IE, for the latter see this page http://alt-web.com/DEMOS/CSS-Shadows.shtml

BUT you can't use DD_Roundies AND a shadow on a div via the conditional statement methods above, due to the tricks the rounding script uses, so it's one or the other for IE I'm afraid. Text inside can have a shadow, I think, when using DD_Roundies.

drjohn 56 Posting Pro in Training

I've just tried this on a page of my own with a video on it.

I had to change both parts where it said width... height... (your line 2 and line 6) Although it got bigger, if I didn't change the values in proportion, I got a white area top and bottom, or left and right, depending on the error I made

eg 300 x 300 changed to 400x400 works, but 400x500 gives white space.

PS but it starts to look a bit pixellated if you make it much larger that the video was saved at.

drjohn 56 Posting Pro in Training

The emails are sent by the program/script referred to in the action part of the form, in this case that's requestsubmitted.asp That's probably where the problem is, assuming that people complete the form and things go wrong on clicking the send button. Forms are actually totally dead inert objects unless there is some script mentioned as the action, the form itself can send out anything.

drjohn 56 Posting Pro in Training

Like this

<pre><code>//Do a bit of code debugging     ||-- Check Array vals
  document.write ("&lt;ul&gt;");
  for (i=1;i&lt;array.length;i++)
   {
      str += "&lt;li&gt;Value of array " + i + " is: " +array[i] + "&lt;/li&gt;";
   }
  document.write(str);
  document.write ("&lt;/ul&gt;");
</code></pre>

<pre> is for pre-formatted stuff and retains the white space that html normally just discards. The numbers are just added by THIS forum. toggle to plain text view, to see how it looks in your own code.

NewOrder commented: Awesome it worked +0
drjohn 56 Posting Pro in Training

Buttons are hard to style, and tend to look different in different browsers.
Buttons are meant to be part of a data collection form, and should not really be used for ordinary links - that's what the "<input type=button" is saying. Input, as in data input.

You hear people talking about links as buttons and so many people wrongly call any link a button. If you want a pretty link, learn CSS and style your links that way.

drjohn 56 Posting Pro in Training

Sorting column names is never required. You specify the order you wish the columns to be displayed in your sql query or, on a php powered web page, in your php.

You are totally wasting your time trying to do this, it serves no useful purpose.

drjohn 56 Posting Pro in Training

Short words are ignored, the default minimum length is 4 characters. You can change the min and max word length with the variables ft_min_word_len and ft_max_word_len

according to http://www.petefreitag.com/item/477.cfm

so try 'SOM ' - note the space after som

drjohn 56 Posting Pro in Training

don't use tiny fonts anywhere!
They are hard to read

drjohn 56 Posting Pro in Training

And never use reserved words as your tag ids or classes!
eg body is a reserved word in html, and you use it as an id.
It is VERY bad practice to do that.

You can set the background-color to anything - to the body, an h1, h2, p, ul, you name it.

Oh, and do use a doctype, or you will trigger quirks mode, which is also a bad thing, as it is different in different browsers.

drjohn 56 Posting Pro in Training

What he said ^ above!!

drjohn 56 Posting Pro in Training

Use two divs, one inside the other.

give the outer div a background color.
give the inner one a different color.
give them both a width, and make that of the inner one smaller by the sum of the left and right "padding".
(eg outer width=800px, inner = 600px)
Set the margin-left and margin-right of the inner one to the "padding". (ie margin:whatever 100px; where whatever is top and bottom)

Learn CSS.

Frensi commented: Works perfectly thanks! +0
drjohn 56 Posting Pro in Training

Reserve: yes/no AND selected: yes/no are probably attributes of a player, not an entity.
So from all the players that belong to a team, some are selected and of those, some are reserves.
However, I'm doing this from your very limited description of your homework ;) homework? yes, it's a common problem to give.

drjohn 56 Posting Pro in Training

I found this bit of jquery yesterday!
http://www.keyframesandcode.com/code/development/javascript/jquery-highlight-plugin/
which does several useful things.

drjohn 56 Posting Pro in Training

The software to access phpmyadmin is called a browser, because phpmyadmin is a set of web pages with links and forms etc and php scripts. We build our own little version of such a thing on a course I did 8 or 9 years ago.

drjohn 56 Posting Pro in Training

To center a page, first it must have the entire content inside the outermost div, which must have a width applied in the css. Then you add margin:auto to that div's css and that's it done.
eg assuming like most people your outermost div has the id = "wrapper" (it's just traditional to call it wrapper, it doesn't matter what it's called)

#wrapper{
width:960px; /* or whatever you're using, but not the size of your own personal screen! */
margin:auto;
rest of your css styles for wrapper follow.

}

PS as for saying display:block - divs ARE block automatically...

drjohn 56 Posting Pro in Training

You don't "install" sql.
It is build into the database.
You install the database, that's all.

drjohn 56 Posting Pro in Training

A script that takes three minutes to process 65 entries???
What on earth is it doing in all that time?

drjohn 56 Posting Pro in Training

MySQL Manager Lite is a free database management tool from EMS.
http://www.sqlmanager.net/products/mysql/manager
scroll down the page to see the free version's download

I use this regularly for a routine task I have to do.

HeidiSQL is highly recommended by one expert I know of.
http://www.heidisql.com/
for some strange reason it can't connect to one of my databases (just one!) and as it happens to be the one I use most often, I haven't really used Heidi, but the expert who recommends it says it is generally the best thing around (he's also the author of a book on SQL, so he knows a thing or two)

Strangely, EMS's program can't connect to a different database of mine, but Heidi can! However I rarely need to work on that particular database, so I just use phpmyadmin from the browser.

PS WHY do you say remote access to phpmyadmin when you are asking for remote access to a database?

drjohn 56 Posting Pro in Training

Normally you would export the data from your spreadsheet first. Most people say use a csv file, but as your data can easily include a comma in a text field, this is not the best format. Use tab delimited text instead, available as a file type option in Excel.

Then you have to either use some database management program to connect to your server and use the load data in file command to import the data. At least that's what I do every week with MySQL.

But Google will probably help you if there is a different method for SQL Server.

drjohn 56 Posting Pro in Training

As I said, you use an order by clause to order the data. So amber would appear at the top with the other As

I suggest you buy and study this book
http://www.sitepoint.com/books/sql1/
It's title says it all.

drjohn 56 Posting Pro in Training

As you are selecting both dates before and dates after, you can do this in a single query by missing out the date condition completely and just sorting by the date!!!

IE
SELECT name, date FROM events ORDER BY date

drjohn 56 Posting Pro in Training

You simply do NOT insert anything in alphabetical order (or any other order for that matter). The order the data is stored in a database is totally and utterly irrelevant. What matters is what you do when you retrieve the data, and what data you retrieve of course.

To get the data in some order, you add an order by clause to the end of your sql query.

eg instead of
SELECT id, name, breed, gender, dateRescued
FROM animals
WHERE type ="dog";

you would use
SELECT id, name, breed, gender, dateRescued
FROM animals
WHERE type ="dog"
ORDER BY name;

I think you may have to read up a bit of databases if you think the order the data is stored matters ;)

brandonrunyon commented: comprehensive and clear explanation +3
drjohn 56 Posting Pro in Training

Hi,
I have read that strict xhtml is better than transitional xhtml for viewing the web for the visually impaired but can anyone tell me what the difference is? How is strict xhtml better than transitional xhtml.

Thanks inadvance.

It isn't.

YOU are the one that makes a page better or worse, depending on YOUR use of colours, font-sizes, contrast, animations, images. The doctype has no effect on these things.

PS And XHTML has no advantages over HTML in the real world.

drjohn 56 Posting Pro in Training

You can set up your own test bed server on your home computer, using XAMPP Lite, for free, and have MySQL and PHP running under Apache within minutes. This enables you to reliably create and test your PHP/MySQL code. It also matches what you are being taught at college, and gives you a copy of PHPmyAdmin to ease the creation of your databases and tables.

drjohn 56 Posting Pro in Training

As well as the css methods in the last two responses, you can use javascript. This is necessary if you wish you site to look the same in IE as in firefox and other modern browsers. Because IE doesn't yet support the css required

-moz-border-radius:15px; <-- for older mozilla browsers

-khtml-border-radius:15px; <-- for older khtml browsers

-webkit-border-radius:15px; <--- for older webkit browsers

border-radius:15px; <<--- for modern browsers that understand CSS3

So you need all four lines of css to cover all the browsers that do support rounded code; both older ones with their proprietary methods and newer ones which know a little bit of css3.

For IE you need javascript (but it doesn't always work perfectly - in one design I had shadows and rounded corners to add to older IEs and they couldn't do both, just one or the other.)

There are literally hundreds of javascripts available that target only IE, so you use the css and then a bit of javascript.

I've used DD_roundies a few times, available from
http://www.dillerdesign.com/experiment/DD_roundies/ ,
but googling on javascript for rounded corners in IE will give you many more to choose from.

Each has its strong points and weaknesses. I once found one that could even properly round the corners of divs with a background image, but got something else wrong (can't remember what it got wrong, or where it was either)


PS using the correct css …

drjohn 56 Posting Pro in Training

display:block is the default style for a div, therefore it is not necessary to state this the vast, vast majority of the time, as a div is by definition a block.

And block level elements sit under each other.

The normal way to get divs to sit next to each other is to define a width for them, and then float them right or left, as appropriate. Normally you would float them both the same way, but you can leave a gutter margin between them by floating one left and the other right (assuming that their widths don't either fill all available space, or more space than is available).

Using display:inline for a div begs the question WHY are you using a div when you want an inline element??? IE it is usually a mistake (not always, you may be after a special effect, it's just usually wrong).

So in conclusion, you normally have no use what so ever in applying display:block to a div. Ditto display:inline for a div. And not giving a div a width means that its width is 100% of the available space (but setting display inline changes its width to exactly that of its content, but WHY are you using a div when you want an inline element???)


PS you can't have divs in a loop, as a loop is part of an if or while or do statement in a programming language and html is not a …

drjohn 56 Posting Pro in Training

Your code says this.

<p align="center"><a href="http://www.ariahost.net/news.htm"> اخبار </a>- <a href="http://www.ariahost.net/aboutus.htm">درباره ما</a> - سوالات متداول -<a href="http://www.ariahost.net/support.htm"> پشتيباني</a> - <a href="http://www.ariahost.net/contactus">تماس با ما</a> -<a href="http://www.ariahost.net/map.htm"> نقشه سايت </a><br>
تمامي حقوق اين سايت براي شركت آريا هاست محفوظ است . © 1382 - 1389<br>

Copyright © 2003 - 2010 AriaHost.net , All rights reserved. Design By AriaHost Design Department </p>

So naturally it is centered.

But PLEASE try to use css and not inline styles! Such as
#footer p {text-align:center;}

And as for using tables!!! Your footer area is nested five tables deep! Using tables for layout is from a previous century.

PS Do you really charge $11,000 a year for hosting a 50MB site? Sure you don't mean $11.00

drjohn 56 Posting Pro in Training

FrontPage is to web development as a shotgun is to marriage - you can force it to work, but it's crude and nasty, and not true love.

You'll have to learn web development. Sorry, but there is no easy way out.

Lusiphur commented: Agreed :) +1
diafol commented: Aye, I second that +6
drjohn 56 Posting Pro in Training

fields in a table:
id
firstName
surname
dob
mobileNum
shoesize
city
eyecolor
job
roomNum
socialSecurityNumber


Superkey is any field or combination of fields that can uniquely identify a row
So the following are all superkeys
id
id, dob
id, socialSecurityNumber
socialSecurityNumber
socialSecurityNumber,job
socialSecurityNumber, job, dob
socialSecurityNumber, city, shoesize
id, socialSecurityNumber, eyecolor
id, socialSecurityNumber,roomNum
id, shoesize
id, shoesize, firstname, surname, job

and lots more.

IE ANYTHING that is a totally unique combination, even if it is a stupid combination, is a superkey.

Candidate keys are superkeys where if you remove one of the fields it is no longer a superkey (if the superkey is only one field, it is a candidate key automatically, but remembrr that you can have two or more fields in a primary key at the end)
eg
superkey (id, shoesize) - remove shoesize, and id is still a superkey, so (id, shoesize) is NOT a candidate key.

but id and separately, socialSecurityNumber are both superkeys and candidate keys, as can't remove any fields if there's only one in a superkey.

Primary key is easy - it's the candidate key that you decide to use (and any other candidate keys have to be declared unique, because they are). As you may not know the socialSecurutyNumber of someone, normally you'd use an assigned id instead, as …

drjohn 56 Posting Pro in Training

In simple terms, age is a calculated value, which will change with time. So NEVER store it, calculate it, as shown in the first answer given. Then it will always be the correct age.

drjohn 56 Posting Pro in Training

Without viewing your actual website, it's a bit tricky to guess what the problem is.

drjohn 56 Posting Pro in Training

Why are you wasting your time with tinyint, which as pointed out, has a max value of 127??? Just use int.

drjohn 56 Posting Pro in Training

Normally you will have one file which holds the connection details for the database (host, database name, username, password). This should be present as an include file. So you just change the appropriate bits of that file to match what the online provider has given you. (I keep one copy called local-filename.php and another called remote-filename.php and copy these over the filename.php when working on the local or remote version, rather than type the details in by hand each time I switch from working online and local.)

To get the actual tables and data online, you use your local copy of phpmyadmin or whatever other program you are using to look at the local database to make an extract of the table definitions and the data. Then you copy that and paste it into the equivalent program you use to look at the online database and execute the extract. The extract is actually an sql query to build the tables and to insert the data.

drjohn 56 Posting Pro in Training

Whatever size the frame is, the size of the page inside it is determined by that page's design and amount of content. Assuming it's the Tropical Fish News page, how about having less news? But honestly, why worry about it, your visitors will decide whether they wish to view it all or not.