Jump to content

westman

Members
  • Posts

    600
  • Joined

  • Last visited

Everything posted by westman

  1. thank you. how would i get a better search result from my database when my "title" holds more than 1 word? $sql = "SELECT id FROM post WHERE MATCH (title) AGAINST ('$keyword')";$sql = "SELECT id FROM post WHERE (title) LIKE '%$keyword%'";
  2. what is a fulltext index? am searching posts from users like this forum,so the title in the database will be "Search Bar Match Against Or Like"and the post info would be my 1st post
  3. 1.if you was building a search bar to search post titles from your database, where the titles has more than 1 word what would you use in your mysql_query LIKE or MATCH AGAINST? 2.if you was building a search bar to search post titles and post info from your database, where the titles and post info has more than 1 word what would you use in your mysql_query LIKE or MATCH AGAINST? please give logic and resigning. thank you in advance.
  4. westman

    Time()

    $time2 = date("Y-m-d",time() - (60*60*24*7*4));$sql1 = mysql_query("DELETE FROM post WHERE item='0' AND date < TIMESTAMP('$time2')")or die (mysql_error()); this is working and my date in my database is set to date not timestamp. thank you very much to every one who helped me with my scripted am so happy i could party ;)i have been working on the other a week now ones again id like to thank this site for having a forum with a live community and i thank the people of the community becausewith out the people there is no community. thank you
  5. westman

    Time()

    am sorry its still not working
  6. westman

    Time()

    thank you for your reply,however it is still not working i tied with and without {} curly bracketsit loos like this now... $time2 = time() - (60*60*24*7*4);$sql1 = mysql_query("DELETE FROM post WHERE date <$time2")or die (mysql_error()); date is set to timestamp and its still not working i have been working on this just under 7 days now
  7. westman

    Time()

    i tried $time2 = time() - (60*60*24*7*4); $sql1 = mysql_query("DELETE FROM post WHERE date <'$time2' AND item ='0'")or die (mysql_error());and$sql1 = mysql_query("DELETE FROM post WHERE date >'$time2' AND item ='0'")or die (mysql_error()); but it still dose not work date is set to timestamp
  8. westman

    Date ()

    and not yet got a working script to delete data from my database that is 4weeks old
  9. westman

    Date ()

    hi all, i am trying to get post's in my database deleted after 4 weeks and 12 weeks using mysql_queryi tried in php but no luck this is what i have so fear... mysql_query("INTERVAL 30 DAY SELECT FROM post , DELETE, WHERE id ='0'"); and also mysql_query("DELETE FROM post WHERE id='0' AND date='<=CURRENT_DATE - INTERVAL 30 DAY'"); *please don't look at id as v id i gust changed it for this post would any of the 2 above work?
  10. westman

    Time()

    i still have posts in my database that is older than 30 days
  11. westman

    Time()

    am using timestamps in my database but i can change it to time if i knew the code needed to delete 30 day old posts.am new to php and any help with my ode is mush appreciated.
  12. $sql = mysql_query("INSERT INTO table (date) VALUES(now())") or die (mysql_error());
  13. westman

    Time()

    am trying to get a working piece of code to delete after 4 weeks and 12 weeksso fear i have this... $time1 = time() - (60*60*24*7*4);$sql1 = mysql_query("DELETE FROM post WHERE date > '$time1' AND id ='0'")or die (mysql_error()); $time2 = time() - (60 * 60 * 24 * 7 * 12); $sql2 = mysql_query("DELETE FROM post WHERE date > '$time2' AND id ='1'")or die (mysql_error()); but its not workinghow do i get this right?
  14. westman

    Php Division

    its not working am sending the result to my database and seeing no changes
  15. westman

    Php Division

    hi all,am trying to take one number from anther.this is what i have... $number1 = 5;$number2 =2; $number1 = ($number1) - ($number2);$number1 = ($number1 - $number2); this is not working for me. My result is not 3 ie. 5-2=3 how do i do simple division in php?
  16. westman

    Auto Delete File

    i have files where i need to remove them from my server if they are 30 days old i know of the "filemtime"i know of the "unlink"and now know about the "time()" but how do i put it all together?
  17. i thank every one for there help and support thank you.
  18. so if i use $days = 90;$time = time() - (60 * 60 * 24 * $days); is this 12 weeks?
  19. ok i just use this on my server and it worked $days = 30;$time = time() - (60 * 60 * 24 * $days);$sql = mysql_query("DELETE FROM board WHERE date < '$time'")or die (mysql_error());but can some one help me understand all of the numbers (60 * 60 * 24 * $days and also 4*7*24*60*60)
  20. out of$timeEdge=time()-(4*7*24*60*60)what number is the days and what number is the mounts?
  21. hi allam trying to get posts to auto delete from mysql database after the post is 4 weeks old $sql = mysql_query("UPDATE board SET mail='$mail', date 'NOW' WHERE id='$id'")or die (mysql_error());how do i change my script?
  22. westman

    if, else if, else

    my code is not working and i believe it is due to "if, else if, else"if ($pass1 != ""){ if ($pass1 != $pass2) { $updatmsg = '<font color="#FF0000" size="+1"><u>ERROR:</u><br />Your Password fields below do not match.<br /></font>'; }if (strlen($pass1) > 20) { $updatmsg = '<font color="#FF0000" size="+1"><u>ERROR:</u><br />Your New Password is too long. 6 - 20 characters please.<br /></font>'; }else{if (strlen($pass1) < 6) { $updatmsg = '<font color="#FF0000" size="+1"><u>ERROR:</u><br />Your New Password is too short. 6 - 20 characters please.<br /></font>'; }else$sql = mysql_query("UPDATE project SET password='$pass1' WHERE id='$id'")or die (mysql_error());$updatmsg = '<font color="#006600" size="+1">Your password was updated successfully.</font>';could you please help with a working scriptthank you.
  23. westman

    php date

    can you give an example please, am new to the php world and do not understand a lot, all i know is i have$b_m$b_d$b_yand need to get$b_y = "Y";$b_m = "m";$b_d = "d"; and then get the Y, m, d to display the date in 3 different drop down menu's
  24. westman

    php date

    hi all this is my 1st post :)i have this code to sand a date from 3 drop down menu's to my DB and its working for me $date = "$b_y-$b_m-$b_d";but how do i send my $date from my DB to display in my 3 drop down menu's?thank you in advance.
×
×
  • Create New...