premiso
Members-
Posts
6,951 -
Joined
-
Last visited
-
Days Won
2
Everything posted by premiso
-
I do not see where you are connecting to mysql and selecting the database? Are you connecting and selecting the DB? As for mike's suggestion he meant this: $q4 = mysql_query("SELECT * FROM tags ORDER by id DESC LIMIT 25") or trigger_error("Query Failed: " . mysql_error()); See if that triggers an error, if so what is it. If you are not connecting to MySQL, well you have to be connected for it to work.
-
Rising of oceans now apparently caused by god's tears..
premiso replied to 448191's topic in Miscellaneous
Nuclear all the way. Just think if we can figure out how to make a nuclear powered vehicle (cars) which was safely contained. You would very seldom have to "fill up"...it is just crazy to think about, which is probably why it has not been looked into more. I am no scientist by any means so I could be missing a big part of it, but if a sub marine can be powered by nuclear energy, why not cars (other than the obvious fact of possible radiation exposure). -
If you want to redirect to the page, sure.
-
No, because you would just define the variable instead. $_GET['sn'] = 1; // or $sn = 1; however it is coded include 'order.php'; Would work, reason being. You are including the script and not executing it. If you want it to execute you can use file_get_contents to execute it then echo the output, but you would have to use the full URL.
-
A: You code the start button into your flash movie - B: http://kb2.adobe.com/cps/127/tn_12701.html
-
You want to look into AJAX, using AJAX you can make server calls and it can re-run the connection and check for new messages. Other than that you have to do a forced reload, as even just sleep the script while setting the set_time_limit to infinite will slow down your server a ton by eating up the memory. Better to do the AJAX calls and get the data that way.
-
I hate going to the movies soo much. Every time some fuckin idiot is on their cell phone talking or teens are there making retarded jokes or someone brings their infant kid, who when he starts crying, they do nothing about and stay in the theater. Then when you complain to the people at the desk they come in 5 minutes later and everything is quite for the 5 minutes they are there. Retarded, screw that I will wait for the DvD/BluRay. At least that way I can watch it in the comfort of my own home and not have idiots ruining the movie. Why pay $11 to see a movie and be stressed out when you can pay $15 to own it and watch it at home
-
To change the title without a page reload (if it can be done) you will need to use Javascript. In order for the title to change you have to do a page reload with just PHP/HTML as the PHP is done on the server side and all HTML does is display data. Javascript can manipulate HTML on the client side. So yea, if it can be done you will have to use Javascript or force a page reload each time someone selects a new image.
-
That and please do not put titles in all caps (for more information why read the rules #2 under forum guidlines), it is so annoying. Thanks.
-
Correct, that is how it will be done due to certain limitations. This is where you use your PHP code to display how you want: $query = "SELECT c.name, f.forumname FROM forum f JOIN cat c on f.catid = c.id ORDER BY c.name, f.forumname"; $result = mysql_query($query) or trigger_error("Query Failed: " . mysql_error()); $priorCat = ""; $output = ""; while ($row = mysql_fetch_row($result)) { if ($priorCat != $row[0]) { $priorCat = $row[0]; $output .= "<u><b>" . $row[0] . "</b></u><br /><br />"; } $output .= $row[1] . "<br />"; } echo $output; And it will display as you wanted it to. EDIT: Since I already had this coded up before the above replies I decided to just post it.
-
The only works if you subscribed, what they are talking about is when you click on "Show new replies to your posts." it shows everything you ever replied to if there is a new reply to that thread. They would like to be able to filter that list and remove some posts that they originally replied to because it gets annoying seeing some topics there all the time
-
Give it a shot. <?php $x = "hello"; $ternTest = ($x == 4 ? $x:"phooey"); echo $ternTest; ?>
-
My SQL is a little rusty, but this query would work. In your PHP code is where you would make the display how you want it, but that should have it sorted like you described in the output. SELECT c.name, f.forumname FROM forum f JOIN cat c on f.catid = c.id ORDER BY c.name, f.forumname
-
It seems to easy to be true...but this: $newname="../../upload/".$image_name;
-
He has the end bracket, but you are almost there. You have to start the else right after the if ends. Not doing so causes some syntax errors. if ($correct) { // code here }else { //code here } The above is correct way to do it, below is the wrong way if (!$correct) { } //code here else { } Hope that clears it up for you
-
Well, to be honest, I probably could have figured out the problem with the code, if it was indented properly (or at least setup on multiple lines) and was easier to read. As I can see there is a write <br> etc through out the code that I do not know if it is apart of the code. If it is that is where most of the errors lay, but given the disregard of the help he wants to receive, by not reading the rules before posting and not taking the time to clean up his code a little bit, well yea, no help will come (at least I hope none will come).
-
You had some major syntax issues in your code, namely your quotes. <?php print "<input type='hidden' name='ID[$i]' value='{$result_row['ID']}' />";?> <?php print "<select name='Priority[$i]' >"; ?> <?php print "<option value=''" . (is_null($result_row['Priority']) ?" selected='selected'":null) . "></option>"; ?> <?php print "<option value='10'" . ($result_row['Priority'] == '10'?" selected='selected'":null) . ">10</option>";?> <?php print "<option value='15'" . ($result_row['Priority'] == '15'?" selected='selected'":null) . ">15</option>";?> <?php print "</select>"; ?> Why in the world are you going in and our of PHP like that? This would be much simpler and works just the same: <?php print "<input type='hidden' name='ID[$i]' value='{$result_row['ID']}' /> <select name='Priority[$i]' > <option value=''" . (is_null($result_row['Priority']) ?" selected='selected'":null) . "></option> <option value='10'" . ($result_row['Priority'] == '10'?" selected='selected'":null) . ">10</option> <option value='15'" . ($result_row['Priority'] == '15'?" selected='selected'":null) . ">15</option> </select>"; ?> So I changed your quotes around on the selected, you were using a single quote after the ? and also using them around the ='selected' that was a syntax issue. Also you will notice on the first ternary I use the is_null function as that is how you have to test if a variable is null, you cannot simply do a comparison. Either way that should work for you.
-
Really it is an HTML question. You want to look into anchor tags an example of what you will need: <FORM METHOD="post" ACTION="#bottom" id="check"><table> //whole survey form here// </table> <table> <a name="bottom"></a> <input type="submit" name="signup" id="submit_btn" value="" /> </table> I believe that is how it would work, so when the form submits it will automatically scroll to that anchor tag (notice in the form action you have the #bottom).
-
mySQL database, only a certain tables were created
premiso replied to husslela03's topic in PHP Coding Help
For one, you do not need to keep re-selecting the DB. If it is the same DB doing it up top by the connection function is fine. For two, you do not have an error catching / displaying. Chances are your SQL has a en error in it. You can add error showing by doing: mysql_query($sql, $con) or trigger_error("Query Failed: " . mysql_error()); Three, please post all code in tags. Four, as for why your code is not working you have some weird stuff I have not seen before for example the users table $sql= "CREATE TABLE Users ( userID int NOT NULL AUTO_INCREMENT, PRIMARY KEY(userID), FOREIGN KEY(login_ID) references Logins(loginID), LastName varchar(15), FirstName varchar(15), accessLevel int, status int )"; I do not know what that references does but you have login_ID and loginID, which is it? I do not see either in the users table, which I think you would need for a foreign key definition. So yea, see what errors are coming up and fix it from there. -
You are not fetching the data with mysql_fetch_row
-
Rising of oceans now apparently caused by god's tears..
premiso replied to 448191's topic in Miscellaneous
In my opinion, I am for doing my part to help out. IE installing lights that save me money, turning off electronics when not in use to save me money in the short term etc. As far as global warming is concerned I do appreciate that my children's children may experience it and I will do my part, I am just not going to go hog wild about it. The only real bad part is, me doing all these energy efficient acts really save me money now, but later down the line they energy companies are not going to be making enough money so they are going to charge more etc. So all this BS that it saves you money in the long run is just stupid. I do do it to help with the bills now, but in reality it is just nice to pitch in so my kids and their children may have it easier. The other stupid thing is those dumbass 'save the polar' commercials. I mean come, fuck the polar bears I need to save my ass first. -
Lol reminds of that episode of South Park where the internet goes out and everyone freaks. So once it gets fixed they decide that you should only look up porn once a day and twice at the most. Good episode. The bast part, all that needed to be done was reset the router lol!
-
It is called the Ternary Operator.