drjohn 56 Posting Pro in Training

PS I can't be bothered counting through the closing brackets to place echo $count at exactly the right place, so it might be later in your code. Try moving it down one closing bracket at a time yourself if it doesn't appear or appears several times.

drjohn 56 Posting Pro in Training
        if($result->num_rows > 0) {
            $count++;

that says whatever the number of rows, $count now equals one, unless there are no rows, in which case $count is still zero. Then you are doing this.

            $num_length = strlen((int)$count);
            while($row = $result->fetch_assoc()){
                $seen = $row["seen"];
                if($seen == '0'){
                    echo $num_length;
                }

so now $num-length has a value of one (the number of characters in $count, which always has a value of 1 in this loop or zero if there are no rows and the loop is not executed), nothing to do with the number of times $seen is >0
And then you just keep echoing that value of $num-length, which is always one, because it is never incremented inside your loop! And neither is $count incremented.
You are NOT counting anything at all to do with $seen !

Drop the first appearance of $count++, and all your bits about $num-length, then use something like this

             while($row = $result->fetch_assoc()){
                $seen = $row["seen"];
                if($seen == '0'){
                    $count++
                }
                echo $count;

So here you are echoing the count of the number of times $seen is zero, after you have worked through the list of results. You were originally echoing a value every time you had $seen >0, instead of counting them all and echoing the answer.

drjohn 56 Posting Pro in Training

Quick solution.

<div class="footerBox">Your text link code here</div>

Style the div to

.footerBox{float:left; width:200px;)

Make ten such divs, one with each text link in it, .
You might need to adjust padding or make them a little bit narrower.
But it will work. Just play with the numbers to get what you want.
You might need to add an extra class to just the first such box to stop it catching on the content above it

.clearfix{clear:both}

So the first div would become

<div class="footerBox clearfix">your first link text here</div>

While the other nine would be as in the first example. This would give you two lines of five divs, each with one link in it.

Try putting your styles in an external stylesheet, it makes life easier and gives a more consistent appeareance.

Also, the links in the footer / siteInfo div all look like this ./about.php
The leading ./ is not necessary. You use that to move up a folder when you use sub-folders to keep related content together. And it should be ../filename anyway if it was in a higher folder.

NEVER use :nbsp; to pad out things to get a particular layout, it will never work okay in other browsers (other browsers being not the one you are using, which ever one you start with)
This is NOT an IE or Edge problem it is simply not the way to work, ever. It's …

drjohn 56 Posting Pro in Training

An id is meant to be a unique identifier. You can't have two unique identifiers on the same span, or same anything.
You can use multiple classes however - .user, .Maxi, .John, etc. But you don't give any styles for your Maxi, John, Henry etc styles. So without them, there will be no visible change.

It's just possible that the browser is trying to apply the styles for the last id you use, and in each case there are no styles for that id.

drjohn 56 Posting Pro in Training

There is no need to have the span in the li. It serves no purpose. The style for the link in the li will do whatever you need.

You also don't need your menusub and sub-menu styles either. You can apply styles via the combinations of ul li a and ul li ul li a. It's a mistake to add extra classes when the combination of ul, li and a can b identified uniquely by giving the ul a class or id . No need to give the ul one class, the li another and the a another class too.

drjohn 56 Posting Pro in Training

ALSO
You say you have one table called invoices and one called products, joined via the common product_id.

Which suggests one invoice will be for one product, and every product ordered, even if they are ordered at the same time, will have a separate invoice. That's not how things work in real life.

When I order several times, they are all listed in the one invoice, each on a separate line, which lists product name and number bought, sometimes item unit cost, as well as total cost. Think about that and consider changing your database design. Cos it's wrong, based on what you say.

I don't do people's homework for them, but I am willing to help when they try to do it and need pointing in the correct direction. (This is a standard homework problem from your brief description, we've all done this one at some point in time ;-) )

drjohn 56 Posting Pro in Training

Line 5 of your code is a join, using the "where x=y" syntax.
The syntax used doesn't matter, it's a join.

But you then exclusivley use the info from a single table!

Why don't you show us this invoice table and product table as well, and then write out what you actually want to display.

ALSO why on earth have you got two tables, school and school_info ??? There is no reason to split the data like that, all the data in school_info is functionally dependant on the school_id, the primary key of the school table, unless a school has more than one address, or more than one badge. There should only be one table, school , with all the fields of the two tables in it.

Follow standard normalisation rules or your entity relationship diagram. There is an entity called school with a set of attributes which there is no need to split in two and create a second entity, school_info - you might as well stick person-in-charge in school_info and badge_name in school, it would make no difference. And no sense either.

Your database design is flawed, and will force you to do unnecessary joins like this, complicating the code and thus making errors more likely.

drjohn 56 Posting Pro in Training

How can we work out the problem without being able to see the web page???

drjohn 56 Posting Pro in Training

The human brain.

Seriously, there is no "best software". Everyone will simply recommend the software that they use. So here goes.

I use NotePad++, which is used by many, many professionals.

I tried Blue Griffon recently and thought it was good.
I tried Brackets, and thought it was good, but I did something wrong when I installed it and haven't had a chance to re-install and then read how it is supposed to be used.

It's much easier to list really bad software:
Serif Web
Frontpage
ANY software that says "no need to learn programming just drag and drop".
ANY software that is a word processor or desktop publisher with a Save As html feature.

Some people will tell you that dreamweaver is brilliant, others will tell you that it produces really bad code, but the bad code is produced by people who use dreamweaver but don't know anything about web design or code, so use it very, very wrongly.

You can use any program the wrong way and produce code.

No software can make up for a lack of knowledge and a lack of skill and imagination.

Hence, the human brain it the best tool to use.

HarBeK commented: Agree 100% +0
drjohn 56 Posting Pro in Training

Content - why else would I visit a web site?

drjohn 56 Posting Pro in Training

Nested tables for layout??!!
It's not 1996 any longer - the world has moved on.

Wrap each table of data in a div and give it a width that matches the table's width.

Style each table to float:left.

You might need to add a clear:both to the next item below the tables.

drjohn 56 Posting Pro in Training

Is the parent file also called something.php or is it something.htm ? Needs to be the former, not the latter.

drjohn 56 Posting Pro in Training

ah, you beat me to it...

drjohn 56 Posting Pro in Training

Your first step, outside the loop, should be to print the the first two numbers that you are seeding the array with
echo $prev[0];
echo $prev[1];
then continue up to your target value in the loop.
but loop like htis
for ($i = 2; $i < $nr; $i++)
or you will go two steps past the limit the users asked for.
Simples.

drjohn 56 Posting Pro in Training

try experimenting with easing on hovering, google it.

drjohn 56 Posting Pro in Training

I know you want fluid shadows, PIE.HTC does that !

I simply mentioned a few other things it can also do, if you write the css3 code. I always make the pie.htc line the last one in a css declaration, and it enables older IEs to display css3 effects as intended.

Have a look here to see it giving very fluid shadows
http://lxavionics.co.uk/portables.htm
notice that the boxes with shadows are all different sizes. No images were harmed in making them.

drjohn 56 Posting Pro in Training

Use the standard css3 method to get your box shadow.
Then visit this site http://css3pie.com/
And use their behavior: url(PIE.htc);

No need for images at all.
The PIE file also lets you add other css3 effects for older versions of IE.
Like text-shadow and broder-radius I do hope you are not wasting your time using images for rounded corners...

drjohn 56 Posting Pro in Training

If it is a site you own, you should have the development oroginal copy on your pc.
If it is a site you are taking over to edit, use ftp to download the entire site.

If it is a site you wish to examine that belongs to someone else, HTTrack is your best bet, but if it does belong to someone else, why do you want a local copy?

drjohn 56 Posting Pro in Training

Google search pagination in php
There are plenty of standard ways to do this, using mysql queries and manipulating the limit option to pull sets of images at a time from the database.

drjohn 56 Posting Pro in Training

I just created your table on my local server, moved the } in the while loop to AFTER the last ECHO, so I could see the row you used and a new row I inserted without entering a created_date. I got exactly the expected result - two sets of data, your original single row data set and my new row with the correct created timestamp.

My local server version: 5.0.24a-community-nt - older than yours and it worked.

I'm afraid this simply makes it even stranger, as your table definition worked, your insert worked, my manual insert via phpMyAdmin worked, and your php code worked!!!

I can't see in a single row table the position of that closing } of the while making a difference, but at least try moving it to the correct place and see what happens - otherwise you will always only see the last row found's data.

drjohn 56 Posting Pro in Training

You don't use myphpadmin (I think you actually mean phpmyadmin), you write a line of php and tell it to display the number it reads from the database in the format you want. The number will be stored in the database in the database's format, and that has nothing to do with the display format, that's the phph script's job.

drjohn 56 Posting Pro in Training

To take data entered on a web page and put it in a database, you use a form and give the form and action - tell it to run a script when the submit button is clicked.

The script then takes the data, connects to the database and runs an sql query which inserts the data into a table in the database, and into the appropriate fields in that table.

You currently don't have a form, a submit button, an action or a script for us to look at..

The form should probably be in your iframe, with a textarea input field, named and ided, and the script uses that to know what data it has to handle.

drjohn 56 Posting Pro in Training

Give the sub menu a high z-index - the Professional Education bit is sitting over the flyout menu.

I set for cat ul z-index:50 and it worked, you probably don't need as high a value as that, but I didn't bother looking for a smaller answer.

drjohn 56 Posting Pro in Training

That's normal with floats.

When you have a set of floats that have to line up, you discover that the next line hits the bottom of the tallest item in the previous line and stops there.

The solution is simple - set a min-height based on the tallest item expected in those divs.

drjohn 56 Posting Pro in Training

We need a bit more info as to the actual fields in each table before we can help.

Also there is no need to prefix every table name with tbl ! Among other things it gets in the way of reading the actual name.
winners, user, completerewards, rewards - so much more readable and less likely to contain a typo.

drjohn 56 Posting Pro in Training

I'd change line 123...

Post the url where we can all see it!

drjohn 56 Posting Pro in Training

If the only people who will see the results from the database are your dad and partner, then putting it on line presents an unnecessary risk of exposing customer details. If yo uhave to ask, you probably don't have enough experience yet to make it secure.

If it is just a database for them to track their business, put it on a computer at their place of business. If you wish to practice building a web database system, then get usbwebserver, which is a zero configuration server set-up so developers can build and test their dataabse before putting it on line. Then you can build them a system that the rest of the world can't see or hack into. It's how I build and test online databases before putting them on line.

drjohn 56 Posting Pro in Training

run it through http://validator.w3.org/

trace the errors it mentions about div tags not being closed. (using an editor like notepad++ will show you when divs etc are not closed by color-coding things the wrong way)

Oh, and it's broken at all viewport sizes I played with.

drjohn 56 Posting Pro in Training

with eleven style sheets, where do we start???

drjohn 56 Posting Pro in Training

Semantics.
Using <ol> implies that the order in which the items appear is important, using <ul> says the order doesn't matter.
You'd use an <ol> for something like the installation instructions for a bit of software (the order the steps are done in matters), while a <ul> suits a shopping list.

As everyone else uses <ul>, correctly, for a menu, why do something that clearly is not being used correctly?
Do you use a large font, bold and <p> for your headers, or do you use <h1> , <h2>, etc??? It's the same idea of using tags correctly..

drjohn 56 Posting Pro in Training

that's not an ordered list! use <ul> instead.

drjohn 56 Posting Pro in Training

IE6 is used by 1% of users world wide - so you can ignore any problems there unless your site is getting many thousands of uniques per day.

i have no idea why your javascript is not working in Firefox.

drjohn 56 Posting Pro in Training

There's no sign of a doctype in your html, and a lack of a doctype always triggers quirks mode, which is a different model in different browsers.
http://www.alistapart.com/articles/doctype/
and choose the HTML 4.01 Strict (or Transitional). Ignore the XHTML, as many browsers convert it back to html, so you gain nothing from using it - it's an evolutionary dead-end in web design.

drjohn 56 Posting Pro in Training

margin:0; might help.

as would using <ul> and <li> and <div> and not tables for layout.

drjohn 56 Posting Pro in Training

try adding overflow:auto to the outer div

drjohn 56 Posting Pro in Training

And how can we help you???
With no sample page to examine what can we suggest?

Upload your page somewhere that we can examine it.
But just to get things rolling - have you bothered to declare a doctype?

drjohn 56 Posting Pro in Training

Then you don't have the correct set of relationships! You can't have the correct foreign keys between the players, club and nations. Because I made sure that the test data set I used DID have each club linked to a nation and each player linked to a club, and I got back exactly the correct rows that I expected.

So, write down a set of club and nation data and match the foreign keys so that a link is correctly established. Then add a couple of players with foreign keys that link them to an existing club and nation.
OR
You could print out each table's contents and scrutinise then to make sure there is any data to be returned. Change a few bits to match existing clubs and nations in your player team.

Although eventually you are going to have to fix the wrongly normalised tables (and then your queries) as at present you can only have one club per nation, as I said earlier. Working with badly designed tables just doesn't help.

naeemnur commented: Sir, you are my hero! +1
drjohn 56 Posting Pro in Training

This query works.

SELECT a.id as club_id,
a.fr_name as club_name,
b.id as nation_id,
b.fr_name as nation_name,
c.id as player_id,
c.fr_fname as player_name
FROM fr_clubs as a
INNER JOIN fr_nations as b ON a.id = b.club_id
INNER JOIN fr_players as c ON b.id = c.nation_id;

I made your database, entered some date, ran the query ON THE DATABASE, not using the php in any way at all. I entered via phpmyadmin, on my test server, and got back the correct number of rows with the correct data in place.

As I said...Always check your queries directly on the database without using your application, web site, php or anything else that stands between the query going in and the data coming out.

So now you know that somewhere in your php you have an error in creating your output.

Try echoing the number of rows returned by your query at the top of your page - you have already got that as a variable, $numrows.
Are there more rows in the dataset returned than are displayed? You should get one row per player in your players table.

What do you get if you dump this line in your code ." LIMIT $paginate->start, $paginate->limit ???

drjohn 56 Posting Pro in Training

the Web Developer Toolbar that was mentioned has a Chrome version.

I use it all the time, especially the edit css tool which is how to do a trial edit and see the result, without touching your real css file.

Posting the jquery library is not going to help with a css color change.

drjohn 56 Posting Pro in Training

What do you get if you run the query directly on your tables of data?

You are obviously using php, so to eliminate the possibility of errors in the php, start your testing at the database level, using just the sql.
If it doesn't work there, it will never work in your program / web page, will it?
If it does work there, the error is in your PHP

drjohn 56 Posting Pro in Training

You have the field `club_id` int(11) NOT NULL COMMENT 'Foreign Key', in the nation table
This doesn't make sense.
It implies that each nation only has a single club in it.
It would make more sense to me if the club table had it's nation id in there as a foreign key - which then suggests that a nation has many clubs in it.

So check your normalisation again.

Why have you got all those fr_ in front of almost every field? They serve no purpose other than to give you more typing to do and increase the risk of making a typo.

Also I'm willing to bet that no two nations have the same name - there is only one Scotland, one Germany, one Denmark. So you don't need a numerical id for the nations table acting as the primary key, the name of the nation itself is the correct, natural primary key. Using the name as the primary key will reduce the number of joins you will regularly require, as the numerical id always forces a join to find the nation's name. But using the name as the PK means you already have that info in the player table.

It's a common beginners mistake to assume that a numerical id field is always required, when there is already a unique natural primary key present which will simplify things.

Example

color table
1, red
2, green
3, …

drjohn 56 Posting Pro in Training

Or just add overflow:auto to the wrapper's css. That usually makes it expand properly. Sometimes overflow:visible works too.

drjohn 56 Posting Pro in Training

And don't use tables for layout - as a technique, that is soooo last century

drjohn 56 Posting Pro in Training

I just googled your page, and this is what the google cached copy shows, so whatever it was happened very recently as you can see from the date.
http://webcache.googleusercontent.com/search?q=cache:PxX_vDgV3lkJ:www.directsellinglive.com/+www.directSellingLive.com&cd=1&hl=en&ct=clnk&gl=uk&client=firefox-a

drjohn 56 Posting Pro in Training

drjohn,

This site has been online for 5 years so I am at a totally loss as to what has happened. You mentioned the file "write" may have failed.
Is there a way for me to check if this has happen?
Have you heard of this happening before?
Where would I find the file "write"?

I've got someone looking into the issue but they don't have an idea what happened.

I mean when the file was saved to disk, it is a file write action. If that goes wrong, you have saved a blank file. Files failing to write happens occasionally.

Otherwise, the server has some problem and it has got corrupted. This is more likely, if the site has been there for a while.

Either way, try uploading the page again.

drjohn 56 Posting Pro in Training

You need to scrap your entire code and start again.

Your current code on http://www.masterlink.co.id/cgoods/index.php reads like this

doc type
<hmtl>
<head>
div (no body)
another <head>
div inside the above head
<body>
another <body>
another doctype
another <html>
yet another <head>
another <body>
then you close a div, which suggests that the extra heads and bodies and doctype are inside a div.
then a css file link that is not in a head
then another css file link
and yet another one!

And you wonder why it doesn't display properly!

It's a testimony to the wonders of modern browsers that it displays at all!
Your browser should fall over dead with all that confusing code, but somehow it manages not to crash and burn!

Copying and pasting is not coding. The errors are so obvious, starting again from an empty clean file is the only way to correct this mess of jumbled code.

drjohn 56 Posting Pro in Training

If you have spoken to the webmaster, why not try something as simple as this:

upload the file again.

It's possible the file has got corrupted and thus is empty. There is no code when I view source, which suggests the file write failed and left an empty file in place.

The bit about firebug showing a css file - I think that's firebug detecting itself or more likely the browser skin, as the source code is devoid of anything.

drjohn 56 Posting Pro in Training

You are using position:absolute. This almost always causes big problems. In your the first div I saw in the source code is referenced from the left and the top.
The next two divs are referenced from the top and right. So obviously as the viewport is made wider or narrower, their position within the view port change, as the left and right reference points are moved.

Solution.

1 Put a wrapper div around the entire content, with a suitable width, say 500px in your case, and set margin:auto. That will centre it on the screen.

2 Next make two divs, one called #lefty and the other #righty. Give them a suitable width, in your case 215 - 220px. Float lefty left, and float righy right.

3 Repeat 5,000,000 times "Never use postion:absolute except in very VERY exceptional cases."

4 Whenever building a web page, resize the browser at regular intervals, and check the layout works in several different browsers too.

Problem totally solved.

It helps to learn css when building a web site.

drjohn 56 Posting Pro in Training

This simple tutorial might help you.

http://divitodesign.com/css/how-to-dropdown-css-menu/

or this one

http://csswizardry.com/2011/02/creating-a-pure-css-dropdown-menu/


google will give you millions of examples to study and work from

You don't need to add a class to the sub-ul.

At its simplest, you can just copy the entire code from either tutorial, then re-style to suit your site. THEN try to understand the code.

drjohn 56 Posting Pro in Training

and set a width on that div too.