Jump to content

Recommended Posts

Thanks for the replies. I've already stored all the data in an array, so I don't want to select anything from the database anymore. Basically, this is where I'm at:

 

$concert['date'] = DATE_FORMAT($concert['date'],'%b %e, %Y');

 

But that doesn't work, of course. Any suggestions?

here's the who shabang (well... not all of it):

 

//select the database I want
mysql_select_db("archive", $connection);


//store the database in an array
$result = mysql_query("SELECT * FROM concerts");


//format the date correctly
$concert['date'] = DATE_FORMAT($concert['date'],'%b %e, %Y');

//spit out one result in this format at a time
while($concert = mysql_fetch_array($result))
  {
  echo "

 

Barand- I'm looking into doing it with PHP too, I'm just not sure how to format it and keep getting errors, but I'm trying to work through it, so I'll learn. Super newbie here with a strong desire to learn.

//select the database I want
mysql_select_db("archive", $connection);


//store the database in an array
$result = mysql_query("SELECT *,DATE_FORMAT(`date`,'%b %e, %Y') as fdate  FROM concerts");

//spit out one result in this format at a time
while($concert = mysql_fetch_array($result))
  {
  echo $concert['fdate'];

or with php...

 

//select the database I want
mysql_select_db("archive", $connection);


//store the database in an array
$result = mysql_query("SELECT * FROM concerts");

//spit out one result in this format at a time
while($concert = mysql_fetch_array($result))
  {
  echo date('M j, Y',strtotime($concert['date']));

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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