Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. ...and what is wrong with that result? a loop, couple of conditions to display certain things at certain times, and you've got exactly what you're asking for.
  2. Well I suppose it depends on where you're trying to call it, don't you think?
  3. properties from parent classes are used the same way as if it were declared in the child class. That is: $this->id is what you want to use.
  4. wait wait, didn't read your next post. Okay what you want to actually do is a join. SELECT store_categories.cat_id, store_categories.cat_title, store_subcategories.subcat_title FROM store_categories, store_subcategories, WHERE store_categories.cat_id = store_subcategories.cat_id ORDER BY store_categories.cat_id DESC and then you should get returned cat_id cat_title subcat_title 3 Books Adult Books 3 Books Childrens Books 3 Books Educational Books 3 Books Reference Books 2 Shirts Mens Tops 2 Shirts Boys T-ops 2 Shirts Ladies Tops 2 Shirts Grils Tops 1 Hats Causal Hats 1 Hats Party Hats 1 Hats Fishing Hats 1 Hats Sports Hats
  5. Umm...why not just ORDER BY id DESC in your query to begin with...example: SELECT * FROM table ORDER BY id DESC will return all your rows, ordered by id, in descending order.
  6. if someone did manage to inject values into your variables beforehand, your new value assignments will overwrite it, regardless of whether it's NULL or $_POST['variable'] so that's really unnecessary.
  7. mysql_affected_rows only returns the number of rows affected, not what actual columns were affected. And even then, that number can be misleading, as it only counts a row as affected if there was an actual change. AFAIK there's no built-in function for that. You can first do a select and then use for instance array_diff if you want to find that out.
  8. using cookies and they aren't enabled?
  9. on a side note, if your'e going to assign all of $r's vars to elements like that, use mysql_fetch_assoc instead and just extract($r);
  10. he said b not smaller than a, and not the same value. $a = rand(0,; $b = rand($a+1,9);
  11. SELECT * FROM Unchecked WHERE Filename LIKE "[Ayako]_Tayutama_-_%"
  12. no...i told you, that was pseudo code. You need to assign the mysql_query to a variable and use that variable as argument in mysql_num_rows. mysql_query mysql_num_rows
  13. you sure you're looking in the right table/database?
  14. if the $i is less than 0 or greater than $pages, don't echo. The end.
  15. alternatively... <?php $var[1] = array("blah1","blah2","blah3","blah4"); $var[2] = array("foo1","foo2","foo3","foo4"); $var[3] = array("nothing1","nothing2","nothing3","nothing4"); // example: print_r($var[$_GET['this']]); ?> <form method="get" action="this.php" name="this"> <select> <option value="var1">1</option> <option value="var2">2</option> <option value="var3">3</option> </select> </form>
  16. it looks like from your code $page is what the current page is, and $pages is what your total page count is. Your loop is: for($i=1; $i <= $pages+1; $i++) { So instead of counting from 1 to $pages, you would count from ($page - $x) to ($page + $x) where $x is how many pages on each side of the current page you want. You will also want to add a condition inside the loop to make sure the current iteration ($i) is > 1 and < $pages before you echo something.
  17. you would check it the same way as you check if anything else is in your table. select column from table where column = 'somevalue' ... if (mysql_num_rows > 0) { // something was returned, do something } edit: that's obviously pseudo-code.
  18. well str_replace() would replace (remove) from beginning and end just the same. And everywhere in-between. should use preg_replace instead, where you can specify beginning of string.
  19. you don't technically need that * in there.
  20. Could be. xD Right below the apartment with the family eating dinner? The one right below that.
  21. -moz-border-radius
  22. insert into site_users (name, username, password, email, joined) values (select site_users_new.name, site_users_new.username, site_users_new.password, site_users_new.email, site_users_new.joined from site_users_new where site_users_new.id = 10)
  23. .josh

    includes

    when you include a file that has relative links in it, the relative paths become relative to the file that is including that included file. as far as the warning: when you use a full url like that, fopen attempts to open it via http protocol, and apparently your server is not setup to allow that (or it could be outside a publicly accessible folder). make the links in the included file relative to the file that is including the included file.
  24. wordwrap
×
×
  • 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.