Jump to content

eugeniu

Members
  • Posts

    65
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

eugeniu's Achievements

Member

Member (2/5)

0

Reputation

  1. I'd like to create a database with a table that will store "sets" of flash cards with each set having any x number of flash cards, so I'm looking to have a table that will store one set per entry. But now my problem is, how do I store the flash cards for each set? Would it be a good idea to have them all somehow stored with its set's entry, or should I give each flash card its own entry in another table, with a parameter being what set the flash card belongs to? Or am I missing a better solution? For the sets, I need to store the set title, id, author, and some other properties, and for the flash cards I need to store question, answer, position in set (first, second, etc), and what set it belongs to. What would be the best solution?
  2. The code above states that while $breed is set (exists) do (echo) all of this stuff. Nowhere in the code is $breed unset so yeah, it'll go on forever. What are you trying to do with this script?
  3. You'd need to either make a database of users that are online for reference or have a column in your users table that saves the last time a user was on your website. In your code that shows whether another user is online or not, you'd need to specify which user your talking about. $username = "eugeniu"; $username = // code to retrieve entry for "eugeniu" goes here if (time(); - $username['laston'] < 5*60) // 5 minutes till last on { echo "User is online."; } else { echo "User is not online."; } Hope that helped...
  4. What is the code you use to validate that someone is logged in? Non-members can only see part of all of the content, so there must be something.
  5. Sigh, I gave up trying to do this the way I wanted to and just created a mysql table that has the various word endings I need in romaji (Japanese using latin alphabet) and in kana (Japanese), where I can request something using romaji and get it in kana.
  6. I also tried doing the following: mb_convert_encoding($answer, "ISO-8859-1", "UTF-8"); mb_convert_encoding($rightanswer, "ISO-8859-1", "UTF-8"); But that doesn't work either!
  7. I tried doing iconv("UTF-8", "ISO-8859-1//TRANSLIT", $rightanswer);, but that's not doing anything. Is there something else I'm supposed to use for the first two properties?
  8. Sadly, using that one doesn't seem to make a difference.
  9. string(12) "たべます" string(22) "たべます" Guess not. I tried using htmlentities on the input string, then both strings, but I still get the same problem. Answer: たべ + ます string(12) "たべます" string(22) "たべます" htmlentities()... string(12) "たべます" string(22) "たべます" Fail. たべます =/ たべます
  10. Hehe. I never would have thought of that if I were you .
  11. It's listed as utf8_general_ci. And if it means anything, I have this in my header: header("Content-type: text/html; charset=utf-8"); mb_internal_encoding("UTF-8");
  12. I wrote a script that retrieves a word from a database made up of Japanese characters, adds two more Japanese characters to the script, and has the user enter the new word, in Japanese. For the purpose of debugging, I've simplified the script. The script is supposed to take the submitted word and check if it matches the word from the database, and return "Success" or "Fail". However, no matter how many times I enter the correct word, it determines it's incorrect. The code to the script is shown below: <?php session_start(); $title = "Test Quiz"; $autoselect = "quiz.answer"; include ("header.php"); echo "<h1>Test Quiz</h1><div id=\"quiz\">"; $entry = mysql_query("SELECT * FROM verbs LIMIT 1") or die(mysql_error()); $entry = mysql_fetch_array($entry); $masu = "&#12414;&#12377;"; echo "Answer: $entry[ans_kana] + $masu<br />"; if (isset($_POST['form_submit'])) { $answer = $_POST['answer']; $rightanswer = $entry['ans_kana']; $rightanswer .= $masu; if ($answer == $rightanswer) { echo "Sucess.<br />$answer = $rightanswer<br />"; } else { echo "Fail.<br />$answer =/ $rightanswer<br />"; } } ?> <form name="test" action="test.php" method="post"> <input id="answer" type="text" name="answer" size="10" maxlength="60" /> <input type="hidden" name="form_submit" value="submitted" /> <input type="submit" name="submit" value=">>" /> </form> <?php echo "</div>"; include("footer.php"); ?> The above script can be run at http://kanaquest.com/dev/test.php . The right answer is supposed to be たべます, which is a combination of the string from the database, and $masu. But it seems that when a string from the database is combined with a UTF-8 string, nothing I enter matches the formed string. However, when $rightanswer is only a word from the database, or only a UTF-8 string set in the script, I have much better luck with the script matching up my submitted word with the word in the script. What am I doing wrong?
  13. God am I stupid... I just quickly looked for "day" on php.net's Date page and just saw "01 through something..." and used that. Sigh. Thanks a lot for clearing that up.
  14. I don't understand. The format I have it use is correct. I need something like 14:47, Jul 27, 2009, but while the hour and minute is correct, the month, day, and year is stuck on July 7, 2009.
×
×
  • 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.