Jump to content


  • Posts

  • Joined

  • Last visited


About TomFromKWD

  • Birthday 03/03/1989

Profile Information

  • Gender
  • Location
    Rotherham, England

TomFromKWD's Achievements


Member (2/5)



  1. Brilliant stuff cheers for all the support
  2. one final note I've just thought about after discussing it with the user is at what time will it recognise the date change to the new day Is it going to run off GMT, or the viewers time zone, or another time zone IE UCT,PCT etc?
  3. mysql_query ("SELECT *,DATE_FORMAT(displaydate,'%Y-%m-%d') FROM `2011-09` WHERE displaydate <= CURDATE() ORDER by day_id DESC") or die(mysql_error()); the above worked i just forgot to put my &getimages= on the front like a fool Thanks for all the support guys Youve been immense as always
  4. on that try weve gone back to it kicking out the original error and no die messgae (the or die is still in the code)
  5. its telling me "Unknown column 'thedate' in 'where clause'"
  6. it is there though, and without the date alterations im trying to make and just using the following alone works, but obviously is showing EVERYTHING in the table, including that set with a date for the future $getimages=mysql_query ("SELECT * FROM `2011-09` ORDER by day_id DESC");
  7. the error is as follows Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in "path"/2011-09.php on line 49 and unfortunately the issue persists after the above supplied code could it be to do with how I am storing the date in question in the database? and if it helps the full bit is now as follows: <?php include 'connection.php'; $getimages=mysql_query ("SELECT *,DATE_FORMAT(displaydate,'%Y %m %d') as thedate FROM `2011-09` WHERE thedate <= CURDATE() ORDER by day_id DESC"); while ($images=mysql_fetch_array($getimages)) { echo " " .$getimages['codeopen']. "" .$getimages['code']. "" .$getimages['codeclose']. ""; } ?>
  8. I am trying to get the SELECT query to take a date from a field in the database called displaydate and ensure it only shows entries that have a displaydate of the date today or earlier <?PHP mysql_query ("SELECT *,DATE_FORMAT(displaydate,'%Y-%m-%d' as thedate FROM `2011-09` WHERE DATE_SUB(CURDATE(),INTERVAL 31 DAY) ORDER by day_id DESC"); ?> the above code is just kicking out an error so I assume I've got lost somewhere but not sure where can someone please help me correct what I have wrong and explain WHY it is wrong
  9. Hi guys, I have a feeling the answer to this will be something incredibly simple I will be amazed I have failed to overlook but lets see. I have a database currently storing images as BLOB, it appears to be holding them fine, my upload page works fine to put images there etc The issue is coming when trying to display the images on an alternate page. I am using the code below, and it seems to recognize the field, however it is not displaying an image, it is displaying code. I have a feeling I need to add something to my headers to allow the page to show the images, but am not 100% sure. If someone could let me know what I am missing it would be great. Thanks in advance. <? include "config.php"; $query = mysql_query("Select * FROM app_images WHERE image_month='test' ") or die(mysql_error()); while ($row = mysql_fetch_array($query)) { echo " " .$row['image']. " <br /><br />";} ?>
  10. Hey guys I have a client who wants to upload images then have them display on his page... obviously that process is not an issue at all. The catch is he wants the image to change at midnight and display the next image in the sequence, then display it until midnight strikes, and then the next in the sequence is displayed. Is there any code type that will recognise a set time/date and display coressponding images in a database? I realise I made need to add a field for an ID number/date ID for the code to identify which image to display, but not sure what code will/wont work Can some one point me in the right direction would be much appreciated Thanks Tom
  11. do you have any form of auction ID in the database tables? You could use a NOT IN ie mysql_query("UPDATE offers SET buyer_status='Sorry, you did not win this auction' WHERE auctionID='$auctionID' AND buyer NOT IN ('$buyer')"); That would update everyone related with that auctionID who is not the "$buyer" with 'Sorrry, you did not win this auction' instead of 'auction ended, you won'.... in theory. That exact code its self wont work unless you have some form of ID you can call on to identify, and it may not be 100% perfect as its a while since I've used "NOT IN" and thats off the top of my head lol Im sure someone can touch it up, or confirm that I have added the NOT IN in the correct fasion Hope it helps at least, or points you in the right direction. Tom
  12. the coding will differ depending on your database structure do you have a database in place? if so what is the layout?
  13. Guys Im having a strange issue with my code I have a form to request a password to be sent to email incase forgotten The script seems to run as it should as in taking the info then redirecting to the messages page for confirmation no problem but its not sending the email Ive checked and double checked, and even re written the code from scratch and nothing seems to be playing ball in sending the email Can someone shed some none sleep deprived eyes over it and point out what will no doubt be an obvious error I just cant seem to see The Form: <form name="sendpw" method="post" action="sendpw.php"> <br> <table width="100%" border="0" class="tbl"> <tr> <td width="198"><div align="right">Username:</div></td> <td width="418"><input name="name" type="text" class="input" size="30"></td> </tr> <tr> <td><div align="right">Email: </div> </td> <td><input name="mail" type="text" class="input" size="30"></td> </tr> <tr> <td colspan="2"> <div align="center"> <input name="Submit" type="submit"> </div></td> </tr> </table> </form> The Script: <? include ('config.php'); $name=$_POST['name']; $em=$_POST['mail']; $query="SELECT pw FROM user WHERE uname='$name' AND email='$em'" or die (mysql_error()); $result= mysql_query($query); $row = mysql_fetch_assoc($result); $pass=$row['pw']; $to="$em"; $from="From: passwords@MBD.net"; $msg="Username: $name\r\n"; $msg .="Password: $pass\r\n"; $msg .="Please keep this password safe"; $subject="Your Login Password\r\n"; mail($to,$subject,$msg,$from); header( "Location:messages.php?msg=2" ); exit(); ?> config.php is just my database connection info, which is working fine as it runs all all my pages that access the database. Thanks Tom
  14. Thanks to all 3 of you! Ill give them a blast and see how I get on, they sound to be the right thing Im after Help appreciated
  • 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.