Jump to content

[SOLVED] SQL query problem


ferret147

Recommended Posts

I am using Dreamweaver to make a On This Day scrips, I already have a database populated but just having a slight problem getting the info I want displayed.

 

In the database I have a date field for each record formatted like this yyyy-mm-dd, when the year changes I have to go through the entire database and change it from say for this year 2008 to 2009 to get my records to display, so I am trying to give the year a wild card so if any entrys match the month and day they will display instead this will save me loads of time every year going through the database and changing the year.

 

Below is the code I have so far but all it displays is the first entry in the database.  Can anybody please advise as to where I am going wrong or even if I am going in the right direction for this.

 

 

$today = date("%%%%-m-d");


$query_Recordset1 = sprintf("SELECT * FROM OnThisDay WHERE `date` = '$today'", $colname_Recordset1);

Link to comment
Share on other sites

Take some time to familirise yourself with MySQL functions (don't learn them by heart, just read the list to know what functions are available). This will increase your 'know how' factor :P

Link to comment
Share on other sites

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.