Jump to content

The Little Guy

Members
  • Posts

    6,675
  • Joined

  • Last visited

Everything posted by The Little Guy

  1. We will probably need to see more than that. Cant really help you without the exact line
  2. you would have to show us how you generate the img tag.
  3. have you looked at the src in the img tag in the html? Is it pointing to the correct location?
  4. If your going to do it via php, you should do it using curl, curl has built in timeout settings, if you do set_time_limit that will timeout YOUR webpage where as curl will only timeout the connection to twitter.
  5. Third your using the wrong datetime format in the database. It should be: YYYY-MM-DD HH:MM:SS
  6. you can do it via javascript. <div id="twitter_update_list"><!-- Your Latest Tweet Will Display Here Once Loaded --></div> <script type="text/javascript" src="//apis.jssnips.com/twitterblogger/latest.js"></script> <script type="text/javascript" src="//twitter.com/statuses/user_timeline/my_user_name.json?callback=twitterCallback2&count=1"></script> replace my_user_name with your twitter username
  7. The best way to stop duplicates, is to add a unique index on the table. then when you do an insert into that table: insert ignore into ( ... ) values ( ... );
  8. One of our tables has about 225,000 (~2/sec) inserts per day, and every so often we need to insert 2+ records, so instead of doing one at a time to get the insert ID's it would be nice to do it all at once. So with about 2 addition inserts per second, you can almost guarantee that while I am doing my mass insert someone else will be wanting to insert 1 or more rows as well. So if the other person doesn't get locked out, he could insert halfway through my insert, and I will then have bad historical data. Does that answer your question?
  9. When using mysqli_stmt_bind_param (object or procedural), does this also act like mysql_real_escape_string? Does it prevent SQL Injection? http://us.php.net/manual/en/mysqli-stmt.bind-param.php It seems like I don't have to do anything else, but maybe I am wrong?
  10. I hear people say "linux mint" is a better distro...
  11. But Barand already told you this. Right but if I get auto_id 10 on one connection, and another connection gets auto_id 11 and we each insert 5 rows, I am not going to get all 5 of my inserts, I will get mine and someone esle's. since supposedly the table doesn't get locked on inserts, but maybe that is Storage Engine Specific...
  12. I just installed Ubuntu 12.04, and when I start it, it takes forever to load anything. But when I start it in "recovery mode" everything runs very snappy. Why is it so slow in normal mode?
  13. I have 5.4 and mysql works just fine
  14. Going off Illusion: insert into table_a (col1) values ('one'), ('two'), ('three'); set @first_iid = (select last_insert_id()); set @last_iid = (select (row_count() + @first_iid) - 1); That should get us our first and last insert id's, and assuming the table increments by one, you can calculate all the rows inserted by basic math. I keep hearing that doing this is bad though, because someone could do an insert while my insert is only half way complete. But it seems like some of you are disagreeing with that.
  15. #2 has wild car operators in them, and the equal sign comparison doesn't support wild cards so, that is what it is searching for something that has % on the ends of what $program_name is. remove them and you should get what you are looking for
  16. when the user goes to a page check the session this should be an int for the page/step number they are on. then you just would compare their session to the step number. if the step is bigger than the session number send them back to their session number's step. once they complete a step successfully increment the session number.
  17. does the user on the database have enough permissions to import the dump file? also remove the table name from the command your running it is already in the dump file. you also have too many quotes. exec("mysql --user=... --password=... --host=... $database < /location/$filename.sql");
  18. with a single insert query, the next insert waits, till the previous one is done before it can go, I would assume that this is the same thing that way you wouldn't have the alternating inserts. I am not sure though.
  19. is it possible for two members to run this, and they are inserted every other? for example we both insert 6 records (total of 12) and it looks like this for the insert: me you me you me you .. .. and so on If that happens, then this won't really work will it?
  20. I know there is last_insert_id() but it only gets one of them, I would like a table that returns all of them (I believe what your saying).
  21. Lets say I want to insert into a table using one query, like this: insert into test (name) values ('monkey'), ('baseball'); what can I do to get both of the insert ids?
  22. Instead of using php to populate an array, why don't you just place it into hidden HTML Div's then when you want to show one show hide all the divs then show the one you want by toggling css's "display" property.
  23. I disagree. With Andy-H's method - a fallback method is given and search engines can follow those links. Thus, no decrease in SEO would happen. That was meant for if you didn't have a fallback. Sorry.
  24. don't use ajax to get main content, use it for processing little pieces of information or retrieving un-important information many robots can't handle ajax. Using to go from page to page will decrease your SEO due to the lack of information about the new page. Take this page for example: http://phpsnips.com/snip-29 it hides shows/hides information using javascript without using ajax the information is all there so the Google bot or other bot can still read information about the page but visually you don't see everything unless you switch tabs. As Andy said, make it so the site functions well if the user doesn't have javascript turned on, an example would look like so (jquery): <script> $(document).ready(function(){ $("#myElement").click(function(){ // Do some cool stuff! // returns false so we don't follow the html link return false; }); }); </script> <!-- HTML CODE IS HERE --> <a href="more_info.php?id=123">Link to another page</a> if the user has javascript enabled the link will not go anywhere, and the jquery will run. If javascript is disabled the link will go to where the href says and the jquery will not run.
×
×
  • 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.