Jump to content

shiftJIS

Members
  • Content Count

    87
  • Joined

  • Last visited

Community Reputation

0 Neutral

About shiftJIS

  • Rank
    Newbie

Contact Methods

  • Website URL
    http://kashi.freelancedreams.com/

Profile Information

  • Location
    Japan
  1. Assuming you're using MySQL...The documentation is your friend: ( http://dev.mysql.com/doc/refman/5.1/en/datetime.html )Of course, make sure you're reading the version that applies to the one being run on your server, although I can't think of any changes between the newer ones of the top of my head.In short, there are a LOT of formats you can use, and MySQL will interpret it based on context and even strip off extra data (like hour/minutes/seconds which don't get stored in DATE) automagically. You can even use date-time functions supported by MySQL ( http://dev.mysql.com/doc/refman/5.1/en/da
  2. Two issues really:1st, collation for email storage: I generally default to utf8_unicode_ci for my table and field collations. However, since email protocols (AFAIK currently) only support ascii characters, I get the feeling that I should set the collation of email fields to latin1_general_ci (or ascii_general_ci??). Of course I'll be validating data via regular expressions before entering them into the database, but is using unicode overkill for that type of data? Am I saving myself overhead and storage by 'down-collating' or are there reasons to stay with utf8 (I for one am optimistic that
  3. Not that I know, but I do have some advice on how to catch some of these mistakes:Make sure you know what version of HTML you're working with and set a doctype ( http://www.w3schools.com/tags/tag_doctype.asp ) correctly. Use the newest, so either HTML 4.01 or XHTML 1.0, though I recommend XHTML for reasons I won't list here.With a proper doctype and your html elements properly written (the most common is to close out 'single' tag elements properly: <br />, <hr />, <input XXX />), you can use the w3 validator ( http://validator.w3.org/ ). Not only do you make sure that your
  4. I haven't set up a test to reproduce the issue, but it seems like you already have a <form> element around the menu. Is there a reason for that being there? I think the issue is because you're injecting the response text into that form. I don't think you're allowed to have form elements within form elements.Either close off that menu <form> and inject the new form outside of it. (although I would get rid of that form entirely and put the menu items as <li> elements in a <ul>)
  5. shiftJIS

    AJAX problem

    Maurice, Do you use firefox? The firebug ( http://addons.mozilla.org/en-US/firefox/addon/1843 ) addon is really helpful in figuring out issues. Looking at your site page, it renders properly and the AJAX call was sent ( www.cyou-online.nl/zapo/menu-selectie-soort.php?q=verberg&sid=XXXXXXXXXXXXXXX ) but the resulting page is empty. I think it's an issue with that file (menu-selectie-soort.php ). Either your server isn't php ready, or there is some issue with the code. Double check to make sure that php works on your site and then post the code from that file.
  6. no problem, and seeing what I wrote again this morning, I remember a faster way of doing this. The way you were doing earlier is fine if you need do a transform on any of the fields. But if you want all the fields and keep the exact same field names this way is faster: $query = mysql_query("SELECT * FROM map_data WHERE 1 LIMIT 5");$num=1; //this needs to be outside the loop$results = array(); //lets just make sure we start off with an empty arraywhile ( $results[$num] = mysql_fetch_assoc( $query )) { $num++;}print_r($results); In the previous code, $row = mysql_fetch_assos($query) gives us
  7. each time it goes through the loop it will set $n=1 again. Despite the fact that you have $n++ at the end of the loop (making $n=2), when it goes back to the top, it will be set to 1.Your $result array will then only have 1 element that contains the very last row from the mysql query.
  8. shiftJIS

    looping

    I also can't see the issue from the code provided. It does seem strange that you're using the .viewer class for both the table and the individual .tdWe'll need to see a sample of your .css file in order to be more help...
  9. This question seems very vague. If you need information regarding general select and updates, that is probably too basic for this forum (at least, I'm not willing to put in the time necessary to answer that). You are better off googling for a tutorial (w3schools also has help with databases: http://w3schools.com/sql/default.asp )If you've already made an attempt and are having issues, then please post again with more specifics regarding your problem.
  10. hgmme: you have the right idea, but not carried out properly. I'll describe my fixmc_keny: while that does output all of his variables, it doesn't put it into an array to be fetched later. $num=1; //this needs to be outside the loop$results = array(); //lets just make sure we start off with an empty arraywhile ( $rows = mysql_fetch_assoc( $query )) { $results[$num] = array ( "share_info"=>$rows['share_info'], "share_email"=>$rows['share_email'], "share_website"=>$rows['share_website'] ) ) $num++}print_r($results); //Here you can see that $results has all of your information
  11. mc_keny:The whole string of if(){}elseif(){}elseif(){} is very messy. While it works, you should consider learning the switch statement as that cleans up the code a lot and offers extra functionality for special cases: switch ($act){ case "page1": .... break; case "page2": .... break; case "page3": .... break; default: .... break;} More details are at http://www.php.net/manual/en/control-structures.switch.php
  12. I think it should be (at line 11):foreach($_COOKIE as $name => $value){ $pref["$name"] = $_GET["$name"] ? $_GET["$name"] : $value;}You are currently using $_COOKIE["cookie"], which is only one particular cookie.
  13. $_REQUEST["foo"] complies all of its content from $_GET, $_POST and $_COOKIE (see here for more info: http://us.php.net/manual/en/reserved.varia...riables.request )I'm not sure what order it fetches in, so if you have conflicting values (say what comes out of cookie and post) I don't know how php will behave. What I usually do is use ternary conditional operators.$var = ( $_POST["foo"] ? $_POST["foo"] : $_GET["foo"])Ternary is explained here (http://us.php.net/manual/en/language.expressions.php ). Basically, $var will be set to $_POST["foo"] if such a value exists, otherwise it'll be set to
  14. My issue is that the front page renders fine, but following any link leads to a blank screen. If I press reload (still on the blank screen) then the intended page shows up fine.This only occurs in certain versions of IE6. Site works fine in all other browsers (Safari, Firefox, IE7) and some versions of IE6 (like in my virtualized XP setup I use to test these things). I use the same backend for another site on a different domain using relatively the same headers and no issues with that site. I've done header sniffing with fiddler (I thought it might be something to do with compression), rea
  15. Haha, I guess everybody is as confused as me.Actually, the habit is coming from C, where you have to type all of your variables and functions. I'm actually not all that specific about typing in php, but my current project will be offered to the public eye, so I've been trying to take all steps into making it clean and legible to others.I suppose my confusion starts at the php docs: As you notice, they describe all the functions and tell you 1) the type the function returns, and 2) the types it takes as arguments.I do know that we don't have to declare types of variables, but I wanted to - I
×
×
  • Create New...