Jump to content

Sephiriz

Members
  • Posts

    20
  • Joined

  • Last visited

    Never

Everything posted by Sephiriz

  1. Alright, thanks for everyones help. I suppose that I'll just need to do a typecasting then. Appreciate the help.
  2. My problem is that I want to use the result from that value in a function which makes sure that the value passed through is an integer by using is_int(). That's my problem, and I know there are work-arounds, but I'm genuinely curious as to why I'm getting the result I'm getting, because nobody else has ever said anything about all mysql results being automatically turned into strings, even if the result was not in a VARCHAR field or something.
  3. Well he just want the person to be able to use the form button again, so they have to be on the page. You just do all the code on the loading of the page, since he has to come back to the site anyway. I don't know if I'm clear, lol, so I'm sorry, bear with me.
  4. Alright, but nobody knows why if I pull an integer from a table, that when I use fetch_assoc() it turns the result into a string?
  5. Well, that's the idea. At the moment the user hits the submit button, you start the timer. It doesn't matter if he's on the page or not, the timestamp limits him regardless, because you check every time you load the page. The timer is just superficial, and once the user can hit the form button again, the javascript will just re-enable the button.
  6. I understand that, but at no point did I indicate that it should be anything but an integer. Um, quick question I guess then: can the various parts of an array be different types of variables? Like $test[0] is a string, and $test[1] is an integer? Or is $test an array where all values are strings.
  7. Alright, from a hypothetical standpoint, I would say your solution is AJAX. Step by step, this is how I imagine what you want to happen would work: 1. User hits form button. When that button is hit, trigger the execution of a PHP script. In this instance, your PHP script will check a database field whether a time for the user has been set or not. If not, then you store the current time. 2. Have the AJAX code get the stored time from the php script, and then get the current time. Through some basic math you should get the amount of time that has elapsed. From there on, just make a simple javascript countdown timer. The great part about this is that if the user refreshes the page, it won't influence the fact that the time they hit submit is still stored in a database. 3. If the javascript timer counts down to zero, execute another PHP script that will remove the time from the database. 4. Since the page that the form button corresponds to is probably PHP, just make sure that the code on that page cannot be executed if a time is set in the database. This is all theoretical, but its definitely possibly. Not easy, but doable.
  8. I've coded for a while, but have been on a nearly 2 year hiatus, so I'm currently refreshing my memory by trying to code simple things. I have a unit table, and I have an owner_id column, which is an int data type, unsigned. In a test row I made, I set owner_id to 1. I send the appropriate query to the database, and I then get the result, which SHOULD be an integer, but for some reason, I keep on getting a number 1 in a string variable. Why won't I get an integer result if the data type is integer? $query = "SELECT * from units"; $result = $mysqli->query($query); /* numeric array */ while ($row = $result->fetch_array(MYSQLI_ASSOC) ) { //print_r($row); echo gettype($row['owner_id']); }
  9. I see, can you provide me with a link as to where to find documentation for the exact syntax I should use that will always work? Also, what would be the correct way to make this query: $query2 = \"SELECT * FROM $Name WHERE Genre = \'$_GET[Genre]\' ORDER BY $View\";
  10. Ok, suddenly I\'ve been receiving syntax warnings that never before appeared. What is wrong with the following query: $query10 = \"SELECT `Name` FROM `users` WHERE `ID` = \'$_SESSION[user]\'\";
  11. How can I make Apache start automatically once I login WinXP? I figure it has something to do with Regedit,but I know better then to mess around with it. Does anyone know how I can get Apache to auto-start, or point me to where I can learn how to get it to auto-start?
  12. So stick with using one column called Type, where you store the type of recipe it is. Another alternative, although I don\'t believe is necessary, is creating a table of types of food, each with a unique ID, and using that ID under type to refer to that food type in the other table. ID|Name|Recipe|Type| 1 |Bagel|blah...|Breakfast| If you made another table for food types: TABLE Food_types ID|Name| 1| Breakfast| --------------------- TABLE Recipes ID|Name|Recipe|Type| 1| Bagel| Blah | 1 | I personally would just stick with: TABLE Recipes ID|Name|Recipe|Type| 1 | Bagel| Blah | Breakfast|
  13. Thank you! I only use Windows, though the comp club in school is gonna use a linux network, so i suppose i can practice there as well. In any case, bless you
  14. I would look at the tutorials from phpfreaks, under the MySQL section. They help with basic understand. Also look at mysql.com
  15. This sounds like a very interesting forum, and I would love to learn something new. Maybe you guys should post some links for tutorials of basic core hacking, and maybe even make your own! Can you guys explain core hacking to me a bit? What are the advantages to making your own modules? What do modules do first of all?
  16. I wish to backup my databases. Can you guys give me tips on how to do this efficiently, and where I should store the backup information? I want my users to have their information safe. Also, when running a textfile, can I run it while it\'s zipped? Or do I need to unzip it first.
  17. If I were you, I would do one table. First row is ID, which is primary and auto-increment, assuring that every row is different. Columns would be: ID| Name| Recipe | Appetizers | Soups| etc.| So, if it is an appetizer, you put in a 1 for appetizer, or 1 for soup if its a soup. If it\'s both, put 1 in both. Then when getting the information from table, WHERE Appetizer = 1, etc. I hope this is what you were talking about, and this may not be most efficient, feel free to improve. Also! You could just make a colum called Type, and store Appetizer, Soups, etc. in it, which would save you a few columns. So instead, you would go WHERE Type = Appetizer.
  18. Sephiriz

    Optimising

    Occasionally, when I optimize a table, I cannot even access the table anymore, and I need to delete it, because it doesn\'t work. Can someone tell me why this happens?
  19. 1. How do I check? 2. No I believe my cable modem has a firewall too, but by setting to 8000, that should have been eliminated. I don\'t understand why it won\'t work on my current comp... help appreciated.
  20. Unfortunantly, a problem I had with apache on another computer (I had fixed it, but now I do not have the file, and I do not remember how I did it), and it has repeated on my current one. I am running Windows XP with a cable modem, using a routher, and a firewall. I am using Apache 1.3.23 I have it set to listen to Port 8000, so I connect on my computer with localhost:8000 For others to connect, I give them: http://24.188.93.111:8000/ Yet, they cannot connect. I am very unsure as to what the problem can be, and I exhausted myself looking up and down, and if I look again, I\'m sure I won\'t find it, mostly because I\'m pooped. So I turn to you guys, tell me what might be wrong?
×
×
  • 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.