drjohn 56 Posting Pro in Training

There's nothing wrong when I view them in safari, chrome, firefox, IE5, IE6, IE7 and IE8, except for the Media page.

When i run just the media page through the validator it throws up 48 errors, including unable to determine parse model.

This might be becasue you only have half th edoctype declaration

it should be
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

but the page only has
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

So try editing the doctype to the full code. Also do this in some primitive text editor, as the validator mentions unicode as you have the outer page in charset=us-ascii" so try setting
ascii everywhere

drjohn 56 Posting Pro in Training

give the image a height of 100% and a width of 100% (or whatever numbers suit you.

HOWEVER it will look distorted and pixelated

diafol commented: like it - doh! fuzzy thinking on my part +6
drjohn 56 Posting Pro in Training

SELECT * FROM userbooks WHERE book_title LIKE '%yourWord%' or book_title LIKE '%otherWord%';

alternatively if both words must be present.

SELECT * FROM userbooks WHERE book_title LIKE '%yourWord%' AND book_title LIKE '%otherWord%';

is the correct way to do this.

Similarly

SELECT * FROM userbooks WHERE book_year LIKE '%33%';

drjohn 56 Posting Pro in Training

The query is returning the CORRECT data

Because the join is on agentID and there is no link between the customer and the product, but there is a link between the agent and the TWO products.

so the join of agent to product produces two rows, and EACH row then joins to the customer with the same agentID, and there are two of them, so you get four rows.

In other words, your tables are wrong.

You are relating ALL customers of each agent to ALL products of each agent.
Don't customer buy/use products, shouldn't you have some table which lists which customers are buying/using which products.
ie a customerProduct table with the customerID and the productId in it, to link each customer to their specific products.

It's called normalisation.

drjohn 56 Posting Pro in Training

The answer above is how I do it. The function nl2br() was created specifically for this sort of thing.

drjohn 56 Posting Pro in Training

And not every server is set up to use server side includes.
Which has annoyed me several times in the past.

drjohn 56 Posting Pro in Training

In other words it's a standard many to many relationship between orders and products, and so the standard linking table between orders and products is required, as described by urtrivedi .

drjohn 56 Posting Pro in Training

Kaycy, a div is what is called a generic container, a box, a block, into which you put things - menus, content, images. You can have all of them in the one div, or you can have one div for each, whatever suits your layout.

A span in an inline thing, used to style a small part of a bigger thing. Like the words inline thing above this. (Note that when you make things bold here, it is NOT html you see but another type of code that teh forum code knows how to convert into html.)

The MS site is VERY strangely laid out, it uses multiple spans and divs in many places, often dozens at a time, when often one would be enough. It is probably generated via an in-house content management system. These are often designed to be robust enough that the user, who may know nothing about web design at all, can produce usable content that will work in any browser. So a technical expert on, say anti-virus software might be explaining how the anti-virus software works or telling you about new viruses, and just entering text into a box, like the one I'm using. Similarly, a public relations person may be producing a news item to appear on the page, again with no knowledge of html, while a database expert might be telling you about Access, with no knowledge of web design.

So, the code behind the page is not necessarily written …

drjohn 56 Posting Pro in Training

The tables vs CSS discussion comes up when a beginner first tries tables for layout, then someone points out that tables are for displaying data. Then people discuss the topic. This is exactly what has happened here, isn't it? There is no debate among experienced users and pros.

As for forms and tables <sigh>
http://designshack.co.uk/articles/10-css-form-examples

http://www.alistapart.com/articles/prettyaccessibleforms (nice colour gradient, try that in a table)

http://www.themaninblue.com/experiment/InForm/index.htm (the examples, not the crude unstyled version, of course)

http://articles.sitepoint.com/article/fancy-form-design-css
(they even have an entire book of fancy forms, all by css)

http://www.webdesignermag.co.uk/tutorials/make-your-forms-beautiful-with-css/

http://www.smashingmagazine.com/2006/11/11/css-based-forms-modern-solutions/

http://woork.blogspot.com/2008/06/clean-and-pure-css-form-design.html
(nice basic tutorial)

And note that these are OLD articles.

PS as for Microsoft knowing about things like web design let me say just one word
FrontPage ;)

drjohn 56 Posting Pro in Training

Tables were invented in html for displaying tables of data.

People then tried using them to control the visual layout (yes, I admit it, when I was younger I did this too).

Then in 1996, CSS came out, and by the end of the century, CSS was adopted by pros to layout pages. So it is not some new technique, and by internet standards it is old.

There is NO debate any more (not since about 2000 - 2002 anyway).
Use CSS, it was invented for styling pages.
Use tables for displaying tables of data.

drjohn 56 Posting Pro in Training

