Jump to content

Dan_Mason

Members
  • Posts

    37
  • Joined

  • Last visited

    Never

About Dan_Mason

  • Birthday 04/22/1989

Contact Methods

  • MSN
    dan_r_mason@hotmail.com
  • Website URL
    http://www.myspace.com/dan_core

Profile Information

  • Gender
    Male
  • Location
    Bournemouth, UK

Dan_Mason's Achievements

Member

Member (2/5)

0

Reputation

  1. Hello there! I have written this MySQL function: DROP FUNCTION IF EXISTS optimaldb.TBC; CREATE FUNCTION optimaldb.`TBC`(SectionID int(10), StartTime datetime) RETURNS datetime BEGIN DECLARE PrevTime datetime; SELECT EndTime FROM PassSection WHERE EndTime < StartTime ORDER BY SectionID LIMIT 1 INTO PrevTime; RETURN StartTime - PrevTime; END; Into which I pass 2 variables i.e: SELECT TBC(3451,'2010-04-01 06:03:12') This is the error that keeps getting thrown up: MySQL Database Error: Incorrect datetime value: '9188914574.000000' for column 'TBC' at row 1 I'm not entirely sure what I have done wrong as I have looked up this: http://dev.mysql.com/doc/refman/4.1/en/datetime.html and as far as I can see I am structuring the datetime correctly! Any help would be really handy! Thanks, Dan
  2. Hello! I am having an issue creating a view. To cut it short, I need to create a view from multiple tables in the same database. Some of these tables are formatted as dynamic tables i.e: Item_Name Item_Value Test1 1 Test2 2 Test3 3 And some are formatted as fixed tables i.e: Test1 Test2 Test3 1 2 3 Unfortunately I am not in control of how the database has been built and cannot (For the foreseeable future) change the construction of it. But in the mean time I am looking for a work around, that will allow me to create a fixed format view, that contains information from both types of table using multiple SELECT statements. I have read the documentation on the creation of a view and cannot seem to find any information specific to this topic! Any help on this would be greatly appreciated as I am currently stuck on this part of my project! Thanks very much for your time, Dan
  3. I am having trouble searching for an item in a multi-dimensional array. Is there a way to search only one column in a multi-dimensional array? i.e: MULTI-DIMENSIONAL ARRAY ID Name DataTable 0 John Employee 1 Dan Employee 2 Matt Boss 3 Becky Supervisor Is there a way to only search the column "Name"(Column 2) using array_search() or similar? (i.e array_search("John",$ARRAY[Column2]) The help would be very much appreciated! Cheers, Dan
  4. Hello I am having trouble retrieving an array in the format I need from a mysql database. It is a Matrix/Multidimensional Array, and should look like this: Array( Array(Date => 22/04/1989, Time =>02:00) Array(Date => 23/04/19...... etc For some reason it is coming back like this: Array( Array( Array(22/04/1989), Array(02:00) ) Array( Array(23/04/19...... etc This is the code that puts the mysql result in the array: <?php while ($aTemp[] = mysql_fetch_array($result, MYSQL_NUM)); ?> Any suggestions would be very useful! Thanks! Dan
  5. Okay, Let me re-phrase the question. Can you use an LEFT JOIN to retrieve a constant data set (As I've shown pretty clearly above) from a Dynamic Table in a MySQL Database? Thats pretty much all I want to know. Sorry for the inconvenience.
  6. Hello All! I am having trouble working this one out. I am retrieving a data set from a Database which I want to look like this: Column 1 Column 2 1 NULL 2 4 3 NULL 4 5 Instead it is being returned like this: Column 1 Column 2 1 4 2 5 3 [/td] 4 [td] As you can see, this would not be a constant data set, so when being put in an matrix, wrong data is matched. Bearing in mind I am also using Dynamic Tables (Item Name, Item Value) which are constantly being updated. I have tried using a LEFT JOIN Statement, but it does not work, I am still getting incorrectly matched data back from the query. Here is the query: $result = mysql_query=( "SELECT $TableName.SectionIdent, ItemValue * 3.2808 FROM $TableName INNER JOIN $TableName2 ON $TableName.SectionIdent=$TableName2.SectionIdent WHERE $TableName.SectionIdent IN( $strNumbers ) AND ItemName = $ItemName ORDER BY StartTime" ); Any Suggestions as to a certain JOIN Type that could be used? Cheers! Dan
  7. Hello I have used some Javascript to be able to switch between 3 generated graphs on a page. I wanted to do this so that the page didnt have to be refreshed every time a new graph was selected. All it is basically doing is switching between pictures, Here is a screenshot: All I really want to do is leave the last Hyperlink clicked highlighted, so that it is really obvious to the user which graph they are viewing! Any help would be much appreciated!
  8. Ah! You were right! I checked over the CSS File used, and The Div ID was the same as another! Cheers! Ill make sure i watch out for that in future!
  9. No not there, Obviously the onClick is Javascript but I didnt think that could affect positioning! Not sure whats going on....
  10. Hello! I am having a few problems with positioning in HTML, Not sure why this is happening, But 1 link is overlapping another link... Here is the code for the 2 links that are supposed to look like this: Absolute | Percentage. (Seperated with a |) <html> <div id="image1" style="display:none"> <img src="GaugeSummaryAbsoluteGraph.php" border="0" alt="one" /> </div> <div id="image2"> <img src="GaugeSummaryGraph.php" border="0" alt="two" /> </div> <a id="one" href="#" onclick="changeIt('image1');">Absolute</a> <a id="two" href="#" onclick="changeIt('image2');">Percentage</a> </html> The 2 Hyperlinks on the page look like this: Anyone any ideas? Cheers, Dan
  11. Okay, so this is the code i have so far (as an example): <script language="javascript" type="text/javascript"> function removeSpaces(string) { return string.split(' ').join(''); } </script> <form> <input type="text" onblur="this.value=removeSpaces(this.value);"> <input type="button" value="Click"> </form> As you can see, I am automatically removing spaces in the field. Now I know it would be obvious to most people but the majority of people using the login system I am designing are going to be pretty computer illiterate, So i need it to be obvious. I want to also have a warning pop-up box If spaces are found and removed saying "Spaces cannot be used in Usernames, spaces have been removed." Can anyone help? Thanks in advance
  12. DELETE Record problem Here is the Query: DELETE FROM login WHERE 'Email' = "Hello@Example.com" It is not throwing up any errors, as all the information in the database matches the query but when I run it in the SQL Editor, it says "Query OK, 0 rows affected (0.00 sec)". This also happens when I run the query in my PHP Code. (It definately is not removing the record from the database) Any Ideas what I could do? Any help would be very appreciated
  13. Hello Having trouble here, Is there a function available to check the PC's locale? returning something like U.K or U.S or Europe, etc. Thanks In Advance
  14. Hello again I need to direct a page somewhere else depending on the last page the client was on, Is there any function that can do this? This is the general idea of what i want: <?php if (PreviousPage = 'http://something'): header(Location:'http://somewhere') else (PreviousPage = 'http://something_else'): header(Location:'http://somewhere_else') endif; ?> Cheers for any help
  15. I know everyone hates frames, and they are annoying and crap etcetc, but i started using them for the first release of a site, so im going to continue using them for the time being. Anyway, i am having trouble arranging the page like this: Can anyone help? Thanks
×
×
  • 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.