Jump to content

blunder

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Everything posted by blunder

  1. Its not from the current date, but from the date collected in $datefromdb.
  2. So now I have $datefromdb is 2007-07-21 02:21:07. time() is 2007-07-20 03:43:07. $timeleft = date("h:s:m",strtotime($datefromdb)-time()); I cant get it to work, what am I doing wrong?
  3. So what if I have a specific date coming from a SQL Db, how do I turn it into a timestamp that I can play around with? Lets say I have a value coming from the db called $datefromdb, how do I compare the date with current datetime and say how many hours/etc still to go before I reach that specific date?
  4. Can I somehow make $expiredate = date('Y-m-d h:s:m') + 24 hours? In my case the date will always be based on the current timestamp, but for future reference I would like to know if you can do it for other dates?
  5. Well, the problem is that I am trying to join two tables. Table series looks like this: Serie 1Serie DescriptionDate updatedetc, etc Serie 2Serie DescriptionDate updatedetc, etc Serie 3Serie DescriptionDate updatedetc, etc Serie 4Serie DescriptionDate updatedetc, etc Table articles looks like this: Article idSerie 1Article descetc, etc Article idSerie 1Article descetc, etc Article idSerie 2Article descetc, etc Article idSerie 2Article descetc, etc Article idSerie 2Article descetc, etc Article idSerie 2Article descetc, etc Article idSerie 2Article descetc, etc Article idSerie 3Article descetc, etc Article idSerie 3Article descetc, etc Article idSerie 3Article descetc, etc Article idSerie 4Article descetc, etc I thought LEFT JOIN was the best way to combine the two...
  6. Hmm... so maybe I should instead first do a query selecting all the serie ids and then for each serie do a query? That could however mean that I do 20 queries on one page. Although they are processing the same data, does it not make the page load slower?
  7. I am already doing this and it is not hiting the mark. Let me illustrate, lets say this is the data in the two tables. Two first come from series table and the "article title" and "article desc" from articles. SERIE NAME 1 │ Serie Variable │ Article Title │ Artitle Desc SERIE NAME 1 │ Serie Variable │ Article Title │ Artitle Desc SERIE NAME 1 │ Serie Variable │ Article Title │ Artitle Desc SERIE NAME 2 │ Serie Variable │ Article Title │ Artitle Desc SERIE NAME 2 │ Serie Variable │ Article Title │ Artitle Desc SERIE NAME 2 │ Serie Variable │ Article Title │ Artitle Desc SERIE NAME 2 │ Serie Variable │ Article Title │ Artitle Desc With a LIMIT 0,2 SERIE NAME 1 │ Serie Variable │ Article Title │ Artitle Desc SERIE NAME 1 │ Serie Variable │ Article Title │ Artitle Desc but I want LIMIT 0,2 to show all the data. See my problem?
  8. I am trying to split the mysql results on multiple pages, but the problem is that I want the limit to focus on the first table called. I have a LEFT JOIN in the SQL text, which ends up addding more rows, but I want the LIMIT to focus on the initial table (series) This is an illustration of the sql text (not complete, just an illustration): SELECT * FROM series LEFT JOIN articles Anyone have any ideas?
×
×
  • 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.