In Notepad++, the choice of professionals everywhere, once you have saved a document with its extension (so it knows what language you are working in) when you start typing, it pops up a list of tags/function/whatever that begin with the first few letters you have entered. Great when entering PHP function names, for example, as there are so many of them.

It doesn't offer the intellisense of VB.net or Eclipse, unfortunately. But it is so lightweight compared to these two.

I also love the way I can have five or ten tabbed files open at once and if I close it, it remembers which tabs were open the next time I start it. VERY handy for continuing from where you left off.

And it's so easy to learn and understand too ;)

drjohn 56 Posting Pro in Training

notepad (not even worth the uppercase in its name) is to Notepad++ as a rusty bike with broken spokes, one wheel, no pedals or seat and a broken chain is to a Ferrari...

drjohn 56 Posting Pro in Training

I'd guess that your css file got lost on the way to your browser, or got corrupted in some way (and then the corrupted version got cached and keeps getting used on your local machine).

you have the correct code to get rid of the list's dot - list-style:none; - so try Ctrl-F5 for a forced refresh and see if that solves it for you.

A quick link to your site would save people having to create pages to test your code.

drjohn 56 Posting Pro in Training

no, believe me. i work in firefox and its not required tos ay the least. im just really happy u dont understand! I feel like im the diamond in the rough!

The fact that you had to ask about html5 and the things you asked show that your knowledge of doctypes (and a few other things) is severely limited, and you probably haven't heard of quirks mode.

Perhaps you haven't viewed your site in IE to see how the most widely used browser displays it.

Perhaps you cold give us a link to your site, to impress us?

drjohn 56 Posting Pro in Training

yes

Set the small screen css first in the normal way. Then use javascript to over ride this with the wide screen version. No need to mention the small one in the javascript.

drjohn 56 Posting Pro in Training

What format are the images in?

Also, creating a web page using MS Word, or any other program not originally designed to create web pages really does make helping you very difficult, as the page will be full of rubbish whose sole purpose is to convert it back into a word doc.

drjohn 56 Posting Pro in Training

In my opinion this is the best reference:
http://matthewjamestaylor.com/blog/perfect-3-column.htm

That's one overly complicated way to get a simple three col layout!!!

<div id=wrapper>
<div id=header>
</div>
<div id=left>
</div>
<div id=content>
</div>
<div id=right>
</div>
<div id=footer>
</div>
</div>

That's how the rest of the world does it. With left, content and right all floated left. body has margin 0 and padding 0. Wrapper is given padding 0 and usually margin 0 auto. Width for header and footer usually the same as wrapper, and they both have margin 0 and padding 0.

Job done.

PS Formal name? ? ?

drjohn 56 Posting Pro in Training

I think you'll find that's exactly what the Frankey gave you.

Or you can try http://www.cushycms.com/

drjohn 56 Posting Pro in Training

A union is used when a set of columns with the same name and same data-type are present in two tables (or the same table but two aliases, and you are querying on two exclusive sets of conditions) and you wish to present the combined data extracted from each table.

A join is used when you have a primary key in one table that is a foreign key in another table and you wish to pull the data from one table that matches the key from the other table.
eg emp{empID, name, address, universityID, etc}
University (universityID, uName, uAddress, etc}

and you want the employee's name address and the name and address of the university that they attended.

So you join the two tables on employee.universityID = university.univeristyID

drjohn 56 Posting Pro in Training

Arrange the order of the columns to match that of the database, and every column in the database must have a matching column in the spreadsheet.

Export the data from the spreadsheet as txt (tab delimited) not csv.
no column headings, as already mentioned.

Run a query like this.

load data local infile "C:/Documents and Settings/dr john/My Documents/logpile/AccountDataExport_2010-03-26.txt" into table mycounts;

I do this every week to update an online database with an extract from an offline one.

I do this remotely using SQL Manager Lite for MySQL, which is free from EMS.

drjohn 56 Posting Pro in Training

Well, some other part of your code elsewhere is breaking the system, because I just made a test page using your code, and the colour was applied the same in FF and IE7, exactly as I expected it would.

I also stuck a link outside your table, gave it a different color and it worked too.
Do you have a sample page online where we can look and see what else is going on?

PS You are not really using tables for layout purposes, are you??? That is literally soooo last century. Tables are for tables of data, not layout control. CSS is for styling, including the size and position of divs, and thus for layout control.

drjohn 56 Posting Pro in Training

A color not being supported in IE7!!! Total nonsense. Be serious!

As for the original question, seeing a bit of code might be more helpful, so we can see what you've done wrong rather than just guessing.

drjohn 56 Posting Pro in Training

try this instead

$sl="INSERT INTO stud (name,CID) VALUES ('$_POST[name]','$id')";

PS also try echoing the $id to make sure there is a value

drjohn 56 Posting Pro in Training

