Jump to content

siezma

Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Everything posted by siezma

  1. Hello, I have implemented a tag cloud widget for my application. Everything works fine except the creation date. The widget gets the data from xml file. You can see some data below; <?xml version="1.0" encoding="UTF-8"?> <response> <tags> <tag created="1171020448890" freq="170" rank="100" tagtitle="photography" /> <tag created="1171111779109" freq="136" rank="80" tagtitle="nightNikon" /> <tag created="1171020449328" freq="80" rank="47" tagtitle="macro" /> <tag created="1171020449015" freq="79" rank="46" tagtitle="flickr" /> <tag created="1171020448890" freq="78" rank="45" tagtitle="lattimore" /> </tags> </response> I have created a table including created field as a datetime format. And when i am fetching it from the database, I am using the sql below; SELECT UNIX_TIMESTAMP(created) AS utimestamp,freq,rank,tagtitle FROM tag ORDER BY freq DESC LIMIT 100 But when the application shows the date, it shows "1/14/1970" or something like that. Also returning timestamp is 10 digits from mysql, but the timestamp which widget using is 13 digits. I am not good at time at php. What i am doing wrong? What is this EPOCH time? Note: This is not a 3rd party app problem. My question and problem is not about the widget.The problem is about php and mysql date functions. So pls don't tell me to send it under 3rd party app!
  2. Btw, i forgot to mention. If i change the encoding of XML from "UTF-8" to "windows-1254". The browser shows xml and flash doesn't recognize turkish characters, but when i keep it as "UTF-8".,The browser doesn't show xml as valid and flash still doesn't recognize the characters(When i edit the xml file in notepad as UTF-8, eveything works fine ).SSDS :'(. The XML page cannot be displayed Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later. -------------------------------------------------------------------------------- An invalid character was found in text content. Error processing resource 'playlist.xml'. Line 8, P... <VIDEO Name="Hesapla EXTRA INFO ------------ PHP Version 4.4.7 MYSQL Version 4.1.21 Operating System is Linux I wanted to give you as much info as possible. I hope somebody has knowledge to solve it. I am tired of this error.
  3. Hello, I have a big problem with turkish characters ("ıüğöçş"). I am designing a video sharing script. First of all, the script gets the latest video info from mysql and write it into playlist.xml, and then flash video player reads the data from xml and shows it. However there is a problem with php generated xml files. When i use notepad and save it,everything works fine, but when php creates the xml file, strange characters appear. My; MySQL charset: UTF-8 Unicode (utf8) MySQL connection collation: utf8_unicode_ci PHP Code is below; //XML PLAYLIST START $xml_playlist="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n"; $xml_playlist.="<FLV_PLAYLIST Refresh=\"40\" Sequence=\"order\">\r\n"; $xml_playlist.="\t<DESCRITPTION Name=\"Name\" Value=\"\" />\r\n"; $xml_playlist.="\t<DESCRITPTION Name=\"Rating\" Value=\"Puan:\" />\r\n"; $xml_playlist.="\t<DESCRITPTION Name=\"Authour\" Value=\"Kullancı:\" />\r\n"; $xml_playlist.="\t<DESCRITPTION Name=\"Views\" Value=\"İzlenme:\" />\r\n"; $sql="SELECT videos.video_id,videos.indexer,videos.title AS Name,videos.updated_rating AS Rating,videos.number_of_views AS Views,member_profile.user_name AS Author FROM videos LEFT JOIN videocomments ON videos.video_id=videocomments.video_id LEFT JOIN member_profile ON videos.user_id=member_profile.user_id WHERE videos.approved='yes' AND videos.public_private = 'public' ORDER BY videos.indexer LIMIT 20"; $result=mysql_query($sql); $num_rows=mysql_num_rows($result); for($i=0;$i<$num_rows;$i++){ $row=mysql_fetch_array($result,MYSQL_ASSOC); $video_id=$row['video_id']; $name=$row['Name']; $rating=$row['Rating']; $views=$row['Views']; $author=$row['Author']; $indexer=$row['indexer']; $xml_playlist.="\t<VIDEO Name=\"$name\" Authour=\"$author\" Rating=\"$rating\" Comments=\"$comments\" Views=\"$views\" Thumbnails=\"/uploads/thumbs/$video_id.jpg\" url=\"play.php?vid=$indexer\" target=\"_self\"/>\r\n"; } $xml_playlist.="</FLV_PLAYLIST>"; //Writing the xml data in the playlist.xml $file= fopen("playlist.xml", "w"); fwrite($file, $xml_playlist); fclose($file); Please help!!! Thanks
  4. Thank you very much bqallover!. This is exactly what i need. Bye
  5. Hello, I have a question about foreign key issues.When i try to delete one record in the database(which has some related record in another table - foreign key).The script shows an error message(coming from mysql_error()).The content of the message is below; "Cannot delete or update a parent row: a foreign key constraint fails " What i want to do is to analyze the error and show more user friendly messages such as "you can't delete this record,because there are some related records etc.. " How can i do that with php? I wonder how other programmers handle this issue with php? Thanks
  6. [!--quoteo(post=375059:date=May 18 2006, 04:38 PM:name=kenrbnsn)--][div class=\'quotetop\']QUOTE(kenrbnsn @ May 18 2006, 04:38 PM) [snapback]375059[/snapback][/div][div class=\'quotemain\'][!--quotec--] Use the 5th parameter to the mail() function to specify the "Return-path:" header. [code]<?php $fifth_param = "-f $from"; mail($recipient, $subject, $msg,"From: $from",$fifth_param); ?>[/code] Ken [/quote] [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /] Thanks a lot Ken. I will try the fifth parameter. Bye
  7. Hello everbody! I have a problem about php mail.The mail function,which i use, is below; mail($recipient, $subject, $msg,"From: $from"); The script works well.I have a mail address from Yahoo and i can get the mails which the script sents.But I have realized that some of the users can't get the mails because of the reason below; May 17 10:28:09 orange sendmail[17523]: k4HES9c9017523: ruleset=check_mail, arg1 =<nobody@tttech.ekkum.ca>, relay=ikdesh.ekkum.com [64.187.28.130], reject=553 5. 1.8 <nobody@tttech.ekkum.ca>... Domain of sender address nobody@tttech.ekkum.ca does not exist Sender seems to be 'nobody@domainname'.If the users have a picky SMTP Server like the one above,they can't get the mail!!! Is there a way to work around it by setting some sender? I have search on the net and i have found one solution,but the sender says that it is not gaurantee!! mail($recipient,$subject, $msg,"From: mail@domainname\nReply-To:mail@domainname\nX-Mailer:PHP/" . phpversion()); Thanks Have a great day
  8. I have the same problem.I have checked this problem on the net.It is quite common.But i couln't find the reason. If you have any solutions,please help Bye
×
×
  • 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.