Hello,
Is this code correct for rearranging the event according to date?
$data = mysql_query("SELECT * FROM contact_id by date_id DESC");
Rearranging the events
Moderator: General Moderators
Re: Rearranging the events
You're missing ORDER
Code: Select all
SELECT column1, column2 FROM tablename WHERE condition ORDER BY something DESC-
ryojinaiseki
- Forum Newbie
- Posts: 7
- Joined: Tue Feb 07, 2012 7:19 pm
Re: Rearranging the events
right after "date_id" ?
Re: Rearranging the events
Right before.
Also, you should avoid SELECT *
Code: Select all
SELECT * FROM contact_id ORDER BY date_id DESC-
ryojinaiseki
- Forum Newbie
- Posts: 7
- Joined: Tue Feb 07, 2012 7:19 pm
Re: Rearranging the events
I see... you know where can I put that code on this part?
Code: Select all
$category = trim($_GET['category']);
$type = trim($_GET['type']);
$eventId = trim($_GET['eventId']);
$dateId = trim($_GET['dateId']);
$agencyId = trim($_GET['agencyId']);
$sessionId = trim($_GET['sessionId']);
$institution = trim($_GET['institution']);
$_SESSION['dateId'] = $dateId;
$_SESSION['eventId'] = $eventId;
$_SESSION['agencyId'] = $agencyId;
$_SESSION['sessionId'] = $sessionId;
$_SESSION['display'] = trim($_GET['display']);
$display = "<b>Display Criteria:</b> ". stripslashes(trim($_GET['display']))Re: Rearranging the events
I don't see any query in there, so it doesn't look like it would fit anywhere.
-
ryojinaiseki
- Forum Newbie
- Posts: 7
- Joined: Tue Feb 07, 2012 7:19 pm
Re: Rearranging the events
I couldn't send the file wherein the code that I was asking that's why just I couldn't tell which part.