Contact Us Forum Rules Search Archive
WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Database Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Database Discussion Forum This is the place to find help resolving those nagging questions you have about implementing and using all kinds of databases. Need help writing a query? Need an opinion on Oracle? Post here!

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-08-2004, 01:11 PM
WebProWorld Member
 

Join Date: Jan 2004
Location: NorCal
Posts: 64
MasterT RepRank 0
Default [PHPmySQL] How? Make sortable table format of mySQL database

hello i have a database i just made and i want to lay it out like this http://www.mxtracks.us/mx/California/ that is all static HTML now and it can be sorted by City or Track Name by going to a different html document


i have made a mySQL database with this information and i want to place it all on a table like that and be able to sort it by anything i want and be able to search the database too.


i also have another problem the last updated date is in the format yyyy-mm-dd and i want it to be like January 1st, 2004 is that possible?




Thanks 4 reading
MasterT
__________________
http://mxtracks.us/images/MXTracksLogo.gif
California MX Tracks, Games, Photos, whatever you want its here
Reply With Quote
  #2 (permalink)  
Old 06-08-2004, 11:35 PM
WebProWorld Veteran
 

Join Date: Apr 2004
Posts: 453
HardCoded RepRank 0
Default

For the sort,

Code:
if($_GET['sort'])
{
    $sql .= " ORDER BY {$_GET['sort']}";
}
For the search, try something like
Code:
if($_POST['query'])
{
    $sql .= " WHERE description REGEXP '[[:<:]]{$_POST['query']}[[:>:]]'
}
and for the date

Code:
$sql = "SELECT DATE_FORMAT(last_updated, '%M %D, %Y')";
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Database Discussion Forum
Tags: , , , , ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0