Jump to content

Sephiriz

Members
  • Posts

    20
  • Joined

  • Last visited

    Never

Contact Methods

  • AIM
    Sephiriz
  • Website URL
    http://

Profile Information

  • Gender
    Not Telling
  • Location
    New York

Sephiriz's Achievements

Newbie

Newbie (1/5)

0

Reputation

  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?
×
×
  • 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.