Jump to content

matmunn14

Members
  • Posts

    21
  • Joined

  • Last visited

    Never

About matmunn14

  • Birthday 05/27/1990

Profile Information

  • Gender
    Male
  • Location
    Australia

matmunn14's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. matmunn14

    Porn Site

    I finished my final exams a week ago. Hot damn I love my freedom. Dunno what the 20 midgets idea. They're kinda scary.
  2. Come on guys I need this solved. Sorry for all the bumping as well.
  3. I've been trying to write an application that can connect to a database using Ruby and wxRuby. When I click a button I want the program to connect to a MySQL database (I'm using DBI), insert some data and then disconnect but so far I am not having any luck. Also, I'm on Windows. Here's the code that handles the connection: evt_button(22) { |event| button_save_clicked(event) } // This code is for the form with the button. def button_save_clicked(event) @sql = DBI.connect("DBI:Mysql:invoicer:localhost", "root", nil) @query = "insert into `customers` VALUES (null, '"+@name.get_value+"', '"+@addl1.get_value+"', '"+@addl2.get_value+"', '"+@suburb.get_value+", '"+@pc.get_value+"', '"+@company.get_value+"', '"+@phone.get_value+"', '"+@fax.get_value+"')" @sql.do(@query) self.destroy end Anyone have any ideas? Also I'm kind of new to Ruby so if I'm doing anything silly then please also tell me so I don't keep making the same mistakes.
  4. That would just create a massive table. If 10,000 members read one post then he would need to insert the same piece of data 10,000 times. Now if 10,000 members read 100 posts then that equates to 1,000,000 rows in a table. That seems like a ridiculous amount of data. This could probably be fixed if he takes your other suggestion and doesn't check against posts that are greater than a timeout period, your example of 30 days.
  5. Optimising code doesn't always end up working out for the greatest. If you are worried about an extra line then why do you use two variables? Surely you could use something like this: $controller = $application->get_controller(); $controller = new $controller($application->get_action()); Or why don't you make it so that the constructor function in the class accepts an argument? $controller = $application->get_controller($application->get_action()); Something like that maybe?
  6. What about looping and each run through of the loop returns one email? for($i = 0; $i < 30; $i ++) { // code to return one email. } Then you would need something like an offset: <a href="email.php?offset=30">Next Page</a> Then you could use this offset variable to choose where to start from in the list of emails.
  7. Because you are resetting the variable $as within the loop.
  8. Wonder how it would go on my 2.4ghz core 2 quad
  9. Maybe variable variables? http://au2.php.net/manual/en/language.variables.variable.php
  10. @justinede: This is the way that ProjectFear meant and the way that I was explaining that checks for user timeout.
  11. It requires a little bit of work. You will need to check all the users that are logged in and then you will need to check if the time since they were last active is older than a current time so that you can set users to timeout.
  12. If you have changed servers then make sure your new server allows the mail() function. If the function is allowed then it could be some problem with your SMTP server.
  13. If he's using dreamweaver's code view and then writing the line and trying to look at it in the design view it won't work properly. He would have to upload it to a webserver or view it on his local computer if he has a php installation.
  14. EDIT: Nevermind. I re-read your post and this is 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.