-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
Still no errors or anything? Change $result=mysql_query("SELECT AVG(rating_num) FROM master WHERE code1='".$code1[$i]."'")or die(mysql_error()); to $sql = "SELECT AVG(rating_num) FROM master WHERE code1='".$code1[$i]."'"; echo $sql; $result=mysql_query($sql)or die(mysql_error()); Does $sql echo out what you expect it to echo out? Does entering in the echoed out query string directly into your db yield desired results?
-
Actually I can. I was just at a local computer store, Micro Center, and they sell computers with Ubuntu on it. You had a typo. I fixed it. ^^ Why wouldn't you be able to buy a Linux machine on the internet? Not saying I can't. My point is, I can't go to a local computer store and buy one at this time. This makes me cry.
-
Dammit, that's what happened to it! Wait...erm....forget I said that.
-
You can assign the resource id to a var and mysql_select_db and mysql_query will accept that var as an optional 2nd argument (useful if working with multiple connections).
-
Use firefox. built-in spellchecker ftw.
-
Okay so let me get this straight: You're saying that in your table, the id column holds the date, and the reservationdate column holds the id? If so...(lol?)... next guess is to again, check to make sure there is a row with 9 and 1182008 in it. Perhaps, for instance, 1182008 should be 11082008 or some other format?
-
Okay well offhand I'd say you got your vars transposed $id = $_GET['date']; $reservationdate = $_GET['id']; You're assigning 'date' to $id and 'id' to $reservationdate hopefully that will fix it.
-
so...are you sure there's a row in your table where id is 9 and reservationdate is 1182008 ?
-
If you are sure that $user has the value it's supposed to have, try adding this to the end: mysql_query("UPDATE users SET uploads = uploads +1 WHERE login = '$user'") or die(mysql_error()); see if it's spitting out any errors. If it's not spitting out any errors, I'd assume that that's not the problem, and move on to looking at your conditions and loops for errors.
-
$query = "UPDATE reservations SET firstname = '$firstname', description = '$description' WHERE id = '$id' && reservationdate = '$reservationdate'"; echo $query; Does this echo out your expected query string?
-
So...what's wrong with using echo $_SERVER['SERVER_SOFTWARE']; ? I don't think you're going to find any kind of environment variable or global that simple says "Windows"/"Linux"/"Mac"/etc... your best bet is to just use ^ and use some regex to parse it.
-
dunno, but maybe this has something to do with it: Earlier, you have $code1=$row["code1"]; but all of your other assignments would suggest it should be $code1[]=$row["code1"]; Because later on in your loop you attempt to use it as if it were an array, when you aren't actually making an array out of it.
-
Actually I can. I was just at a local computer store, Micro Center, and they sell computers with Ubuntu on it. You had a typo. I fixed it. ^^
-
Okay so it's been almost a week since halloween. Started out with this really big bag of candy. Now it's down to a few odds and ends here and there. I'm trying to figure out what candy I want. I decided that trying to choose which week old halloween candy to eat is kind of like picking teams in high school gym class. You start out eating all the good stuff but when it gets to the end, you got to start choosing between all the nerds and fat guys and weird unsociable guys. I think I'm gonna go for the nerd. It's strawberry flavored.
-
You also need to include how firewalls will ultimately be mankind's downfall, when we fail to shut down the AI we will eventually spawn, because of a firewall blocking access. Also, include this picture for reference. It doesn't really have anything to do with AI taking over the world, but it's a damn cool picture. Bonus points for making an analogy out of it.
-
Yeah, I recommend GIMP. To do what I did, I just opened the orange image, when to Colors->Colorize. Then you can make it any color you want.
-
Really funny, coming from someone who turns around and types this:
-
Did you echo $dbtime and $intDiff to see if they are holding expected values? My first guess is that $dbtime is somehow not being set, causing your $intDiff to trigger your default (as neil pointed out).
-
Turn on your error reporting, you will at least find that you are sending headers when you already sent output.
-
bate. Oh wait...we are just having fun trolling, right?
-
I used to live with some roommates in Orlando when I was a teenager, in an apt. complex off silver star and pine hills.
-
We actually have several other domains that used to have their own boards, but due to lack of traffic, we just redirected them here as forums.
-
[SOLVED] Adding Values Together Based On Another Row
.josh replied to jj20051's topic in PHP Coding Help
...or they could just leave it out altogether, seeing as how the OP made no indication that formatting was an issue. -
Ah see well the while loop in my code was just an example loop. You would use your $row = ... instead of that. Also you need to move $cols = 0; out of the loop: <table class="newitems" cellspacing="1" cellpadding="0" border="0" bgcolor="#ffffff" align="center" width="100%" style="border: 1px solid rgb(45, 135, 7);"> <tr><td colspan="3" align="center"><strong>New Products</strong></td></tr> <?php //Specify the query $query = 'SELECT * FROM `tbl_item` where category_id not in (104,105,106,107,108,109,110,111,112,113,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,132,133,138,139,140) GROUP BY `item_id` ORDER BY `item_id` DESC LIMIT 3'; //Execut the query $result = mysql_query($query) or die ("Error. Unable to perform query."); //Loop through all the results, displaying each one $cols = 0; while ($row = mysql_fetch_array($result)) { echo ($cols % 3 == 0)? "</tr><tr>" : ""; extract($row); $item_name = str_replace(" ", "_",$item_name); echo "<td width=\"33%\" bgcolor=\"#c2edaa\" style=\"border: 1px solid rgb(45, 135, 7);\">\n"; echo "<a href=\"$URL/item/$item_name/$item_id\"><img src=\"$SSL_URL/item_images/$thumbnail_image\" width=\"110\" height=\"100\" alt=\"$short_description\" border=\"0\" /></a><br />\n"; echo "<b>$row[item_name]</b><br />\n"; echo "$row[short_description]"; echo "</td>\n"; $cols++; } ?></table>