Jump to content

xylex

Members
  • Posts

    292
  • Joined

  • Last visited

Everything posted by xylex

  1. You need to store the record first, then get the id that was set when the record was stored. For mysql, you want to use mysql_insert_id()/mysqli_insert_id(); If you try to get the next number first, you setup a race condition where multiple threads could go at the same time and get the same number as the next insert id, but only one of them would actually use that number when the records are inserted.
  2. Well i would not call it lazy when i've been searching for hours to find the answer and didn't. Thanks to the other person who responded and didn't call my issue lazy. LMAO That one was great.
  3. URL's wrong. movie_categories.php?cat_id=horror?pageno=2 should be movie_categories.php?cat_id=horror&pageno=2
  4. Do a subselect of the post count and order by that? And mysql_real_escape_string() only secures you on quoted values, and you're not quoted in the order by clause there. Use a whitelist of values instead.
  5. I would really recommend starting with writing plugins for systems that have good structure, well commented code, stable development, etc. You're going to be learning a lot from the code you're working with, and it's a lot better to learn good habits and then adapt to working with a horrible code base like OSCommerce than the other way around. But to answer your original question, there's really only so many ways to to structure an application with slight variations, so once you start working with a lot of different systems and get comfortable with them, picking up a new one and understanding it isn't an issue.
  6. Corbin- I think that there are a lot of people in a similar situation as you. I've been doing PHP for awhile now, just passed my 10 year mark on my first PHP site...talk about crappy code . There are a few people in my area that are a similar situation as yourself that I meet with on a weekly/bi-weekly basis for an hour or two to on the cheap just to go over any issues that they run into, help plan system design, and do some code review with them to catch any issues. I know a few other experienced guys who do the same, it's a good way for us to see a variety of code and teaching/explaining something always gives you a better understanding. I'm sure that you could find someone around you that would be willing to do that too. Maybe try asking at a meetup group or posting on a local dev board.
  7. You need to use curl instead of file_get_contents, and add the headers like curl_set_opt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.7) Gecko/2009030516 Ubuntu/9.04 (jaunty) Firefox/3.0.7');
  8. If all you want is a proxy, then you should probably just install one on the server and use that. PHP/Apache's probably the wrong way to go for this.
  9. Looking from what I think you're trying to do, your error is in $subgroup = mysql_query($subgrouprank); while (list($subgroups) = mysql_fetch_row($subgroup)){ echo $subgroups; } $users = "SELECT data1, data2 FROM users WHERE level = 20 AND subgroup = $subgroups"; Would work better as $subgroups = array(); $subgroup = mysql_query($subgrouprank); while (mysql_fetch_row($subgroup){ $subgroups[] = $subgroup; } $subgroups = implode(', ' , $subgroups); $users = "SELECT data1, data2 FROM users WHERE level = 20 AND subgroup IN ($subgroups); " But why aren't you just doing a join on this to do it in one query $sql = ' SELECT data1, data2 FROM users JOIN subgroups ON (subgroups.id = users.subgroup) JOIN groups ON (groups.id = subgroups.group) WHERE user.level = 20 AND groups.rank = 20 ';
  10. I just use the cell phone/ethernet cord/salad bowl method.
  11. You're trying to setup a many to many relationship schema. Try Table of books Table of characters Table of book id's and character id's And query for your sublists.
  12. Kill the float:left; on .panel, no need for it there and float doesn't cause the parent div to expand without a clear div like racer x said.
  13. Can you share the rendered HTML?
  14. No need for regex, php gives you filter functions for this. http://us.php.net/manual/en/function.filter-var.php filter_var($string, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH);
  15. Templating is really just DOM element iteration and tag replacement. If you make a DOM based templating system that mimics the behavior of a library like jquery, you minimize the need for frontend guys to learn a new syntax. I'd recommend reading up on the DOM libraries, specifically DOM and SimpleXML, and go with a DOM based templating engine. I know this isn't the most processor efficient code, but in terms of project maintainability, it's a heck of a lot easier to find a good XHTML/JS coder than a good XHTML/JS/PHP coder.
  16. Lately, I've been seeing a lot of the "partnership" no pay stuff in online classifieds containing something along the lines of "I have successfully grown and sold a startup before" or "I have successfully built up and sold 3 websites previously" either preceded or followed something about how they don't have any money to pay a developer for their new startup so it would be equity only. The lack of money for the new startup really shows a lack of success in previous business, so who are they thinking will buy that crap?
  17. Have you checked your memory_limit, upload_max_filesize and post_max_size settings to make sure you're not hitting something there?
  18. What are you talking about!?! It was great, classic X-Files. If you followed the show, you would know that there were standalone episodes, and then the conspiracy, black oil ones. The standalone ones rarely had anything to do with aliens.
  19. http://xkcd.com/323/
  20. Any particular reason you're trying to do this with regex and not an XML library?
  21. SQL Injection http://www.communitycouch.net/index.php?action=viewboard&board=1a`%20JOIN%20`1b
  22. I'm not sure that this is the right place to request those types of favors........ Other than the template, is there anything that you've customized with PHPBB? If not, then just make sure you keep the script current.
  23. REST is just another way of saying that you're using URL parameters. You can pass in an XML string as a value for one of the parameters, then parse it out if you wanted to, but I'm not sure why you would do this. XML is typically used for SOAP based services, not REST. If you're looking to go the SOAP route, look at NuSoap, Zend, the of course the built in stuff in PHP.
  24. Try createCDATASection() In the manual, you want the stuff under DOM, not DOM XML. Confusing, I know.
  25. I don't think MyISAM supports fk constraints. Try using InnoDB.
×
×
  • 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.