Jump to content

Dan_Mason

Members
  • Posts

    37
  • Joined

  • Last visited

    Never

Everything posted by Dan_Mason

  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
×
×
  • 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.