http://www.sqlmanager.net/products/mysql/manager

And the lite version is free to use.

drjohn 56 Posting Pro in Training

Only IE can read conditional statements, so you do not put the default css file in there, you put if before the conditional statement, and then bits in the css file loaded by IE will override the same bits in the default file.

<link href="../styles/main.css" type="text/css" rel="stylesheet" />

<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="../styles/main-ie6.css" /><![endif]-->

Every other browser will get main.css, and ie6 alone will get main-ie6.css

simples.

drjohn 56 Posting Pro in Training

Tables for layout are a bad idea. Do try to learn about divs.

Google on son of suckerfish to learn how most people make menus with sub-menus. It's very simple to use.

drjohn 56 Posting Pro in Training

re by category - yes just substitute the category bits for the manufacturer bits.

drjohn 56 Posting Pro in Training

Okay it looks like the ERD is manufacturer--< vehicles >--products
Ie a manufacturer makes many vehicles, and a product is used by many vehicles

That means this might be what you are after

SELECT m.manufacturer_name, v.vehicles_model, v.vehicles_year, v.vehicles_engine_size, v.vehicles_fuel_type, p.products_ID
FROM manufacturer as m
JOIN vehicles as v on m.manufacturer_ID = v.FK_manufacturer_ID
JOIN products as p on p.products_id = v.FK_products_ID
WHERE manufacturer_name = "ALFA ROMEO"
LIMIT 0 , 30;

But that is possibly not what you really, really want. It implies from your table design that one product is used in many vehicles, but each vehicle uses only ONE product. Is that right?

Are you sure there isn't a linking table, as a more normal (sic) structure would be that a vehicle uses many products and a product is used in many vehicles ie vehicles>--<products
which would then require the linking table vehicleproducts, with the following relationship
vehicles--<vehicleproducts>--products

and vehicleproducts (vehicle_ID, product_id) with a joint primary key.
Unless of course this is a very special product and a vehicle only uses one eg one model of turbocharger is used, and the web site is to sell the one model they make that suits a given car perfectly. (I saw a site just like that two days ago).

davidjennings commented: Excellent help & feed back from drjohn +1
drjohn 56 Posting Pro in Training

you'd really have to show us the table schemas before we can answer which fields to use in the join.

also it gets a bit easier to read if you use table aliases eg

SELECT m.fname, m.sname, s.game, l.league
FROM membership as m
JOIN gameplayed as g ON m.mid=g.mid
JOIN leaguetype as l ON g.gid=l.gid
WHERE.....
drjohn 56 Posting Pro in Training

IE6 currently has about 10% of the market in browsers, so you may not need to worry about this for very long.

drjohn 56 Posting Pro in Training

margin:0;
padding:0;

drjohn 56 Posting Pro in Training

PHP is executed at the server, javascript is executed in the browser. Like html, javascript is plain text. So of course it loads as fast as html - it is simply sent directly to your browser, just like html. Your browser or computer might be slow at using the script and there's nothing you can do about that, apart from upgrading.

If you use external javascript files, as you should do most of the time, the file will be cached on the user's PC, and so when needed a second time, it will not be retrieved from the server.

You can't convert javascript to html - it is a script that is designed to be executed and alter existing html, to provide effects in the browser, to provide user interaction without the user having to reload the page from the server. PHP interactions however always require a call to the server and the page to be resent. So trying to do the same thing in php that javascript can do would be a slower process as the server would be involved at every stage and new pages would have to be sent to the user.

So I think you should start by asking yourself what exactly you think you are trying to do and whether you actually need javascript or PHP at all.

drjohn 56 Posting Pro in Training

goto is a throw-back to the 1960s and is generally considered a bad thing. It generated what is called spaghetti code and programmers are advised to avoid using it. It was a much loathed method of causing problems and has been expunged from almost all programming languages due to endless mis-use and abuse.

Use if, as suggested earlier or call a function rather than jumping to it and then returning. Or a switch / case set. Or anything else you can think of.

drjohn 56 Posting Pro in Training

re Friend_ID, Reg_ID, Reg_ID_2 as fields

Friend_ID is not needed, the joint key of Reg_ID, Reg_ID_2 would be unique, AND you'd have to declare it unique if you did it your way, otherwise someone could be listed two or three times as friend of the same person. But using the joint primary key immediately gets round this problem.

Many people have a bad habit of automatically adding a field called ID when there is a perfect natural key available. Then they have more work to do to avoid problems such as the one I mentioned. And they also often need extra joins to get at the data they need.

wes_solar commented: thanks for the reminder about using natural keys when available. +0
drjohn 56 Posting Pro in Training

check you have a doctype and are not forcing IE into quirks mode.
Check what is actually being presented by the web site via View source. if that's different to what your original template had, not sure what to suggest.