Jump to content

Alicia

Members
  • Posts

    163
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Alicia's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Alicia

    change format

    If I need the time as well so shall I use datetime? so what you recommended is I add a new column with datetime format, then use str to datetime function to convert the value and update the generated value into the newlly added column?
  2. Hi guys, Anyone know a quick fix how I can change a column value from US datetime to UK in all records? e.g : 25/12/2010 23:59:00 to 12/25/2010 in the database Currently the var type for this column is varchar Please advise. Alicia
  3. i am not sure... there is a syntax error when i run the query
  4. i just want to filter the records by referrring to the date i have in the column but currently it is in varchar so i couldn't filter by date range
  5. Hi guys, can somebody give me an idea why this query doesn't work? thanks SELECT SUM(credit) AS usage, STR_TO_DATE(`created`, '%m/%d/%y'),STR_TO_DATE(`expiry`, '%m/%d/%y') FROM `suax` WHERE STR_TO_DATE(`created`, '%m/%d/%y') >= '11/5/2012' AND STR_TO_DATE(`expiry`, '%m/%d/%y') = '11/15/2012' LIMIT 0 , 30 my created and expiry format is a string like this 1/15/2012 04:05:22 Please advise.thanks
  6. can any guru give me an idea what I have done wrong here? Why my onclick function is not working and no popup window is displayed? This : <a onclick="window.open('http://www.facebook.com/sharer.php?s=100&p[title]=<?php echo $title;?>&p[summary]=<?php echo $summary;?>&p[url]=<?php echo $url; ?>&&p[images][0]=<?php echo $image;?>', 'sharer', 'toolbar=0,status=0,width=548,height=325');" href="javascript: void(0)"> and this also not working <a href="#" onclick="window.open('http://www.facebook.com/sharer.php?s=100&p[title]=<?php echo $title;?>&p[summary]=<?php echo $summary;?>&p[url]=<?php echo $url; ?>&&p[images][0]=<?php echo $image;?>','windname','width=325,height=54,top=50,left=50'); return false;"> please advise.thanks
  7. Hi, i am trying to run this script but encounted an unknown error .. can somebody give me an idea whats wrong with my php mysql code $mysett = "'".$myopt[0].','.$myopt[1].','.$myopt[2].','.$myopt[3]."'"; $prescho = mysql_query("SELECT *FROM stud WHERE `d_type_id`IN ($mysett) AND `disp_homep` = 'yes' AND STR_TO_DATE(join, '%d/%m/%Y' ) <= CURDATE( ) AND STR_TO_DATE( left '%d/%m/%Y' ) > CURDATE( ) ORDER BY FIELD( `d_type_id` , $mysett ) , `Deal`.`join` DESC"); no error or record displayed in the page even there are records match the condition... please help
  8. Hi guys, Can some guru give me an idea how should I create a php query for my search form as below? I tried to search online for some tutorial for such searches from a form but found nothing relevant.. please help.. I have a form that allow user to search : Class type : Student name : Student email : Student gender : I want to create a php mysql query that if the user only key in the name, it will only search the name column and if the user key in name and email, it will search both with AND in the query and if all are inserted, it will search all with 4 columns (AND) in the query. The problem is i am not sure how to create such conditional statement so a proper query can be generated according to what textfields they user insert in the form.. please advise..
  9. Hi, May I know why my conditional statement doesn't work when comparing with decimal point input? $money = 0.2; if($money<=0) { echo 'no money'; { else { echo 'OK'; } The output after multiple tries by using intval or float , it still show OK when it suppsed to show no money... May i know what I have missed? it seems like the php script cant recognize 0.2 is smaller than 0. please advise
  10. hi guys, can somebody give me an idea how I sort the records that I want to display order by value that I sum up from records? I have a query like this : // in a while loop $sold = mysql_query("SELECT COUNT( class ) AS num FROM `Student` WHERE class ='xxx' "); Anyway I can do something in a new query like select * from class order by num ASC ? first i want to count how many students in every class from Student table then I want to arrange the class records and display in a web page order by number of students they have in each of the classes. I am not able to sort from the class table because there is no column for this value, thats why I need to count from another table first. TQ
  11. i have changed that but it is still not showing the latest date on top.. any idea? thanks
  12. thanks guys but how can i sort this column by showing the latest date first since this is a varchar column? i tried $re= mysql_query("SELECT * FROM `students` ORDER BY STR_TO_DATE( join, '%d/%m/%Y' ) DESC"); but it is not working.. can someone pls assist..thanks
  13. Guys, can someone give me a hint on this. Currently i have 2 columns in db to store the date but the structure is in varchar How can I compare the date with these columns because I did try to use str to date function but now working. My script as below. my column name is join and grad and data store in these varchar columns format is like this : 14/03/2001 11:30:00 $now = date("Y-m-d"); $beu_main = mysql_query("SELECT * FROM `students` WHERE STR_TO_DATE( join, '%d/%m/%Y' )<='$now' AND STR_TO_DATE( grad, '%d/%m/%Y' ) > '$now'"); anything wrong with my query or any quick fix? thankyou.
  14. anyone has idea how to solve this prob? thanks
  15. Hi, Can any guru can advise me on this? I have used this code to capture name, email and etc from facebook connect without any problem function fbLogin() { FB.login(function(response) { if (response.session) { //user is logged in, reload page window.location.reload(true); } else { // user is not logged in } }, {perms:'read_stream,publish_stream,offline_access,email'}); <INPUT TYPE="BUTTON" onclick="fbLogin()" value="login" src="images/fb"> I managed to print data with this after login echo "$user"; // user facebook id echo $user_info['email']; echo $user_info['name']; but now my facebook logout script to destroy the sessions are not working. include_once "facebook-php-sdk/src/facebook.php"; setcookie('fbs_'.$facebook->getAppId(), ”, time()-100, '/', 'http://www.myste.com'); session_destroy(); header('Location: /'); may i know why i am still not logout yet after loading the script. I tried to search online but none solution seem to work to destroy facebook session from my site. please advise.
×
×
  • 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.