-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
...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.
-
Well I suppose it depends on where you're trying to call it, don't you think?
-
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.
-
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
-
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.
-
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.
-
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.
-
using cookies and they aren't enabled?
-
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);
-
he said b not smaller than a, and not the same value. $a = rand(0,; $b = rand($a+1,9);
-
SELECT * FROM Unchecked WHERE Filename LIKE "[Ayako]_Tayutama_-_%"
-
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
-
[SOLVED] No Errors but Data not Submitting???
.josh replied to cmaclennan's topic in PHP Coding Help
you sure you're looking in the right table/database? -
if the $i is less than 0 or greater than $pages, don't echo. The end.
-
[SOLVED] No Errors but Data not Submitting???
.josh replied to cmaclennan's topic in PHP Coding Help
post code. -
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>
-
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.
-
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.
-
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.
-
you don't technically need that * in there.
-
Could be. xD Right below the apartment with the family eating dinner? The one right below that.
-
-moz-border-radius
-
Issue copying same info from one table to another.
.josh replied to Solarpitch's topic in PHP Coding Help
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) -
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.