simplypixie 123 Posting Pro in Training

As far as I am aware you can't use FROM in your UPDATE statement, you need to put it in a sub-query. For example:

UPDATE company_alert
SET company_alert=
(SELECT company_financial.receivable FROM company_financial INNER JOIN company_alert
ON company_alert.stock_code=company_financial.stock_code
WHERE company_financial.year_id=company_alert.year_id)

This may not work, but it should give you the idea.

simplypixie 123 Posting Pro in Training

SOrry but I think you need to learn some more on HTML before you do anything else and then CSS.

Firstly, the <head> tag in HTML is for head information like the title of your page, meta tags and links to external style sheets, not somewhere to put a <H1> heading - that goes in the body of your HTML.

Secondly, if you are using CSS to style your page (as you should) then there is no need whatsoever to use tables for layout and mixing the two makes even less sense, plus don't set inline stlyes as you have done for the td bgcolor=pink.

Move your CSS to an external stylesheet and then apply your background image to the body tag or a div that is set for the main container of your content (if the background image changes on different pages for example).

Then use your divs/classes to set the layout and content (based on your code, set the background image in the #container div in your CSS and use to classes to format your words in your h3 heading):

<body>
  <h1>Image and data in table column</h1>
  <div id="container">
    <h3><span class="a1">Hello</span>
    <span class="world">World</span>
    </h3>
  </div>
</body>

Much neater and semantic.
migcosta commented: inappropriate comment that don't help in any way to resolve the problem -1
pritaeas commented: The problem here is bad coding, I fully agree. +14
simplypixie 123 Posting Pro in Training

Have you tried changing to 0775 as 0777 is very risky and normally not essential and it may be that C-Panel doesn't allow changes to 077 due to the security risk

simplypixie 123 Posting Pro in Training

Use CSS NOT tables for your layout

simplypixie 123 Posting Pro in Training

Just set them in the css for your class inputbx

simplypixie 123 Posting Pro in Training

First of all I would tidy up your script so you can more easily read what you are doing, plus there appears to be an error in line 2:

if($rewrite) {
			    echo '<p><a href="/blog-'. $blog[0] .'-'.$clean_url.'">' .$blog[3].'</a><br>';
			} else {
		        echo '<p><a href="'. $blog_url .'?d='. $blog[0] .'">' .$blog[3].'</a><br>';
			}

If your $blog_url only holds blog_rec.php then change the 2nd echo to:

echo '<p><a href="http://www.mydomain.co.uk/'. $blog_url .'?d='. $blog[0] .'">' .$blog[3].'</a><br>';
simplypixie 123 Posting Pro in Training

My starting point many years ago (and the author and book are still well respected to this day) is Build Your Own Database Driven Website using PHP and MySQL by Kevin Yank - http://bit.ly/v1pkS0. The Sitepoint website is a great source of information as well.

simplypixie 123 Posting Pro in Training

DId you echo out the $doneurl as I suggested?

simplypixie 123 Posting Pro in Training

In this case then no, there is nothing wrong with using negative margins (I would use margins on the elements instead of padding in the header as I find it works better cross-browser and is easier to manipulate).

There are a few examples of how to do it on this website - http://bit.ly/uybHGA. Hope this helps

simplypixie 123 Posting Pro in Training

Can you provide an example of where you think you would need to use negative margins (so I can advise)?

simplypixie 123 Posting Pro in Training

I can recommend sitepoint.com as a great resource for design and development (have been using for about 8 years) plus they also release books an all sorts of aspects of the industry, including the book The Principles of Beautiful Web Design http://www.sitepoint.com/books/design2/ which I have owned in the past and can recommend.

simplypixie 123 Posting Pro in Training

You say it gets stuck after this line:

header("Location: $doneurl");

That would suggest to me that the location in your $doneurl variable is incorrect.

Have you tried echoing out the variable above the header redirect (comment out the redirect and exit whilst you do this testing) to ensure it is a valid url?

simplypixie 123 Posting Pro in Training

As per Alfa-Fostrot's reply, you firstly need to change Login.php in the redirect url to login.php.

simplypixie 123 Posting Pro in Training

I don't know about other employers, but I wouldn't look twice at a potential employee or contracter who used tables for the layout of a website instead of css in this day and age (obviously if the table had been used for what it was meant, to display data, then that wouldn't be a problem).

simplypixie 123 Posting Pro in Training

You can create an active class, it makes no difference if your list is held in an external file that you include into the main page.

simplypixie 123 Posting Pro in Training

Which header location redirect isn't working (you have a few), or is it all of them?

simplypixie 123 Posting Pro in Training

In PHP, to get the last 2 digits of the year code you would use substr as such:

$lasttwodigits=substr($batch, 2, 3)

This will give you the 8 and 3 out of 1983, then you just add on the trailing digits (not sure if you need help on that part)

simplypixie 123 Posting Pro in Training

Could someone actually answer how to do this ourselves as I also want to change my username?

simplypixie 123 Posting Pro in Training

You need to have text-align: center; in your body css

simplypixie 123 Posting Pro in Training

I understand now - I don't have an answer for you with regard to your format but why don't you use the mysql date formats available as they will then store all your date/time information correctly so you will be able to ORDER BY them and then just re-format your dates when you echo out the dates on the front end?

It makes no sense to me to store your dates and times in a custom format when you don't need to and subsequently cause problems in ordering as you are having.

simplypixie 123 Posting Pro in Training

To fetch any data in a specific order from a database table you just need to use the ORDER BY sytax. So in your example:

"SELECT * FROM tablename ORDER BY date ASC"

Replace tablename with the name of your table, date to the name of your date field and use ASC to retrieve in the order of oldest date first or DESC for most recent first.

You don't say what format you want the date to display in so I can't answer that for you specifically, however if you want something like day/month/year your PHP would be:

echo date('dd/mm/Y', $dateresult);

Replace $dateresult with your specific date result variable.

Hope this helps.

simplypixie 123 Posting Pro in Training

Have you tried running the select statement directly in your database to see if you get an error at database level (always my first point of testing)?

simplypixie 123 Posting Pro in Training

Well I have looked at the help and as I am not too good with JS I can't get my head around it, can anyone expand more on how I can get this to work?

simplypixie 123 Posting Pro in Training

I have js on a form page for users to be able to select all check boxes for classes to enter in a dogs show but I want to be able to offer the facility to select just classes on specific days as well and I don't know how to do it.

The form source code for each class to select looks like this:

<input type="hidden" name="day_id_normal[12]" value="5" />

							<input type="hidden" name="day_id[12]" value="5" />
							<input type="checkbox" name="class_number[]" id="gradeclass" value="12"  />

The link to select all:

<a href="#" onclick="SetAllCheckBoxes('add-classes', 'gradeclass', true);return false;">Select All</a>

The JS Script:

function SetAllCheckBoxes(FormName, FieldName, CheckValue)
{
	if(!document.forms[FormName])
		return;
	var objCheckBoxes = document.forms[FormName].elements[FieldName];
	if(!objCheckBoxes)
		return;
	var countCheckBoxes = objCheckBoxes.length;
	if(!countCheckBoxes)
		objCheckBoxes.checked = CheckValue;
	else
		// set the check value for all check boxes
		for(var i = 0; i < countCheckBoxes; i++)
			objCheckBoxes[i].checked = CheckValue;
}

Not sure if I have included everything required to give information for anyone to help (please let me know if not) but the classes are split out by day so I am hoping I can use the reference to the day_id but not sure (am not sure if what I want to do is possible either).

Can anyone help please?