Jump to content

Daz84

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Daz84's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. jobs.date definately is a date field. But even if it wasn't surely I would still be able to order it properly? The report is ordered by jobs.date in descending order, if it was not a date field it would not manage that properly. All I want to do is reverse the order exactly
  2. Daz84

    New to PHP

    Welcome You will find this a valuable resource http://www.w3schools.com/PHP/
  3. Ah I see. In that case yes this seems like a perfectly good system. Just so long as your techs don't get lazy and stop putting in details
  4. Ah I see what you are doing now. It makes sense once you explain it What kind of data is stored in the repair field?
  5. Daz84

    help!

    Visit this page to learn about displaying the output of a table http://www.w3schools.com/PHP/php_mysql_select.asp Basing your code on what you learn on that page, you will need to nest a loop inside a loop. The outer loop will find exclusive continents and the inner loop will display all the countries for that continent. Normally I would suggest creating a lookup table for the outer loop which would reduce the amount of coding required significantly but in this specific case you know the number of continents is not going to change so you could simply hard code it using a loop or even a function which could be called for each continent. If you choose to do that it would probably look something like this function listCountries($strContinent) { echo $strContinent . "-<br />"; $result = mysql_query("SELECT country_name FROM countrys WHERE continent = " . $strContinent); while($row = mysql_fetch_array($result)) { echo $row['country_name']; echo "<br />"; } echo "<p />"; } ListCountries("Europe"); ListCountries("Asia"); Although I'd like it to be known a far neater solution would be to have a second table with a list of continents which would be looked up in a loop and the ListCountries function called for each one instead of simply writing out the function call however many times. I have also included your spelling error in the sql query to prevent the need for you to change the name of your table. I notice it says "countrys" instead of "countries" Hope this post has been of some help to you, don't hesitate to ask if you need any further help Daz
  6. I would create a second table to store the release dates Columns would be Autonumber, ID, version, date So your tables might look something like this SELECT * FROM data; +---+-----------+------+ |ID | name | tree | +---+-----------+------+ | 1 | MYSQL | CS | | 2 | PHP | 5.3 | | 3 | PHP | 5.2 | | 4 | ASP | | +---+-----------+------+ SELECT * FROM versions; +----------+----+---------+----------+ |autonumber| ID | Version | Date | +----------+----+---------+----------+ | 1 | 1 | 1 | | | 2 | 1 | 1.1 | | | 3 | 1 | 1.2 | | | 4 | 1 | 1.3 | | | 5 | 2 | 5.3.1 | | | 6 | 2 | 5.3.2 | | | 7 | 3 | 5.2.1 | | | 8 | 3 | 5.2.2 | | | 9 | 4 | | | +----------+----+---------+----------+ Then simply relate the ID fields of the two tables, this would allow for infinate new versions to be introduced and recorded without any messy parsing being required, as per your 'old_versions' field. Hope this helps, If I can be of any more assistance please ask Daz
  7. Everyone makes syntax errors, nothing to worry about! As long as it is solved that is the main thing! I was going to suggest looking at the conditions of the statement though. If you already have a record stored where raitem.id = {$raitem['id']} and it has a date assigned to it already then the statement will not return any records and nothing will be updated. Maybe this is suitable to your application but it just feels a little 'unsafe' Daz
  8. Look very carefully at the syntax, you have an extra '=' in two of your statements. You have it right in the email line but not in the name or company. HTH Daz
  9. Sorry if this is the wrong forum, it is relating to SQL in the context of an access database, there didn't seem to be a relevant forum for access specifically. My issue is this, I have the following query which runs exactly as expected when I run it by itself SELECT jobs.reference, workshops.name AS workshops_name, jobs.receiptno, jobs.name AS jobs_name, jobs.estimate, workshops.phone, workshops.address, jobs.item, jobs.date FROM workshops INNER JOIN jobs ON workshops.name=jobs.workshop WHERE (((workshops.name)=Forms!CreateReport!Workshop) And ((jobs.date)>=Forms!CreateReport!DateGoFrom And (jobs.date)<=Forms!CreateReport!DateGoTo)) ORDER BY jobs.date; However when I use this query as the control source for a report the output of the report is always ordered by DESC. I have tried explicitly declaring ORDER BY jobs.date ASC but it seems to have no effect As you will see from the WHERE clause I am using a control form called 'CreateReport' to handle the inputs but running the query directly and simply typing the inputs in has yeilded exactly the same output in all of my tests so it is not the form that is the issue. Also since the query seems to run fine when I run it independantly I suspect it is not an issue with the SQL either but in the actual report, so I am stuck. The report should not be choosing how to order it's input Is anyone able to clarify exactly what is going on and how I can rectify the issue? If you need any more information please ask and I shall supply. Thanks Daz
  10. Hi, You will have guessed from my username I am Daz! I'm 26 years old and have a 2 year old boy who is the best thing in the whole world (of course!) Been dabbling with all sorts of coding online php/asp as well as the likes of mySQL and so on for years but always as just a bit of a hobby whenever I am not washing my car (I'm borderline OCD with keeping the car clean haha). However have just got a job which will involve a lot of SQL so figured it would be a good time to join this forum. I'm sure I will have plenty to ask but hopefully I can also offer advice to others and we can all get along nicely Peace out Daz
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.