Jump to content

necken18

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

necken18's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello. I've got two tables one that contains general information and one that contains links. example: Table: general id, name, date Table: links id, objekt_id, link, title i wan't to loop out these tables together and put all links with the same objekt_id in one field-array. (links.objekt_id matches general.id). SELECT g.name, g.date, link.link FROM general g INNER JOIN link links ON link.objekt_id = g.id WHERE g.id = 10 There is multiplie links on every objekt_id. How can i put all of them in one field?
  2. Hello. I want to extract year and month from a datetime column in the database. And i want to display the results like this: 2008 Jan May 2010 Oct 2011 Dec But my code gets this result 2008 Jan May 2010 Oct 2011 Dec Here's my code. $get = $db->query(" SELECT EXTRACT(YEAR FROM date) year, EXTRACT(MONTH FROM date) month FROM test GROUP BY year "); foreach ($get as $row) { echo $row['year']."<br/>"; echo $row['month']."<br/>"; } } catch(PDOException $e) { echo $e->getMessage(); }
  3. $query = mysql_query('SELECT * FROM user ORDER BY user ASC');
  4. Don't mix the var and the public keyword. they have the same functionality.
×
×
  • 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.